Introduction: Arduino GPRS Weather Station - Part 2: Upgraded Wind Sensors and Improved Energy Efficiency

In my continuing efforts to control my island's weather I have rebuilt my GPRS weather station with upgraded 'industry standard' calibrated wind sensors and made several significant improvements for better energy efficiency.

This weather station is now a lot more accurate and uses three Arduinos working together to reduce power consumption, which is important as the whole system runs off a small solar panel. But surely using more microprocessors would use more electricity, not less?

"Not so", replies Tecwyn Twmffat, since we have one small Arduino switching all the unnecessary sensors and other modules off until they are needed. What's the point of taking temperature and pressure readings every five seconds? There is none! ........ So turn them all off! ........ Actually, the only sensors that do need to be working 24/7 are the anemometer and the rain gauge, which will quite happily run on one tiny, miniscule, ultra low power Arduino Nano.

This instructable is the latest stage in on going project that has it's development history in five other previous projects:

Step 1: Features

  • Anemometer (calibrated)
  • Wind vane (low torque, low energy, high accuracy)
  • GPRS 2G data transmission
  • Power saving 'sleeping Arduinos'
  • Power saving buck convertor 12v to 5v supply
  • Soil moisture
  • Soil temperature
  • Air humidity
  • Pressure
  • Rain
  • Outside temperature
  • Battery voltage
  • Forecasting by calculating pressure swing
  • Webpage data display
  • Autonomous solar powered - no wifi or grid power required
  • Removable TFT display for debugging

Step 2: Parts

  • 3/4" overflow pipe stainless steel filter
  • ANT1 Antenna
  • Arduino Nano Rev3.1
  • Adafruit Atmega32u4 Breakout Board variant variant 6; part # Operates
  • 1.8" TFT screen
  • BATT1 LiPoly Battery (1300mAh)
  • C1 Electrolytic Capacitor voltage 16V; package 100 mil [THT, electrolytic]; capacitance 470µF
  • C2 Ceramic Capacitor voltage 6.3V; package 100 mil [THT, multilayer]; capacitance 100nF
  • C3 Electrolytic Capacitor voltage 16V; package 100 mil [THT, electrolytic]; capacitance 100µF
  • C4 Ceramic Capacitor voltage 6.3V; package 100 mil [THT, multilayer]; capacitance 100nF
  • C5 Electrolytic Capacitor voltage 16V; package 100 mil [THT, electrolytic]; capacitance 1µF
  • C6 Ceramic Capacitor voltage 6.3V; package 100 mil [THT, multilayer]; capacitance 100nF
  • D1 Rectifier Diode package 300 mil [THT]; type Rectifier; part # 1N4001
  • DS1 DS18B20 1-Wire Temperature Sensor Probe Cable
  • J1 Screw terminal - 3 pins package THT; pins 3; hole size 1.0mm,0.508mm; pin spacing 0.137in (3.5mm)
  • J2 Piezo Speaker
  • J3 Screw terminal - 3 pins package THT; pins 3; hole size 1.0mm,0.508mm; pin spacing 0.137in (3.5mm)
  • J4 RJ11 Jack package rj11-6; variant pth; target
  • RJ-11; part # RJ11 Rain Gauge
  • J5 Screw terminal - 2 pins package THT; pins 2; hole size 1.0mm,0.508mm; pin spacing 0.137in (3.5mm); part # Soil Probe Part1
  • Adafruit FONA - Mini Cellular GSM Breakout variant UFL Part2
  • Arduino Mega 2560 (Rev3) type Arduino MEGA 2560 (Rev3) Part3
  • Arduino Nano (Rev3.0) type Arduino Nano (3.0); part # MASTER Part4
  • BME280 Breakout variant BME280; power 3.3V Part5
  • VERTER 5V USB Buck-Boost variant screw Power plug1 Power plug
  • Q1 NPN-Transistor package TO92 [THT]; type NPN (ECB)
  • R2 100Ω Resistor package THT; tolerance ±5%; bands 4; resistance 100Ω; pin spacing 400 mil
  • R3 200Ω Resistor package THT; tolerance ±5%; bands 4; resistance 200Ω; pin spacing 400 mil
  • R4 10kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil
  • R5 10kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil
  • R6 Rotary Potentiometer (Small) package THT; track Linear; size Rotary - 9mm; type Rotary Shaft Potentiometer; maximum resistance 1kΩ
  • R7 4.7kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 4.7kΩ; pin spacing 400 mil
  • R8 1kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 1kΩ; pin spacing 400 mil
  • R9 100kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 100kΩ; pin spacing 400 mil
  • R10 10kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil
  • R11 10kΩ Resistor package THT; tolerance ±5%; bands 4; resistance 10kΩ; pin spacing 400 mil
  • S1 SWITCH-MOMENTARY-2 package reed_switch_plastic; variant pth_reed2; part # Rain guage
  • TFT2 1.8" TFT Display with uSD
  • U3 RELAY package relay-jzc; variant pth4
  • U7 RELAY package relay-jzc; variant pth4
  • U8 RELAY package relay-jzc; variant pth4; part # Finder 30.22.7.005.0010

