Low Power Weather Station
by Tecwyn Twmffat in Circuits > Sensors
17150 Views, 161 Favorites, 0 Comments
Low Power Weather Station
Now in it's third version and having been tested for over two years, my weather station gets upgraded for better low power performance and data transfer reliability.
Power consumption - not a problem in the months other than December and January, but in these very dark months the solar panel, although rated at 40 Watts, was unable to keep up with the demand of the system ... and most of the demand came from the 2G FONA GPRS module which transmits the data directly to the interwebs.
The next problem was with the FONA GPRS module itself, or more probably the cell phone network. The device would work perfectly for weeks / months, but then suddenly stop for no apparent reason. Apparently the network does try to send some kind of 'system update info' which, if not accepted, causes the device to get booted off the network, so GPRS is not really a maintenance free solution for data transmission. It's a shame because when it did work, it worked really nicely.
This upgrade uses the low power LoRa protocol to send the data to a Raspberry Pi local server, which then will sends it on to the interwebs. In this way, the weather station itself can be low power on a solar panel and the 'heavy lifting' part of the process, done somewhere within WIFI range on mains power. Of course, if you have a public LoRa gateway within range, the Raspberry Pi would not be required.
Building up the weather station PCB is easy as the SMD components are all quite large (1206) and everything on the PCB works 100%. Some of the components, namely the wind instruments, are quite expensive but can sometimes be found second hand on Ebay.
Components
Arduino MKR1300 LORAWAN ......................................................................... 1 of
Raspberry Pi (optional dependant on local LoRa gateway availability) ............ 1 of
BME280 for pressure, humidty, temperature and altitude ................................ 1 of
RJ 25 connector 477-387 ................................................................................. 1 of
L7S505 ............................................................................................................. 1 of
Beeper 754-2053 .................................... 1 of
Shottky diode (1206) .......................................... 2 of
R1K restors .......................................... 3 of
R4.7K resistor ....................................... 1 of
C100nF capacitor ................................... 3 of
R100K ................................................... 1 of
R10K ..................................................... 4 of
C1uF ...................................................... 1 of
C0.33uF ................................................ 1 of
R100 ..................................................... 1 of
R0 ........................................................ 1 of
Dallas DS18B20 temperature probe ............ 1 of
PCB ............................................................... 1 of
Rain gauge .................................................... 1 of
Soil probe ……………………………………… 1 of (see step 6 for DIY probe)
A100LK anemometer ................................ 1 of
W200P wind vane ......................................1 of
How It Works
It's easy enough to get sensors working for things like temperature, humidity and pressure but some of the otheres are quite tricky, although all the code is included in this blog.
1. The rain gauge is on an 'interrupt' and works on when a change is detected. The rain enters the instrument and drips down on a see- saw rocker that rocks over once one end is full, triggering a magnetic sensor twice as it goes over. The rain sensor takes precedence over everything and works even if data is being transmitted.
2. The anemometer works by sending a low power pulse, the frequency of which is dependent on it's speed. It's very simple to code and uses very little power even though it needs to record about once every second to catch the most severe of gusts. The code keeps a running note of the average wind speed and the maximum gust during the recording session.
3. Although on first thoughts the wind vane would be easy to code, once the intricacies are explored, it's a lot more complicated. In essence, it's just a very low torque potentiometer, but the problem of getting readings from it is compounded by the fact it has a short 'dead zone' around the north direction. It needs pull down resistors and capacitors to prevent weird readings near north which then cause non linearity in the readings. Also, becuase the readings are polar, normal mean average calculations are not possible and so the more complicated mode needs to be calculated which involves creating a massive array of about 360 numbers! .... And that's not the end of it .... Special consideration has to be made concerning which quadrant the sensor is pointing in as if it is in the quadrant either side of north, the mode has to be treated differently.
4. The soil moisture is a simple conductivity probe, but to save energy and prevent corrosion, it's pulsed very quickly with one of the Arduino's spare digital pins.
5. The system sends data from the Arduino to the Raspberry Pi (or LoRa gateway) but also needs a 'call back' from the receiver to confirm that it has actually received the data properly before resetting all the various counters and averages and taking a fresh set of readings. A recording session might be about 5 minutes each, after which the Arduino attempts to send the data. If the data is corrupted or there is no internet connection , the recording session is extended until the call back indicates success. In this way, no maximum gust of wind nor rain measurement will be missed.
6. Although beyond the scope of this blog, once in the internet server (it's a big computer located in Ipswich, UK), the data is then assembled into a MySQL database which can be accessed using simple PHP scripts. The end user can also see the data displayed in fancy dials and graphs thanks to proprietary Java software by Amcharts. Then 'end result' can be seen here:
Files
All Arduino, Raspberry Pi code files and the file for creating the PCB on 'Design Spark' software are loacted in Github repository here:
Populating the PCB
No stencil is required for soldering the SMD components - just dab a bit of solder on the PCB pads and place the components with some tweezers. The components are large enough to do everything by eye and it does not matter if the solder looks messy or the components are a bit off centre.
Place the PCB in a toaster oven and heat to 240 degrees C using a K type thermometer probe to monitor temperatures. Wait for 30 seconds at 240 degrees and then turn off the oven and open the door to release the heat.
Now the rest of the components can be hand soldered.
If you want to buy a PCB, download the zipped gerber files here:
https://github.com/paddygoat/Weather-Station/blob/master/PCB/Gerbers_Weather%20station%203_Tx_01.zip
and upload them to JLC here: https://jlcpcb.com/
Select the 100 x 100 mm board size and use all the defaults. Cost is $2 + postage for 10 boards.
Deployment
The weather station is deployed in the middle of a field with the wind instruments on a tall pole with guy cables. Details of deployment are given here:
Previous Work
This instructable is the latest stage in on going project that has it's development history in seven other previous projects:
https://www.instructables.com/id/Arduino-GPRS-Weat...
https://www.instructables.com/id/Arduino-GPRS-Weat...
https://www.instructables.com/id/Setting-Up-an-A10...
https://www.instructables.com/id/Analogue-Sensors-...
https://www.instructables.com/id/Analogue-Wind-Van...
https://www.instructables.com/id/Arduino-Soil-Prob...
https://www.instructables.com/id/Arduino-GPRS-Weat...