Close
0%
0%

LoRaWAN AQI Sensor With E-Paper Display

This is a lowpower consumption Air Quality sensor, it measures T/H/P/AQI and commit the data to LoraWan(TTN), together with a E-ink Display.

Similar projects worth following
This project is a re-use of an Electronic Shelf Label (ESL) which is sold as junk on Ebay. The goal is to turn "junk" into useful devices that make our lives a little better.

This project is an open Hardware project, after replace the ESL's mainboard, I try to turn it into a low power consumption AQI sensor with "IOT" function, together with a free APP cayenne from "mydevices", which allows you check the sensor data remotely.

The target battery life time is 6 month, with 2 PCs original CR2450 battery from the ESL.

The "Useless" ESL seems to be new old stock without any public documentation. It has a 2.9-inch E-Ink display, a SEM9110 SOC controller which is also w/o any documents, 2 CR2450 batteries, and a nice case. 

After I received those ESLs, I want to test whether the EPD(WF0290T5PCFxxxxx) is compatible with the wildely used Waveshare's driver, but found the FPC contact point is reversed compare with normal EPD, thus I flyed some cables from the original mainboard to a STM32 bluepill board, after configuration, luckily the EPD works :) 

4 years ago I played the BME680 together with a 2.3Inch E-ink display,  planned to make a small beautiful device like "SHT31 SMART GADGET".

But due to many reasons, it was given up. This time I can reuse it and bring the sensor data to the internet. 

The system HW components:

BME680: low power gas sensor which can measure AQI, together with Temperature, Humidity, and atmospheric pressure.  The average current consumption at 0.33Hz datarate for T&H&P, 0.33mHz AQI is 0.1mA.


Seed E5 Lora module: It's a small module based on STM32WLE5JC, it was choosed for sensor control and commit the sensor data to the free LoraWan, in this project is TTN(The Things Network). This module is also a low current consumption module, with 2.1uA sleep current.


2.9 Inch E-Paper Display: which is also a low power cunsomption element, comes from the ESL.

2 PCs CR2450 3V battery:  around 2*600mAh capacity, come from the ESL.

1 PC BMI270 IMU sensor: ultra-low power IMU sensor, planned used for wakeup the sensor and use motion as user settings input, like adjust the clock, show historical data...but due to out of stock in JLCPCB, so it's not mounted on the PCB.

1PC vibration sensor:  Due to above BMI270 is not avalible, using a low cost and 0 current consumption as user wakeup, which can trigg one measurement by the user, or show historical data, I'm not sure.

1PC Beeper: Planned for alarm, like the smoke detector function, or used for fart detection alarm :)

2PCs LED: Indicate the Lorawan link status? not fixed yet.

2 Antennas: 1 PCB antenna and 1 spring antenna, will check which one is better.

1 PCB: From JLCPCB together with SMT function, but not all the components are soldered by JLC, for eg. the MOSFET for the EPD and battery contactors are removed from the ESL's original PCB. 

1 Housing: Comes from the ESL, but with some curtting in order to fit with the new added modules. 

Current Status:

12.09.2022: 

There is no issue with the HW, but the external battery measurement circuit is not needed, since E5 module can measure the Vbat by itself. 

SW: 

1. EPD basic driver is woking.

2. LoraWan is working, the sensor can commit the data to TTN

3. Cayenne Low Power Payload is working, can check the sensor data in the APP and browser

currently on the handwritting like font on the EPD.

EPD_AQI_FW_V1.4.hex

Firmware for lora E5 module

hex - 592.10 kB - 10/14/2022 at 21:26

Download

Gerber_PCB_EPD_2P9.zip

PCB Gerber File

x-zip-compressed - 128.54 kB - 10/14/2022 at 19:35

Download

EPD_2P9_Lora_AQI.pdf

The schematic of the Lora AQI

Adobe Portable Document Format - 94.62 kB - 09/12/2022 at 21:30

