adamneareva
Published © GPL3+

Double Plant Watering 2

An other double plant watering version, now with more autonomy and less power consumption.

IntermediateWork in progress23,792
Double Plant Watering 2

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
Resistor 1k ohm
Resistor 1k ohm
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Breadboard (generic)
Breadboard (generic)
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
you have to cut it
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×1

Story

Read more

Schematics

Double plant watering 2

Schematic

Double plant watering 2

Schematic

Code

Double plant watering 2

Arduino
#include <LowPower.h>

byte pump1=7;               //pump1 at pin 7
byte pump2=8;               //pump2 at pin 8
int tempo=2000;             //watering time of 2 seconds
int i=0;                    //memory counter i start to 0
byte ledboard=13;           //on board led at pin 13

void setup()
{
pinMode(pump1,OUTPUT);       //pump1 output
pinMode(pump2,OUTPUT);       //pump2 output
pinMode(ledboard,OUTPUT);    //on board led output
digitalWrite(ledboard,LOW);  //turn off Arduino led
digitalWrite(pump1,LOW);     //start with both pump turned off
digitalWrite(pump2,LOW);
}

void loop() 
{
  if(i==0)                  //if reset i
  { 
  digitalWrite(pump1,HIGH); //turn on pump1 
  delay(tempo);             //wait some time
  digitalWrite(pump1,LOW);  //turn off pump1
  digitalWrite(pump2,HIGH); //turn on pump2
  delay(tempo);             //wait some time
  digitalWrite(pump2,LOW);  //turn off pump2
  }
  i++;  //i=i+1
  // Enter power down state for 8 s with ADC and BOD module disabled
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); //sleep 
  if(i==10800) //every day
  i=0;          // reset i
}

Credits

adamneareva

adamneareva

3 projects • 14 followers

Comments