We are submitting this project to the "IoT in the Wild" contest under the Challenge 1: Climate Crisis and Mitigation with the topic of Natural Disaster Prevention/Mitigation
For two years I worked at NASA Goddard Space Flight Center on the GOES-16 weather satellite, and then left NASA in 2019 to explore blockchain and IoT technologies independently. I immediately recognized the low-power long-range potential of LoRaWAN to solve one of the most intractable field efforts in the climate science community.
Upper-level data from the regions of West and Central Africa play an outsized role in weather and climate forecasting. It helps numerical models make better predictions about extreme flood and drought events. More data from these regions could help rainfall forecasts for local populations and can even be used to improve the forecasting of Atlantic hurricanes in the 7 to 14 day timeframe. Yet, bureaucracy and ineffectual government funding in the region has led to the rapid degradation of weather balloon stations over West Africa for the past 20 years. In 2008, scientists concluded that the best way to reverse the trend would be to establish a network independent of government agencies with direct contracting payments to individuals for preparing and launching the weather balloons. Link
This plan of action is now possible.
With small size, low power, and low cost of micro-processors, we can bridge communities and collect data without the need for expensive equipment. Also, with the availability in smartphones in Africa, we've found it easy to discuss the project and troubleshoot technical problems in real-time. With blockchain and IoT, we can make the data accessible by anyone anywhere on earth, while compensating local communities directly for the manual process of launching a balloon.
LoRaWAN is a low-power long-range radio communication technology that performs best in line-of-sight situations. It is very suitable for outdoor sensors and indoor monitors that only require sending small amounts of data at a time.
A rising weather balloon maximizes this line-of-sight property of LoRaWAN as there are fewer and fewer ground obstacles that may reduce the signal strength. Effectively, the balloon becomes more and more like a small satellite with an enormous footprint to communicate with tens if not hundreds of gateways (also called Helium "hotspots") on the ground. This redundancy helps compensate for the balloons natural drift away from the launch location due to the wind and for times where the balloon's radio signals attempt to pass through clouds or rainy weather.
The top of the troposphere typically extends to about 35,000 feet, which is close to the 15-kilometer range of SF10 LoRaWAN. This also happens to be the height at which our 30-gram balloons tend to burst due to the low atmospheric pressure.
Now that we understand why balloons work well with LoRaWAN, we can now talk about how the project uses a concept I termed Weather "Mining."
It is a scientific fact that under all but the most extreme weather situations, atmospheric pressure decreases with higher elevation, and I take advantage of this physical fact in my blockchain smart contract. For every millibar level achieved by the pressure sensor on the radiosonde balloon, a proportional amount of Telos digital currency is sent to the launcher via the blockchain. This incentivizes well-performed launches that achieve maximum within the range of the LoRaWAN receiving antenna.
Here I coined the term "weather mining," as an analogy to bitcoin mining, whereby instead of being governed by the laws of probability and cryptography, the payment mechanism is governed by the predictability of atmospheric physics. Below is a picture of a micro-payment being sent to Emmanuel Patrick in Uyo, Nigeria as the smart contract receives data from the balloon at a 7,075 meter elevation. These payments continue every 30 seconds until the balloon is out of range or bursts at high altitude.
Each electronics hardware used in the project was relatively simple, consisting of a 5V Bosch BME280 weather sensor (available on Seeed Studio) attached with jumper wires to a TTGO LoRa32 v2.1 microcontroller. This captures temperature, humidity, and pressure every few seconds. The TTGO unit comes with a pre-soldered OLED and LoRa 868MHz radio module with SMA mount. A small 3D printed enclosure keeps an Adafruit 350mah 3.7V LiPo battery dry during flight and helps prevent damage in case the unit is recovered.
The Vin and GND pins of the BME280 are attached to the 3v3 and GND pins of the LoRa32 respectively. The SDA pin connects to pin 21 and the SCL pin goes to 22.
The enclosure is 3D-printed, which allows for straightforward process of printing directly at the university. I borrowed STL design files from public files on TinkerCAD and remixed to include moving hinge on the left side of the enclosure.
Due to the increased complexities that come with working in a relatively remote region, we relied heavily on cloud computing frameworks like Microsoft's Azure services to do most of the software and blockchain handling. Nevertheless, the students still managed to connect the LoRaWAN gateways (also known as Hotspots) to their local university's local LAN mostly on their own.
Both TheThingsNetwork Indoor Gateway from Seeed Studio and Dragino LPS8 Helium packet forwarders have been set up at various universities.
The firmware was written using a combination of open-source Arduino libraries sketches. The main components of the firmware are:
- Sending of weather packets every 5 to 30 seconds over Helium network. Here I used the LMIC library and implemented this lora-serialization library to do the encoding and decoding of weather packets
- Custom HTML webpage with WiFi.h libraries to input Telos blockchain account name from students and authenticate the launch. Webpage is accessible through http://192.168.4.1 in the smartphone or by QR code at startup.
- On-board calculation of elevation. Here you can use some calculus and do some cool weather calculations on the powerful ESP32. The firmware continuously calculates real-time elevation by integrating the hypsometric equation over discrete pressure level intervals as the balloon ascends. Doing this requires highly accurate inputs, and it was even necessary to calculate the gravitational constant as a function of latitude. This is because gravity it is felt 0.5 to 1.0% less in West Africa due to proximity to the equator. For reference, here's a snippet of the algorithm:
/* Specific gas constant for dry air */
float R = 287.058;
/* Gravitational acceleration varies slightly by latitude and elevation */
float g = calc_gravity();
/* Approx average virtual temperature of layer */
float tv_avg = tv1 + (tv2 - tv1)/2.0;
/* Use hypsometric equation and natural logarithm
to compute elevation change since last datapoint */
float elevation = (R*tv_avg/g)*log(p1/p2) + z1;
Through the Helium Console, I created a unique OTAA-based device name (Deveui, Appeui, Appkey) for each geographic location, and reused the same device credentials for subsequent launches at each location. I then added an MQTT integration to the Helium Console and connected the flows.
From there, I am running a Node-RED instance that listens for data packets sent by Helium over MQTT. The flow routes the messages based on Port number and finally pushes the data to the Telos blockchain using a custom Node-RED contrib module that I wrote. The module is published as an NPM package here and is open source like the rest of the project.
Finally, the smart contract is responsible for handling the weather and launch authentication data. As each observation arrives to the blockchain, a small micro-payment is made to the student launcher for every few meters the balloon rises. This adds up to around $10 in digital currency per launch. All weather data is stored as RAM resource on Telos, and weather data from all of our past launches can be viewed directly on the blockchain here.Launch Process
Before launch, university student "Weather Miners" follow directions on the OLED screen to connect to a WiFi AP broadcasted from the ESP32. The students type in their Telos blockchain account name to receive the digital payments that happen during launch. When the user presses "Submit", a LoRaWAN message is sent over 868MHz to a nearby hotspot and the Miner's account is authenticated on the Telos blockchain.
The balloons are filled with minimum of 12 cubic feet of helium or hydrogen gas to lift the tiny 40-gram payloads. More on that later. Another 3D-printed hinge clamps down on the neck of the balloon and attaches the main weather device via clip to the bottom of the balloon. The Weather Miner is free to release the balloon.
Once the atmospheric pressure is a few millibars lower than the ground pressure, the device recognizes that the balloon has been launched and the goes into "flight" mode. Every 5 seconds, it transmits temperature, pressure, and humidity back to the ground receiver. If the flight occurs over a big city, other public hotspots in the area may also pick up packets from the balloon as it ascends, which makes the solution more robust.
The balloon will continue rising for about 90 minutes until it bursts at about 35,000 feet. Together we've found that extra gas is helpful to keep the balloon in range long enough to measure the data the full length of the flight.
After a few test launches with students, I quickly learned that supplying helium gas for the balloons is a very expensive endeavor.
To overcome this problem, we developed a method of inflating the balloons with locally-produced hydrogen instead of helium. Filtered water (H2O) is split into hydrogen and oxygen using polymer electrolyte membrane (PEM) electrolysis, where the hydrogen is stored at maximum pressure of 120psi into a small tank.
My invention takes 200W solar to power the 5V PEM at max 40 amps and produce hydrogen when the sun is shining. To capture the rainwater, we utilize the smoothness of the glass solar panels to allow the water to fall into a reservoir using PVC pipe. Once filled, the rainwater is put through 2 deionizing water filters that need no external pump. The PEM continuously circulate the water during the day and outputs hydrogen into the gas tank for daily storage.
Eight hours of sunlight is enough to get the 12 cubic feet of hydrogen needed to do one launch with the small 30-gram red weather balloons. For safety and preserve the rainwater intake, a pressure switch toggles the flow of electricity from the panels to turn off the PEM unit when enough hydrogen is produced. We estimate that over 70% of the Earth's surface receives, on average, the 16 fl. oz of rainfall needed to do one weather balloon launch per day.Conclusion
Although bootstrapped nearly entirely with my own funds, I've helped complete 25 launches total with students from 5 locations in the U.S. and Africa. By providing the needed equipment and setup guides, I helped establish hydrogen generation stations at the following universities:
1. University of Uyo in Uyo, Nigeria
2. Academic City University in Accra, Ghana
3. University of Douala in Douala, Cameroon
I've also led some open hackathons and events with Taikai Labs and Omdena, Inc. and we've discovered a new way to use the data with machine learning. We've found that we can make a reasonably accurate ML-trained 12-hour rain forecasting model using existing balloon data, especially when compared to the current poor performance of traditional government-run services. We are looking for any potential funding opportunity to do a 9-month pilot at the University of Douala to collect a ML training dataset.
Eventually with a large enough dataset over the region, there is potentially millions (if not billions) of dollars in long-term insurance savings by improvement of hurricane genesis forecasts over the east Atlantic. These are known as Cape Verde hurricanes that form off the coast of Africa and eventually threaten the U.S. and Caribbean. Only 20 well-maintained stations would be needed to replace the current weather balloon network in the region.
All software and CAD used in this project is open source. Feel free to utilize components to launch your own weather balloon or improve your own project!