Preview
Download

  • 14.10.2022 First Milestone Achieved

    aduecho10/12/2022 at 21:45 0 comments

    Update on 14.10.2022:

    1. In order to calculate the estimate battery life time, we need to know the current consumption for the sensor node at different stages.  In this case it's mainly include:

    A. All the devices sleep/suspend (around 1.5uA to 2.5uA)

    B. EPD refresh

    C. BME680 measure T&H&P

    D. BME680 measure AQI(gas)

    E. STM32WL send data to LoraWan(TTN) and open receive windows(RX1/RX2)

    make a rough calculation, the system can running around 2 months, with EPD refresh once every minute, AQI update every 5 mins,  and commit date to TTN every 15 mins. And it seems not bad.

    But when I build another one in order to test the real battery lifetime, the Node stopped working after several hours, even it equipmed with 2 new CR2450 batteries. then check the battery voltage, it's only around 2.6V, the nominal value is 3V, and new battery voltage is 3.3v, it's dropped to fast.  Then reconnect the 2.6V batteries with the node, it works again. After analysis, found it's caused by the peak current when the RF working together with EPD refresh, in some conditions the BME680's heater also workings in parallel. At this moment, the peak current is more than 100ma, which is far beyond the poor battery's capacity. There is no detail specification for the peak current of CR2450 battery, Energizer said it's 9mA(https://data.energizer.com/pdfs/cr2450.pdf),  Murata said it's new battery CR2450R: "The maximum pulse discharge current*1 has been doubled to 50mA compared to that of Standard. "(https://www.murata.com/en-global/products/productdetail?partno=CR2450R), which means the standard CR2450 can provide 25mA peak current.

    This current waveform captures the EPD refresh and Lora send, it's already over 40mA, and the battery doesn't survive when the AQI sensor's heaters (plus ~16mA 1.6s) work in parallel..

    I want to order Murata's CR2450R battery, but found the delivery time is quite long due to they are "dangerous goods". Then using supercapacitor is also may a solution, even it may has several uA leakage current , I found out out 2PCs 0.1F/5.5V supercapacitors which purchased 2 years ago, but found they are defected, they don't have any capacity anymore.

    I nearly want to give up, then checked the STM32WL55 datasheet again,  found there is an application note to reduce the RF power. After optimization, the peak current for RF reduced from 33mA to 20.5mA, the SNR seems not influnced by the optimization.

    Before RF Optimization:

    After Optimization:

    encouraged by this, I creat a new Look Up table for the EPD partial refresh, which reduce the partial refresh time from 1.8s to 1.2s, the payback is stronger afterimages. but it doesn't matter, after 10 cycles(equal 10 mins) faster refresh execute one time slower partial refresh. And make a full dispay refresh every 2 hours.

    Then add status machine to avoid EPD/RF/AQI_Gas heater working in parallel, in this way we can limit the peak current within 25mA, which means ideally 12.5mA peak current for each battery. 

    To check what's the real battery lifetime, a new battery is installed in the Node at running from 12.Oct evening, let's see how long it can last(seems the battery voltage strongly influnced by the temperature).

    2. Some interesting tests

        2.1 Put the Node into the refrigerator freezer(-18deg), the EPD can't working under this low temperature but it can recovery when the temperature recovers.

        2.2 The cracked EPD can still keep the last image

     2.3 Two Sensor Nodes has similar measurement result

    2.4 The PCB antenna has similar SNR as the spring antena when the housing is not mounted, but when the housing is mounted, the PCB antenna is around 1.5db weaker then the spring antena. This may caused by the PCB antenna is partialy covered by the battery, which has metal housing.

    You can find the PCB gerber file and FW for the MCU, having fun.

  • 05.10.2022 Update:

    aduecho10/05/2022 at 20:39 0 comments

    05.10.2022 Update:

    There is not much free time recently, so the update is slowly.

    1. Struggling with the low power mode: At beginning, the boad suspend current(MCU in STOP2, EPD & BME680 are in sleep mode) more than 600uA, even removed the EPD, the suspend current is not reduced.

    2. The BME680 is  suspected, the heatter seems on by default, then send command to turnoff the heater, but it doesn'r help either.

    3. Suspect the soldring paster cause current leakage(the 1st soldered with hotplate), or the Lora-E5 or BME680 get damaged due to ESD issue. Then take another PCB, after make sure the PCB is without leakage current,  solder this board carefully with iron, only put lora-E5 module and EPD driver on it. After testing, the suspend current is still too high, around 400uA. 

    4. Connect the board to the debugger, together with a DIM, debugging code and check the relative current change.......

    5. Finally found we need to set the used pin to analog mode to save current, before I set them as input with pullup / pulldown resistor, which consume much more current than analog mode. 

    6. Solder BME on the board, the suspend current has no big difference.  Now the 2nd board suspend current is ~ 1 . 5uA, but the 1st board suspend current is still higher, around ~ 2.4uA. The root cause is unknown, maybe by devices deviation.

    7. Debug each SW modules, make sure they are working fine after the CPU recovered from Stop mode. and they can't let the system caused addtional current during system suspend mode. Struggling a long time with the SPI recovery after stop mode.

    8. Now the system running with BME680 LP mode(sensor date update every 3 Secs), Send data to TTN every 60s(with TX_POWER_11 due to the current mesurement device limitation), EPD partial update every 56 Secs. Here are some current data:

        A: BME680 sleep, Lora TX current.(1st peak is TX data, 2nd is RX1, 3rd is RX2, 4th is a timer wakeup CPU) 

         B: Suspend current, this is the 1st board with higher suspend current

          C: BME680 working current(it makes a measurement every 3 Secs, at 57s there is a Lora TXD)

           D: Zoom in for BME680 one measurement:

           E: EPD partial update current:

    9. it seems each activity will consumes a lot of energy, so the plan will be set the BME680 working with LP for T/H/P sensors, and ULP for AQI sensor, the EPD will be partially update every 56 secs in order to display the time correctly. And Lora commit data to TTN every 15 mins or the sensor data changed a lot, maybe 20% within 15mins. The EPD will make a full refresh each 2 hours to avoid shodaws like this:

    10. The historical chart will be add later, hopefully all of this can be finished in Oct. Then I can share the firmware here for those interested.

  • 21.09.2022 Update:

    aduecho09/21/2022 at 20:41 0 comments

    1. EPD partial update is working well now, the driver provide by Waveshare(seems a wrap of Good-Display‘s driver) give a serious afterimages when using partial update, after modify the LookUpTable, it works fine now. But after update the LUT, the partial update time takes 1.2s. The advantage is the display doesn't have obvious afterimages after one night running (around 1000x partial update).

    2. Basic font are ready to us, the font width is dynamic, in order to have the "handwriting effect", but since there are only few characters shows on the display, so it doesn't make much sense.

    3. Icon images are ready, there are 4 dynamic icons: LoraWan joinned status(0 and 1) / battery level (0-19) / Emoji for AQI(1-7) / AQI accuracy level (0-3, the right down target icon).  (Before this, the EPD just show a UI picture)

    4. Get time from LoraWan server (TTN) is working,  by using deviceTimeReq MAC command after the device joined the LoraWan.

    5. Cayenne LPP works fine till now, it has a user friendly UI, you can check the historical data easily.

    There still a lot of todos:

    HW side:

    1. Soldering the beeper and 2 LEDs on the PCB, when the AQI level is very bad, then beep 2 seconds.

    2. Remove the battery voltage circuit on the PCB, since it's duplicated, to reduce the leakage current.

    3. Test the PCB antenna and the spring antenna, check which performance is better.

    SW side:

    1.  store the lora configuration into the EEPROM, to avoid "DevNonce is too small" problem in TTN when the device rejoined the TTN net. (when the TTN console report this error, the device still can join the TTN net after a certain time, but this will use a lot of energy )

    2. Store BME680 sensor status info into flash, to avoid the long initial time(2-5 mins) of BSEC.

    3. Set BME680 into Ultra-low power mode, T/P/H update period is 3secs, AQI update period is 300s. Set the EPD update rate to 30sec, display the 10 measurements mean value of Temperature and Humidity on the display.

    4. Comit sensor's data to TTN once per hour, the data contains the sensor's Max/Min/Mean value during this 1 hour.

    5. Using the varibration sensor to change the EPD UI, show the last 5 day's temperature & AQI data.

    6. Set Seed-E5 module into stop mode with RTC/EXTI wakeup, in order to save power.

    7. Test the whole system dynamic current consumption and optimize it, evaluate the battery lifetime

    usage extension:

    Due to gas crisis in Germany, the temperature in the office may not over 19 deg this winter, seems my office covered by TTN, so if it's too cold there, I can choose Homeoffice.  And if the AQI is bad, the beep can notice me to open the window for a short time.

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates