Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
bburger
Published © GPL3+

Automatic Plant Waterer [Alarm Based]

This project utilizes a solenoid valve and the TimeAlarms library to water a small potted indoor plant at specific times of the day.

BeginnerShowcase (no instructions)1,219
Automatic Plant Waterer [Alarm Based]

Things used in this project

Hardware components

Power MOSFET N-Channel
Power MOSFET N-Channel
×1
AA Batteries
AA Batteries
×1
Solenoid Valve
×1

Story

Read more

Schematics

Circuit Diagram

Built and Tested with Arduino Uno

Code

Automatic Plant Waterer IDE Source Code

C/C++
Built in Arduino IDE
#include <TimeAlarms.h>
#include <Time.h>
#include <TimeLib.h>

int solenPin = 9;
int ledPin = 10;

void setup() {
  pinMode(solenPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  setTime(3,07,0,21,3,2018);
  Alarm.alarmRepeat(10, 0, 0, water);
  Alarm.alarmRepeat(19, 0, 0, water);
}

void loop() {
  Alarm.delay(1000);
}

void water() {
  int t = second() + 30;
  digitalWrite(solenPin, HIGH);
  digitalWrite(ledPin, HIGH);
  delay(30000);
  digitalWrite(solenPin, LOW);
  digitalWrite(ledPin, LOW);
  setTime(hour(),minute(),t,day(),month(),year());
}

Credits

bburger
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.