Giter Site home page Giter Site logo

zebiano / wateringsystem Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 3.18 MB

Automatic Watering System designed for my home. Made possible with solenoid valves, Raspberry Pi 4 and relays.

HTML 33.93% JavaScript 46.27% C++ 8.86% CSS 10.95%
relays raspberrypi4

wateringsystem's Introduction

Automatic garden watering system

This project consists of a Raspberry Pi 4 running Ubuntu server (x64) that is connected to various floaters inside 2 water tanks and to various relays that control solenoid valves. Here's some specific info:

  • Valves 1 - 4, 8 and 9 are for watering the garden
  • Rain is a property set to define that it will or is currently raining for certain conditions to occur
  • Tap water can be manually activated or deactivated, equals to Valve 5
  • Pump is to manually activate or deactivate it, equals to Valve 6
  • Letting water fall back down from tank 2 to 1 is done with Valve 7
  • There are 5 floaters, three in the first tank and two in the second

GPIO pins are always written in BCM pin numbers.

RPIO pins

Running

You need to run this with root. Else GPIO access won't be granted. I've configured pm2 to start the process on startup with sudo:

sudo -s
pm2 startup
pm2 start main.js --name "Watering System" --watch
pm2 save

.env

Here's an example for the .env file:

WS_ENV=test
WS_PORT=3000
WS_MANUAL_TIMEOUT=28800000
WS_VALVE1_TIMEOUT=120000
WS_VALVE2_TIMEOUT=120000
WS_VALVE3_TIMEOUT=120000
WS_VALVE4_TIMEOUT=120000
WS_VALVE8_TIMEOUT=120000
WS_VALVE9_TIMEOUT=120000
WS_TAPWATER_TIMEOUT=172800000
WS_PUMP_TIMEOUT=1200000
WS_TRANSFER_TIMEOUT=1200000

Default timeouts

Designation Time ms
Manual mode 8 hours 28800000
Valve 1 2 mins 120000
Valve 2 2 mins 120000
Valve 3 2 mins 120000
Valve 4 2 mins 120000
Valve 8 2 mins 120000
Valve 9 2 mins 120000
Tap water 48 hours 172800000
Pump 20 mins 1200000
Transfer 20 mins 1200000

wateringsystem's People

Contributors

dependabot[bot] avatar zebiano avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

maarten-jb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.