Living in Britain, the weather can always provide a conversation topic. This summer was no different! We had some crazy unprecedented high temperatures of over 40 degrees. 

Couple 40 degree heat with going away on a summer holiday and there was no way we’d have living tomato plants by the end of it! That was, until we created this automatic plant watering system and weather station. Read on to see how you can create something similar, a perfect addition to your garden or patio.

 

How does the weather station work?

This project can be done in two separate parts – the weather station and plant watering system. The weather station is designed to be powered by solar energy which charges 3 rechargeable batteries. 

In the picture (right) you can see an LED 4 digit display. This turns on at dusk. It’s sensed by monitoring the voltage across a light dependent resistor. 

When the correct voltage is reached, the LED display is illuminated. The humidity, current temperature and max /min temperatures are shown sequentially and is displayed in the form of reading A, reading B and so on. The LED display remains illuminated for approximately 2 hrs after dusk.

There are many ways we can get the most from the small, lower power solar cells. 

Firstly, the Arduino design is optimised to reduce the current drawn from the batteries. This is achieved by running from an 8MHz clock. Sleep mode is also used to reduce the energy required during the day. We also removed the redundant voltage regulator and power LED from the Pro Mini circuit board.

 

The plant watering system add-on

Want to take the weather station project a bit further? You could try adding an automatic plant watering system to this. The system works using a small submersible water pump and driver circuit in addition to the weather station circuitry. 

We wanted to ensure the weather station could suit most of the extremes the British weather system has to offer. This is why the driver circuit and standard AA batteries are housed in a small waterproof case. 

The drive signal from the weather station is used to activate the pump. The connection for this is via a 2 core cable. A 2.5 mm jack socket/ plug is used for this connection at the weather station. 

We chose a low voltage (5V) mini submersible type for aquariums or small fountains. There’s plenty of these available from eBay.  The pump is then placed into your reservoir. 

Successful electronic projects sometimes rely on thinking outside the box – for this project, we were more thinking ‘recycling box’! 

The capacity of the watering system relies on how big your reservoir can get. With some epoxy resin, we filled the holes in a recycling bin and this became our reservoir.

At dusk the pump is activated by the output of the weather station, running for a minute or so. R1 sets its run duration. If there’s been a particularly hot day, the pump runs for longer.

By the end of a two week holiday in 30+ degrees, the 2 tomato plant pots we had weren’t just alive, but keeping us in big red juicy tomatoes for the rest of the summer! 

This project isn’t just a weather station and automatic plant watering system but a supplier of food – which to my mind, you can’t get better than that!!

 

Resources

Click on each item below to access the code, parts list and circuit diagrams. This will expand the box to show the diagrams in a larger size.

 

Parts list
Component Quantity Circuit Reference
Arduino Pro Mini 1
TM1637 LED 4 digit display 1
DHT11 Temperature humidity sensor 1
Resistor 10K, 0.25W 1 R2
Resistor 10K (trimmer) 1 R1
Light dependent resistor 1 R3
Solar cell 5V, 60mA 2 D1, D2
Rechargeable battery 1.2V, 600mA 3 VCC1
Socket 2.5mm  1 J1
Diode 1N4148 2 D3, D4
Switch   1 S1
Battery holder 3x aa 1
Water pump circuit diagram

Weather station circuit diagram

The code for weather station

* Weather Station by Guy Nicholson 5/7/22. Uses 8MHz internal oscillator.

* Voltage regulator and series LED removed from Pro Mini for power saving.

*/

#include “DHT.h”

#include <TM1637.h>

#include <Adafruit_SleepyDog.h>

#define DHTPIN 4     // Digital pin connected to the DHT sensor

#define DHTTYPE DHT11   // DHT 11

DHT dht(DHTPIN, DHTTYPE);

int CLK=2;

int DIO=3;

TM1637 tm(CLK,DIO);

float Tmax=-50;

float Tmin=99;

const int ldrPin=A0;

const int resPot=A1;

int darkLimit=400;

int dTime=0;

int dayWarm=50;

int brightness=0;

int readTime=1500;

// put your setup code here, to run once:

void setup() {

  Serial.begin(9600);

  Serial.println(F(“DHTxx test!”));

pinMode(9,OUTPUT);// Pump output

dht.begin();

tm.set(brightness);//range 0-7 (7 max)

tm.clearDisplay();

}

void displayNumber(int num){

tm.set(brightness);//range 0-7 (7 max)

tm.display(3,num%10);

tm.display(2, num/10%10);

tm.display(1, num/100%10);

tm.display(0, num/1000%10);

}

void loop() {

  // Wait a few seconds between measurements.

// delay(2000);

  // Reading temperature or humidity takes about 250 milliseconds!

  // Sensor readings may also be up to 2 seconds ‘old’ (its a very slow sensor)

  float h = dht.readHumidity();

  // Read temperature as Celsius (the default)

  float t = dht.readTemperature();

  // Read temperature as Fahrenheit (isFahrenheit = true)

  float f = dht.readTemperature(true);

  // Check if any reads failed and exit early (to try again).

  if (isnan(h) || isnan(t) || isnan(f)) {

    //Serial.println(F(“Failed to read from DHT sensor!”));

    return;

  }

  // Compute heat index in Fahrenheit (the default)

  float hif = dht.computeHeatIndex(f, h);

  // Compute heat index in Celsius (isFahreheit = false)

  float hic = dht.computeHeatIndex(t, h, false);

  //Serial.print(F(” Humidity: “));

  //Serial.print(h);

  //Serial.print(F(“%  Temperature: “));

  //Serial.print(t);

  //Serial.print(F(“C “));

  //Serial.print(f);

  //Serial.print(F(“F  Heat index: “));

  //Serial.print(hic);

  //Serial.print(F(“C “));

  //Serial.print(hif);

  //Serial.println(F(“F”));

  // put your main code here, to run repeatedly:

if (t>Tmax)Tmax=t;// records hottest temp

if (t<Tmin)Tmin=t;// records coldest temp

if (dTime < 2000 && dTime >= 1){

readTime=readTime;

tm.point(1);

displayNumber(Tmax*100);

tm.display(3,10);

delay(readTime);

displayNumber (Tmin*100);

tm.display(3,11);

delay(readTime);

displayNumber(t*100);

tm.display(3,12);

delay(readTime);

displayNumber (h*100);

delay(readTime);

}

if (dTime > 2000){

tm.clearDisplay();//turns LED display off after approx 2.7 hours

tm.point(0);

int sleepMS = Watchdog.sleep(10000);

}

int ldrStatus=analogRead(ldrPin);// reads light level

if (ldrStatus<=darkLimit){

// Goes into dusk mode

int pumpTime=analogRead(resPot); // reads the setting for pumpTime

dTime++;

if (Tmax > 27) dayWarm=40;

if (Tmax < 27) dayWarm=50;

if (dTime < pumpTime/dayWarm)digitalWrite(9,HIGH);//turns pump on to water plants

if (dTime >= pumpTime/dayWarm)digitalWrite(9,LOW);//turns pump off after delay set by resPot

if (dTime==2000) Tmax=0;//resets Tmax after approx 2.7 hours

if (dTime==2000) Tmin=99;//resets Tmin after approx 2.7 hours

}

if (ldrStatus >= 600){

// goes into day mode

tm.point(0);

tm.clearDisplay();// turns off LED display during the day

digitalWrite(9,LOW);

dTime=0;

brightness=0;

int sleepMS = Watchdog.sleep(10000);

}

}