Energy Harvesting is one of the most important topic for sustainability. We have lot of connected devices > be it smart home devices, city monitoring devices, industry specific devices,etc. Mostly all of them need a continuous source of power but for some of the major use cases of just monitoring the place and sending the data every 1 hour or 30 min the energy is wasted for the rest of the time. Solar Power is also one of the only "free" source of energy and its widespread adoption is happening. I wanted to use solar panel with low frequency of sending data to never think of the weather station.
For Ex: Even when we are not using our smartphones to browser the internet, the time when its just connected to network wastes power.
So, I wanted to make a weather station for myself which I never need to think of. With the current implementation I don't even need to look after the device.
My goal was simple: Make a weather station that lasts long, really long.
I wanted to use a micro controller that consumes very low power during sleep or when inactive. I also wanted it to have some connectivity to connect is to my network and then to internet to make in an IoT device and accessible from anywhere. I decided to use the ESP8266 - a micro-controller with inbuilt WiFi that uses only 20μA during deep sleep. A prefect choice for the application. I am using the Wemos D1 mini which is small development board and based on some articles I read is closest to raw ESP8266 in terms of power consumption!
With the microcontroller decided it was time for me to select a sensor. I chose the BME280 which I had already and in my opinion is the best. Although there may be some better ones that exist. The BME280 sensor can measure temperature, humidity as well as Air Pressure with great accuracy. I am using the Adafruit BME280 sensor. It also only It is also very accurate in its measurements.
I wanted to upgrade it to BME680 that also adds a gas sensor to BME280 but it is not widely available in my country.
Battery and Charging Circuit
I used a random Samsung 18650 - FM battery with 2.2Ah battery and connected it to a charging circuit. If we use two batteries in parallel connection the capacity is doubled.
You can find a Lithium ion cell in an old laptop battery or just use a power bank (with solar panels)*!
*Although the power banks with solar panels are not recommended to charge mobile phones because phones need lot of energy and small solar panel cannot charge it fast but for this implementation and low current use it can be very well suited.
I have huge solar panels on the roof of the house to which I can directly connect my weather station to keep it charged. But a small 6v 100mA solar cell can also keep the battery charged forever. You will need a PCB that can also charge the battetry from solar power. A lot of cheap PCBs exist like this from AliExpress that can charge the battery from solar panels and also deliver 5V power.
Solar Panels on the roof my house.
This is the schematic for the project. Basically the sensor is connected to the device with I2C communication and the Reset pin of Wemos is connected to D0 pin. It is powered directly with USB.
ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize and analyze live data streams in the cloud. ThingSpeak provides instant visualizations of data posted by your devices to ThingSpeak. With the ability to execute MATLAB code in ThingSpeak you can perform online analysis and processing of the data as it comes in. ThingSpeak is often used for prototyping and proof of concept IoT systems that require analytics.
We are using ThingSpeak's REST API to send data. https://in.mathworks.com/help/thingspeak/write-data.html
With ThingSpeak we can see our data over the cloud from anywhere and it also stores all the data for a long long time which can help us for analytics about weather in a region. It can be used in cities near crossroads, near dump-yards or where long time data can help understand the pattern of weather. It can also be used in forests with use of LoRa or Sigfox to transmit data over long distances and get alerted from forest fires and understand temperature patterns to help prevent it.
For debugging purposes uncomment the Serial.begin(<>) line because in regular use the print statements can increase the time for which it remains powered on.
First of all the ESP8266 boots up and connects to the WiFi.
Then it checks if the BME280 sensor is working properly.
After that it reads the temperature, humidity and pressure value.
At the end it creates a string request and using ThingSpeak REST API sends a request its server.
Then it goes into deep-sleep until it is waked after 10 minutes by the RTC on the board.
It wakes up with hard reset and repeats the cycle again.
Even though the deep sleep current for ESP8266 is 20uA I could measure 0.3mA which can be dues to the charging circuit or the whole development board. With those values I have calculated the following battery life.
If the data is sent every 10 minutes
If the data is sent every 20 minutes
If the data is sent every 30 minutes
If the data is sent every hour
A great Battery Life and other calculator: https://www.omnicalculator.com/other/battery-life
With the current implementation my weather station if does not get any power will last 3 months without external power. Surprisingly if I add this small solar cell to the circuit then it can run for 2 months longer! So with a good 6v solar panel that is commonly available the project doesn't even ever need to be connected to external power.
You can see the weather data of my region on ThingSpeak: http://tiny.cc/WeatherStation
Readings from my Weather Station