Step 3: How It Works

Improved energy efficiency is achieved by using more energy efficient sensors, especially the wind vane, and swapping out the old power regulator with a 'buck convertor' switching type. The old regulator used to get fairly hot and heat = energy loss ....... The buck convertor does not get hot!.......... Improved coding has allowed complex float numbers to be communicated between the Arduinos via the I2C bus, which gives accuracy to 2 decimal places.

Of the three Arduinos in this design, one just operates the TFT screen and can be removed after all debugging has been done. The small, second, 'Master' Nano takes readings of wind speed via the Arduino 'pulse in' command and rainfall is monitored on an 'interrupt' so that not a single drop of rain is ever missed. The other interrupt on the master monitors a call back from the Arduino Mega slave, which tells it when data has successfully been transmitted to the Interweb. On successful transmission, the values for wind speed, wind direction, volts and rainfall are reset to zero. If transmission fails for any reason, wind speed and rain are kept in the memory for the next transmission attempt so no important data is ever lost. The third Arduino, a Mega 2560, controls the FONA GPRS module and other sensors such as humidity, pressure and temperatures.

Eventually, the data ends up being displayed on a web page HERE .

Details about setting up the database, creating PHP files and using AmCharts are explained in this instructable HERE .

Step 4: Schematic

I made a conscious effort to update the schematic every time I added a new component or connection to the prototyping board so, in theory, a custom PCB could be produced if there was any interest from other people. At the least, this whole project could be easily replicated by using the parts list, schematic and the code files attached.

Step 5: Code

There are 3 sets of code for this project, one of the TFT screen Nano, another for the master Nano and the last for the slave Mega.

The following code snippet shows how the energy hungry Mega and Fona modules are turned off after the data has been transmitted via GPRS. The schematic snippet shows the actual connection between D5 and D2 - coloured orange.

void callbackSuccessful()
   {
   while (degree<362)           // Set all 362 values to zero.
     {
     addingDirection[degree] = 0;
     degree++;
     }
   if (z>(cycleTimeSet +3))   // This stops the callback from coming on at start of program or when mega is turned on.
   {
   Serial.println("");       
   Serial.println("GPRS transmission was successful");
   Serial.println("");
   delay(1000);
   digitalWrite(7,LOW);  // Turn off Mega and Fona.
   alcoholX=1;
   delay(1000);
   z=0;
   knotsMax =0;
   knotsAv =0;
   runningTotal =0;
   rainResult=0;
   result107=0.00;
   finalDirection =0.00;
   modeSize=0;
   degree=0;
   small=0;
   big=0;
   previousCycleTime = cycleTime;
   totalVolts = 0;
   avVolts = 0;
   }
   }

Step 6: Metal Work

A heavy steel frame was made for the wind sensors so that the whole system can be bench tested outside over a period of several months to make sure that there are no long term errors lurking in dark corners.

Eventually the sensors will be mounted on a tall pole to get maximum exposure to the elements. Watch out for part 3!

Step 7: Final

Since most of this project was already achieved in previous incarnations, it was relatively easy to put together and very satisfying to see the schematic become more succinct and the code become more developed and functional.

I thought it would be a good idea to analyse the overall power consumption as the Fona lithium polymer battery discharges and charges cyclically. I visualised a nice graph being produced form current and voltage data to give energy used over a ten or fifteen minute cycle, just to see how well my energy efficiency improvements have worked (or not) compared to the previous version.

The first rather chaotic graph was produced whilst trying to work through a few bugs, one of which was that I could not understand why the weather station was using so much power - it should be about 30mA with everything in a steady state condition. Eventually I diagnosed that the power supply itself was faulty and replaced it with a slightly different type. The green graph shows it working perfectly with nice peaks and plateaux and plenty of noise! The average current over a 10 minute cycle came out at 46.74mA at 11.98 volts which gives 0.560 watts, which is a big improvement on the old system (78.46mA). There's probably a whole load of things that I can tweak to get this value down a bit more - mostly, I suspect, by tweaking the code.

Bench testing is now over and the weather station now lives in a field, fully exposed to the elements, eagerly awaiting the next storm, flood or heat wave. Details about the pole and supporting cables are here:

https://www.instructables.com/id/Arduino-GPRS-Weather-Station-Part-3-Hardware-Upgra/

IoT Builders Contest

Second Prize in the
IoT Builders Contest

Green Electronics Contest 2016

Participated in the
Green Electronics Contest 2016

Epilog Contest 8

Participated in the
Epilog Contest 8

Arduino Contest 2016

Participated in the
Arduino Contest 2016