This project research the use of solar or wind to power a sensor and transmit it's value to a cloud service, on a deploy-and-forget approach.
It follows the idea presented in the project Liquid Electricity, using a WiFi Notecard from Blues Wireless to transmit data sensor, battery and power data to the Adafruit.io cloud service.
MaterialsThe following are the core system materials to collect sensor data and transmitted to the cloud services thru Notehub.io
The Core System is divided into two main tasks: power/sensor monitoring, and data transfer to the cloud.
Using the Adafruit FeatherWing Doubler we connect the ESP32 V2 microcontroller (host) to the Adafruit FeatherWing INA219 for monitoring the power generation. It also connects via I2C to an Adafruit LC709203F to monitor the battery state, and finally connects via I2C to an OLED display for status update.
The data flow is as shown in this image.
The sensor and monitoring data is acquired and formatted by the ESP32 host, then transmitted to the notecard WiFi, which sends it to Notehub.io and from there route to its destination Adafruit.io.
The system samples data every 10 seconds and sends it to Notehub.io. Every minute a sample data is sent to Adafruit.io thru an MQTT route.
The payload is JSON encoded and transform thru JSONATA to deliver to the cloud service; for more on this, see the section Routing and Data Formatting with JSONATA.
Notehub.io SettingSending data to Notehub was a breeze setting.
The payload envelops three groups of data. The light brightness, battery and power groups.
The bright brightness...
The battery group envelopes battery percentage, temperature, and voltage, coming from the LC709203 battery monitor device.
The power group consist of bus voltage, current, load, shunt and power data, coming from the INA219 device.
The solar power base system has the following payload.
//Light data.
lightRead(&lightDataRecord);
J *light = JCreateObject();
JAddNumberToObject(light, "lum", lightDataRecord.lum);
JAddNumberToObject(light, "ir", lightDataRecord.ir);
JAddNumberToObject(light, "full", lightDataRecord.full);
JAddNumberToObject(light, "visible", lightDataRecord.visible);
JAddNumberToObject(light, "lux", lightDataRecord.lux);
JAddItemToObject(body, "light", light);
//Battery monitor data
J *battery = JCreateObject();
readBattery(batteryStatus, bufTemp, battery);
JAddItemToObject(body, "battery", battery);
//Water turbine power data
J *power = JCreateObject();
readPower(inPowerStatus, power);
JAddItemToObject(body, "power", power);
JAddItemToObject(req, "body", body);
The
wind power base system has the following payload.
//Air sensor data
readAirFlow(&airDataRecord);
J *air = JCreateObject();
JAddNumberToObject(air, "raw", airDataRecord.raw);
JAddNumberToObject(air, "mtspersec", airDataRecord.mtspersec);
JAddNumberToObject(air, "mph", airDataRecord.mph);
JAddItemToObject(body, "air", air);
//Battery monitor data
J *battery = JCreateObject();
readBattery(batteryStatus, bufTemp, battery);
JAddItemToObject(body, "battery", battery);
//Wind turbine power data
J *power = JCreateObject();
readPower(inPowerStatus, power);
JAddItemToObject(body, "power", power);
JAddItemToObject(req, "body", body);
The payload is sent to Notehub.io once every 10 seconds, and to the Adafruit.io once a minute thru an MQTT router.
Notehub.io Routing and Data FormattingAt the beginning, I create a route for each of the data components in the payload (as shown below), but that was an overload for the Adafruit.io service.
Then, I learned that Adafruit.io can handle groups of data passed as a JSON object. Using this format, I was able to reduce the number of routes to 3 and keep the group data passed in the payload together.
The data needed to be formatted using JSONATA, below is the JSONATA code for each of the routes: AdafruitFlow, AdafruitPower, and AdafruitBattery, respectively.
The solar power payload is as follows:
LIGHT
{ "feeds":{
"light.lum": body.light.lum,
"light.ir": body.light.ir,
"light.full": body.light.full,
"light.lux": body.light.lux,
"light.visible": body.light.visible},
"location": {
"lat": 0.0,
"lon": 0.0,
"ele": 0.0
}}
POWER
{ "feeds":{
"power.busvoltage": body.power.Bus,
"power.current": body.power.Current,
"power.load": body.power.Load,
"power.shunt": body.power.Shunt,
"power.power": body.power.Power},
"location": {
"lat": 0.0,
"lon": 0.0,
"ele": 0.0
}}
BATTERY
{ "feeds":{
"battery.batterypercentage": body.battery.Percent,
"battery.batterytemperature": body.battery.Temp,
"battery.batteryvoltage": body.battery.Voltage},
"location": {
"lat": 0.0,
"lon": 0.0,
"ele": 0.0
}}
The
wind power payload is as follows:
WIND
{ "feeds":{
"air.raw": body.air.raw,
"air.mps": body.air.mtspersec,
"air.mph": body.air.mph},
"location": {
"lat": 0.0,
"lon": 0.0,
"ele": 0.0
}}
POWER
{ "feeds":{
"power.busvoltage": body.power.Bus,
"power.current": body.power.Current,
"power.load": body.power.Load,
"power.shunt": body.power.Shunt,
"power.power": body.power.Power},
"location": {
"lat": 0.0,
"lon": 0.0,
"ele": 0.0
}}
BATTERY
{ "feeds":{
"battery.batterypercentage": body.battery.Percent,
"battery.batterytemperature": body.battery.Temp,
"battery.batteryvoltage": body.battery.Voltage},
"location": {
"lat": 0.0,
"lon": 0.0,
"ele": 0.0
}}
Notice that in order to make it a valid group for Adafruit.io the location field was added with no data.
Solar PowerMy first try was using two solar panels connected in parallel, producing about 120 mA of current on a clear sky day.
This was not enough to sustain the system and recharge the battery. I added two more panels in parallel resulting on an increase current to 250 mA on a sunny day.
Below is a snapshot of the system with four solar panels and a light intensity sensor to measure the light intensity needed to achieve the require current.
The below graph shows the current and battery percentage as recorded during the light day hours.
Note the battery charging once the current reaches the threshold of 180 mA and above.
On a different day, we got this data snapshot.
The current is
The light sensor returns the full value is
We can notice that the solar panels response is adequate to the amount of light during the day, going down as the sunset approaches.
The system respond as expected for a reliable solar power.
Adafruit.io Solar DashboardI create the below dashboard using the Adafruit.io dashboard creation widget. The widget shows light characteristics (Lux, IR, Visible, Full and Lum), the batteru status (Voltage and Percentage) and the solar power generated data (Bus Voltage, Current and Load) as gauges.
The dashboard refreshes once every minute.
Wind PowerThe wind power system consists of two DC 0.1V-5.5V 100-6000RPM Micro Vertical Wind Turbines.
The system gave about 65 to 80 milliamps current connected in parallel; with two air mattresses pumps blowing wind.
The system could not be charged or self sustained with this much current. There is the need for more turbines connected in parallel, or a bigger wind turbine.
Take into account that the air speed the blowers were pumping was above the sensor limit of 7.23 m/s. This kind of wind would not be attainable on a normal weather day, making it difficult to consider the natural wind at ground level on any given day a good source of energy. At lease with the turbines I was using.
Adafruit.io Wind DashboardCreating dashboards on Adafruit.io is simple and fast. Once the payload group is created the link to the below gauges is fast and reliable.
This dashboard shows the air (speed in mph, speed in m/s, and raw), the battery status (Voltage and percentage), and the power generated by the air wind turbines (Bus Voltage, Current, and Load).
The use of wind turbines attached to ground level does not provide the enough energy to sustain the core system provided. But, what if instead of a static system we change our perspective and think about a moving system.
Using a 5V blower fan hand-hold thru the car's window, and attached to a multimeter, I was able to measure about 40-48 milliamps of current produce at a speed of 65 mph.
Consider, attaching a similar fan, in principle, to the sides, top or bottom of our cars to harvest that wind energy, and power up a GPS system that would provide location of vehicles moving thru our highways. Something to explore in more detail on future projects.
Conclusions•Solar energy is weather dependent, but statistically happening more often since we can have more sunny days. Power generation requirement is achieved on a sunny day.
•Wind energy is uncertain, since we are dependent on mother nature to have a windy day. Also power generation requires a considerable wind speed.
Adafruit.io Data GroupingAdafruit.io allows grouping of the data send in the payload. You can read more here.
Using groups reduce the number of request for my data and make it more responsive.
Comments