Report Weather Station with Solar Panel - Ameba Arduino in Electronic Gadgets Posted October 9, 2020 As clean energe continue to attract huge attention due to the foreseeable demise of fossil fuel, harvesting clean energy , particularly solar energy, for embedded system make sense in many IOT applications for its low power consumption and sometime awkward placement, this example will guide you through how to harvest solar energy for an IOT project, Solar Panel – Upload Temperature And Humidity Data To LASS System Preparation Ameba x 1 DHT11 x 1 Solar Panel (1W) x 1 Lipo rider pro x 1 Li-Po battery (1100 mAh) x 1 DS3231 RTC x 1 AMS1117-3.3V x 1 (Optional) Solar Panel The solar panel we use is: http://www.seeedstudio.com/depot/1W-Solar-Panel-80X100-p-633.html The difference of the models with different power is the time it takes to charge the lithium battery. In general, solar panels with 1W power is sufficient for the weather in Taiwan. Lithium Battery In the night, we use lithium battery to provide power. Take the occasional cloudy days into account, we choose the lithium battery of size 1100mAh. Note that batteries with capacity smaller than 500mAh are not recommended. Lithium Charge-Discharge Module In the daytime, besides providing power to Ameba, we expect the solar panel to supply power to charge the lithium battery. On the other hand, if the solar panel cannot provide enough power, we rely on the lithium battery to supply power. Therefore, we need a Charge-Discharge Module for the lithium battery. Here we use Lipo Rider pro, it uses JST 2.0 joint. There are a number of alternatives: Lipo Rider: http://www.seeedstudio.com/depot/Lipo-Rider-v13-p-2403.html PowerBoost 500C: https://www.adafruit.com/product/1944 PowerBoost 1000C: https://www.adafruit.com/product/2465 DS3231 RTC We use DS1307RTC library supports DS1307/ DS1337/DS3231, here we use DS3231. AMS1117-3.3V The default output of Lipo Rider Pro is 5V, hence can be connected to Ameba directly. If you wish to provide only 3.3V to Ameba module to save power, you can use AMS1117 to step-down the voltage to 3.3V. Example In this example, we use solar panel to supply power for Ameba. When the power output of the solar panel exceeds the power demanded by Ameba, surplus power charges the lithium battery, which can supply power at night. Open the sample code in "File" -> "Examples" -> "AmebaMQTTClient" -> "lass_for_dht_plus_ps_nfc" Note that when you choose to supply power only to Ameba module, the 3.3V on Ameba board would be unavailable. For the modules that require 3.3V power, you need to step-down the voltage to 3.3V to supply power. If you do not want to use AMS1117, you can supply power to 5V directly (note this enables DAP and leads to additional power consumption). Another noteworthy point is that the antenna in the figure is cut down from Ameba, and is connected to Ameba through wires. To run the example, a few settings should be done: Please provide the ssid/password for WiFi connection. The clientId of LASS is set to FT_LIVE_12345678 by default, please replace it with a different value. Compile and upload the sample to Ameba and press reset button. Wait for a while, then you should see the data in the website: http://g0vairmap.3203.info/map.html The sample code uses the location of Realtek by default. For the NFC function, you can use your android phone to scan the NFC antenna to download the NFC APP from google play. (Or you can download from: https://play.google.com/store/apps/details?id=com.realtek.sensortag) After the APP is installed successfully, use your phone to scan the Tag to read the latest temperature and humidity. Press the button at the bottom to get the temperature and humidity information of the day. Energy consumption analysis The power efficiency of the solar panel The measure of brightness here is Illuminance(LUX), light with different wave length have different illuminance. We use Halogen bulbs to simulate sun light. In Taiwan, in the time between 10am to 2pm, the measured illuminance is about 100 LUX on average. At 4pm, the measured illuminance is about 10 LUX on average. Using 100W Halogen bulb, we measure 10k LUX illuminance in distance 20cm, and 100k LUX in distance 5cm. However, the shorter the distance between light source and solar panel, the higher the temperature of the solar panel. As the temperature of solar panel increases, the power efficiency decreases. We keep the distance 20cm in our experiment here. When the illuminance is 100k LUX, the solar panel outputs 210mA current, with voltage 4.8V. 4.8V x 0.21 A = 1.008 W. When the illuminance is 10k LUX, the solar panel outputs only 40~60mA current Power consumption of NFC In this example, the NFC function is kept available when Ameba enters deepsleep. The power consumption of NFC is about 7mA, which is considerably high compared with deepsleep. Power consumption of RTC Normally, RTC uses battery to hold the time precision. However, when RTC is connected to Ameba, Ameba enables its I2C interface by default, which leads to additional 2mA power consumption. Total power consumption If you step-down power source to 3.3V and connect to Ameba module, the measured current in deepsleep is 12mA, and long-term average is 13mA. If you supply 5V power to Ameba, the measured current in deepsleep is 17mA, long-term average is 18mA. Besides NFC and RTC, voltage step-down module and LED light also consumes power. Not considering the power consumed by the battery charge-discharge module, assume that the solar panel provides 40mA current and the 1100mAh lithium battery has used up half of its capacity. Then we need 550mA / (210mA - 13mA) = 2.8 hours to fully charge the lithium battery. If the solar panel cannot provide sufficient current output to supply power for Ameba and the lithium battery, and the Ameba board relies on the lithium battery as power source. Then the battery can provide power for 550 mAh / 13mA = 42 hours. Code Reference The program is composed by previous examples. The execution flow is as follows: At the beginning, we setup watchdog and activate a GTimer to feed/kick watchdog every second, and if the total execution flow is not completed in 30 seconds, go into deepsleep. Note that we put the WiFi connection part in the rear of the flow. Since turning on WiFi consumes relatively more power, to design low-power project, it is recommended that put WiFi-unrelated parts at the beginning of the execution flow.