The inspiration of the project came from my daughter Elizabeth Vicarte with her project FloWat -> Flow Water, which describes a first attempt to create a self sustainable system using the water kinetic power.
This project expands on that idea and shows the feasibility to use the mechanical energy of the natural flow of water in pipelines to generate electricity.
The system monitors: the power generated by water turbines, and the power consumption by the system. It also captures the water usage.
The final objective is to prove that a system can be deployed-and-forget outdoors without having to worry about the battery level. Curious, keep reading to see if I was able to achieve a battery-less state.
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.
First tryMy first try as with Elizabeth's project consisted of one water turbine, a flow sensor and the core system.
The turbine generates a 5 V power.
The water flow sensor produces an interruption thru a hall effect magnetic sensor and the core system keeps track of the pulses. This sensor requires a minimum 5 V power.
Using a single water turbine the voltage capture was 5 V and the current was 93.3 mA.
The battery was not able to recharge as shown in the graph below and it deplete constantly until fully discharged. The revolutions per second remain in the range of 45 to 50.
Obviously this arrangement did not provide the amount of energy required.
I start looking into how to increase the current without changing the voltage, and keeping only one turbine. MOSFETS and super capacitors came to the court, but the "Light Bulb" moment came when reviewing the parallel and serial electrical connection of batteries. Serial connection of batteries will increase the voltage, where parallel connection will increase the current. Then as with the batteries how about I connect water turbines to the same pipeline and their electrical contribution in parallel.
One moreHere, I apply the 'Aha' moment from the previous section, and connect two water turbines on the same pipeline, connecting them electrical in parallel to same breadboard rails.
The result, 5 V output but now the current is about 138 mA. Great maybe two will be enough.
Unfortunately, as shown in the above video the amount of current was not enough during the testing of a failure battery. Switching off the battery source, and using only the power generated by the water turbines, the system tried to start but at the point the Notecard intent to stablish communication with the AP, the amount of current require was greater than the 138 milli-Amps provided and start going into a power cycle.
What to do?
How about 6?Well, if 2 was not enough, let us try 6. Wow!!!
The system now is producing about 250 milli-Amps of current at the same 5 V output.
And, voila!. The current generated was able to pass the battery failure test. Switching off the battery during a data transmission cycle kept the system running and transmitting. Restoring the battery power did not interrupt, or power cycle the system.
Now to test a more realistic scenario.
Adding a Relay Timed SystemAgriculture irrigation systems does not run 24/7, they have their schedule running times. Here, I use a simple system to run for 15 mins every hour, yes a little too much, but taking into account that is just a recycle water close system there is no waste of water.
The relay system consist of an HUZZA32, an Power Relay FeatherWing, and a Precision Real Time Clock FeatherWing, all Adafruit boards.
The following graph shows two cycles of the system running. On each cycle you can see that the battery percentage rises, meaning is charging.
Also notice on the second cycle, the battery is almost depleted and at some point it comes back with 0 %, and even then it wakes the system and recharges the battery.
The graph shows a couple of discrepancies, there is a peak between both cycles which is due to a testing I made by turning manually the water flow for a short period of time, and the other is the revolutions per second where due to that test the internal counter might have got corrupted. The usual thru output of water is about 32 revs per second,
The video shows the start of a cycle. Interesting, the flow rate was up to 50 revs per second on a one turbine system, now it has being reduced to 32 revs per second. Having all those turbines does affect the flow pressure on the system.
Drumroll, NO BATTERY!Yes, the final test.
Remove the battery and see if the power supplied is enough to start the system, transmit and then shut down.
YES!!!. The current provided by the by the 6 turbines was good enough to start the system, establish a communication with the AP, collect data from the flow water sensor and transmit to the cloud service.
The graph above shows a peak on the first data since it is the time it establishes a connection with the WiFi access point with 150 milli-Amps. The collection of data and transmission is using an average of 135 milli-Amps of current, at around 32 revs per second.
Note that I tried also a cellular notecard, however in this case the current needed was more than the max of 250 milli-Amps to establish a communication with a cellular tower. I do believe that increasing the current (adding more turbines) and bringing the output close to 500 milli-Amps (as stated on the Blues wireless required power) would allow the system to run.
This result shows the ability for a system to be self-sustained with natural resources.
Notehub.io settingSending data to Notehub was a breeze setting.
The payload envelops three groups of data. The water flow, battery and power groups.
The water flow has water flow per litter (waterflowperlt) and water flow per revolutions (waterflowperrev) data, coming from the sensor flow device.
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.
//Flow sensor data
J *flow = JCreateObject();
JAddNumberToObject(flow, "waterflowperrev", pulseCountperSec);
JAddNumberToObject(flow, "waterflowperlt", flowMilliLitres);
JAddItemToObject(body, "flow", flow);
//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 payload is sent to Notehub.io once every 10 seconds, and to the Adafruit.io once a minute thru an MQTT router.
Routing and Data Formatting with JSONATAAt 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.
WATER FLOW
{ "feeds":{
"waterflow.perliter": body.flow.waterflowperlt,
"waterflow.perrevolution": body.flow.waterflowperrev},
"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.
Adafruit DashboardPutting together the dashboard at Adafruit.io was also very simple.
Below is a time series of the dashboard.
The graph interface per feed was really useful too.
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.
Above are groups feed for Battery, Light (project coming soon), Power and WaterFlow.
ConclusionsThis has being a really inspiring project. Imagine the data collection of irrigation, and pipeline health, or leaks in the systems that does not require any kind of external power supply.
Next steps, design a turbine that can provide the enough current with just one device.
Make sure you check out the upcoming projects with solar and wind power.
AddendumWi-Fi Notecard Setup
The Blues Wireless documentation gives a concise and easy-to-follow guide to connect your Notecard to their Notehub service in the "Quickstart". Note that the guide strongly relies on using a version of Chrome that supports Web serial communication. You also have the option to install a CLI for working with the Notecard, but having all in one page helps a lot with following the setup process.
If you're using a Wi-Fi Notecard, make sure to also follow the instructions on "Connecting to a Wi-Fi Access Point" guide.
I'd recommend completing the quickstart and getting acquainted with the basics of Notehub, as both that will help you understand the other steps in this project.
Comments