Project Curacao2 – RaspberryPi and Arduino Based Environmental Station – Part 1
Project Curacao2 is a SwitchDoc Labs project being done for the world famous (19 worldwide contest wins) amateur radio station PJ2T located on the Caribbean nation of Curacao. It is building on the technology and experience of building on the first Project Curacao. Planned deployment is June 2017 after extensive testing at SwitchDoc Labs (and mostly outside to make sure everything is working and waterproof).
- Part 1 - Introduction to Project Curacao2 and the LoRa WXLink Feeder Stations
- Part 2 - First LoRa WXLink Feeder Stations Report
- Part 3 - Testing the LoRa Range
- Part 4 – Initial LoRa Range Results
- Part 5 – Final LoRa Range Results
- Part 6 - Raspberry Pi Zero Base Unit Build
- Part 7 - Flame On! Initial Base Unit Tests
- Part 8 - Solar Power Management System
- Part 9 - Ready for Deployment and Status
- Part 10 - PC2 in the Caribbean! Repairs and Testing
- Part 11 - It Lives! Deployment and Initial Results
- Part 12 - One Month of Results from Paradise
The First Project Curacao
The first Project Curacao (Project Curacao 1) was deployed on March 7, 2014 and lasted until early 2016 (what finally killed the box was a loose wire from the Raspberry Pi solar panels. We could see what the problem is from our graphs and charts coming in from 3500 miles away. It had been connecting and disconnecting for a few months and finally went completely). It was kind of bizarre watching the box slowly degrade as the battery charges went down. Like looking at the Mars Rover slowly die. By the time we got someone to look at the box (in September 2016), the batteries were toasted.
We decided rather than repairing the Project Curacao box, we would build a new Project Curacao box using the new technology and systems we had developed since 2013. And with that Project Curacao2 was born.
The overall Project Curacao 1 architecture had two computers (an Arduino Mega 2560 and a Raspberry Pi A) working together. The Arduino managed the power supply for the system. It switched the Raspberry Pi on and off at certain times and power levels, and gathered weather data during the night. It also switched from solar to the wind power system on at night. The wind power system didn’t last long. The tropics are a relentless environment, especially next to the ocean.
Overall Project Curacao2 Architecture
The architecture of Project Curacao2 is much simpler than the Project Curacao 1. Because of our new Solar architecture (SunAirPlus and the USBPowerControl), we eliminated the Arduino Battery Watchdog. We still have an Arduino Uno in the base unit, but it is only used to receive information from the LoRa WXLink transmitters and then supplies it to the Raspberry Pi through an I2C interface. We are putting a lot of Solar Panels on the base unit to make sure it shuts down very rarely. We are also turning power on and off to devices (with the new GrovePower product from SwitchDoc Labs – unreleased currently) in the base box to minimize power consumption. More on the base unit design in an additional article.
We have also eliminated the wires from the base unit to the remote WeatherRack and AM2315 temperature and humidity sensors. The length of the wire running from the tower to the base unit of Project Curacao 1 caused us problems from RFI interference. After all it is right next to a world class radio transmitter. We may experience some fallouts in our transmissions during contests, but at least we won’t kill the computers.
We also have added a second remote WeatherRack and AM2315 sensor station at the ridge antenna about 2km away from the base unit. That’s the main reason we went to LoRa for this project.
Design and Implementation of the LoRa WXLink Remote Weather Sensor
The design and implementation of the LoRa WXLink Remote Weather Sensor is heavily based on the Solar WXLink SwitchDoc Labs product. The Solar WXLink is a solar powered wireless serial link that can transmit up to 600 meters in free air. IT is designed to connect up to any source of data from sensors connected to the Mini Pro LP Arduino compatible low power computer board. It was specifically designed to connect a WeatherRack weather sensor array to a Weather Board based system connected to an Arduino or Raspberry Pi computer.
The primary difference is the replacement of the RF Serial Pro with the Grove LoRa RF95 board. With a proper antenna the LoRa system can go almost 10km versus the 600m range of the RF Serial Pro. While we haven’t decided to make a new product out of this we will be selling the Grove LoRa RFM95 boards on our store in the near future.
We are building two of these transmitters. ID #2 for the close tower and ID #3 for the Ridge tower. With the ID# different, we can receive both transmitters by staggering the transmit times. Because the transmitter clocks aren’t synchronized, they will drift, but won’t overlap very often.
Architecture of the Solar LoRa WXLink
The data is gathered by the Arduino ProMiniLP on the left and then transmitted periodically sent to LoRa receiver on the right. It is received by the LoRa radio on the right and then passed to the Arduino UNO which then supplies it to the Raspberry Pi on demand via the I2C bus. Note: We used an Arduino Uno on the receiver because the ProMiniLP didn’t quite have the speed to accurately receive and process the data. The UNO, with the doubled speed (16MHz versus 8MHz) did the job nicely. We may shut off the receiver periodically in the base unit Project Curacao1 box for more power savings (60ma!). The new GrovePower product from SwitchDoc Labs (to be released soon) can do this under Raspberry Pi Control.
Solar Design
We used our Grove INA3221 current measuring device along with our DataLogging Raspberry Pi software to dynamically measure the current used by the device.
The resulting current graph is shown below. 5mA is a great result. We were looking for under 10mA average. With the addition of the two LEDs on the Watchdog timer, we are sitting at about 12mA. Before we go to Curacao, we will pop off those two LEDs and get back to 5mA.
With two 330mA solar panels (estimated to generate around 4000mAh per day into a 6600mAh LiPo battery) and a consumption of only an average of 5mA, we should never run out of energy. Things still happen and the system is designed to recover from brownouts and processor glitches (remember this is a RFI (Radio Frequency Interference) rich environment.
Parts Layout
We selected a Bud Enclosure (10-22/32″ x 6-24/32″ x 4-21/64″) for the waterproof box. We then laid out and labeled all the parts. We used plastic standoffs and super glued them to the box.
Wiring Complete
Next, we wired all the pieces together. Here is the resulting system all wired together. Except for the power LED in the bottom of the box, all the connections were Grove or Jumpers. Very little soldering.
Outside Test
The last thing we did was use silicon caulking to seal all the holes we cut into the Bud enclosure with the exception of the vent at the bottom left. We covered that with a screen and sealed the edges of the screen. From experience, any hole left open down in the tropics will be colonized by something the you don’t want it the box.
Here are some results from the Project Curacao2 software (receiving the LoRa transmissions) running on a Raspberry Pi. The Project Curacao2 is heavily based on part of the Project Curacao 1 software and the GroveWeatherPi software. The solar panels have moved into the shadows so is not generating much current (44mA). LoRa WXLink reports solar power and battery status from SunAirPlus every transmission packet. We like data.
It was generating over 300mA when the panels were more in the sun.
----------------- WXLink Remote WeatherRack Weather Sensors Sampling ----------------- ----------- block1= [171, 102, 29, 103, 221, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 65, 102, 102, 22] block2= [66, 72, 225, 122, 64, 204, 204, 76, 192, 0, 0, 224, 65, 107, 188, 148, 64, 0, 0, 48, 66, 0, 0, 0, 0, 141, 5, 0, 0, 240, 185, 0] ------Patting The Dog------- ----------- block 1 ab661d67dd060000000000000000000000000000000000000000002841666616 block 2 4248e17a40cccc4cc00000e0416bbc944000003042000000008d050000f0b900 ----------- ReversedreceivedCRC= f0b9 length of stb1+sb2= 59 ab661d67dd060000000000000000000000000000000000000000002841666616 4248e17a40cccc4cc00000e0416bbc944000003042000000008d05 calculatedCRC = f0b9 Good CRC Recived WXLink Message ID 1421 Wireless ID=2 Software Version = 9 Rain Total= 0.00 in Wind Speed= 0.00 MPH Wind Direction= 0 Degrees OTFloat=002841 AM2315 from WXLink temperature: 10.5C AM2315 from WXLink humidity: 37.6% WXLink batteryVoltage = 3.92 WXLink batteryCurrent = -3.20 WXLink loadCurrent = 28.00 WXLink solarPanelVoltage = 4.65 WXLink solarPanelCurrent = 44.00 WXLink auxA = 0.00 WXLink_Data_Fresh set to True
Software
We are using a somewhat modified version of the WXLink software to support the LoRa and our higher reliability requirements. One interesting thing we have done is used the WatchDog time to control the USB PowerControl to completely remove power from the Arduino Mini Pro LP, rather than just reseting. This fixes a very rare problem where the AM2315 may lock up. We believe the problem is fixed, but just in case as this unit will be 3500 miles away.
We have released the LoRa receiver software here on GitHub and also the LoRa transmitting software on GitHub. These are still subject to change and we will update the repositories.
Coming Next
We will be building and testing the second Solar WXLink LoRa unit (ID #3) and then start building the Raspberry Pi Project Curacao2 Base unit. Part 2 will describe the architecture and building of the base unit.
Very excited to see this. I’d like to get a similar setup up and running at home here in Massachusetts… what are your thoughts on how the weather extremes I experience (cold and heat) would affect the system? What potential changes would you think need to be made?
Hans,
This is being designed for the tropics so we aren’t paying attention to the cold end of the design at this point. The battery should not be used below about -20C or charged below 0 C. Charging below 0C shortens battery life among other things.
For heat, we are detecting the temperature and turning on a fan to increase air flow tour the base unit. We never really saw temperatures above about 100F in Project Curacao1.
The next generation SunAirPlus (SunControl) being designed now (for a Kickstarter) will allow the temperature sensing to make these changes.
From Battery University:
Li-ion batteries offer reasonably good charging performance at cooler temperatures and allow fast-charging in a temperature bandwidth of 5 to 45°C (41 to 113°F). Below 5°C, the charge current should be reduced, and no charging is permitted at freezing temperatures. During charge, the internal cell resistance causes a slight temperature rise that compensates for some of the cold. The internal resistance of all batteries rises when cold.
Many battery users are unaware that consumer-grade lithium-ion batteries cannot be charged below 0°C (32°F). Although the pack appears to be charging normally, plating of metallic lithium can occur on the anode during a sub-freezing charge. This is permanent and cannot be removed with cycling. Batteries with lithium plating are more vulnerable to failure if exposed to vibration or other stressful conditions. Advanced chargers prevent charging Li-ion below freezing.
Advancements are being made to charge Li-ion below freezing temperatures. Charging is indeed possible with most lithium-ion cells but only at very low currents. According to research papers, the allowable charge rate at –30°C (–22°F) is 0.02C. At this low current, the charge time would stretch to over 50 hours, a time that is deemed impractical. There are, however, specialty Li-ions that can charge down to –10°C (14°F) at a reduced rate.
SwitchDoc Labs