Giter Site home page Giter Site logo

arduino-watering's Introduction

Arduino Watering Interface

This Arduino sketch is used to water a vegetable patch. It is designed to interface with another program over a serial connection. It will not water the garden on its own.

I use it to water a vegetable patch with a Golang application.

Features

  • Send moisture readings on demand
  • Send water outlet states on demand
  • Set water outlet states on demand
  • Automatically shut off water outlets after a period of time, a failsafe for broken communications
  • Heartbeat signal
  • Per sensor configurable moisture maps

Commands

a # All water outlets off
b # All water outlets on
c # Outlet #1 on
d # Outlet #1 off
e # Outlet #2 on
f # Outlet #2 off
g # Outlet #3 on
h # Outlet #3 off
i # Outlet #4 on
j # Outlet #4 off
k # Request sensor readings
l # Request water outlet states

Responses

Moisture sensors

Example/fake data

READINGS_START
MS:1:700:44 # MS:ID:RAW:PERCENTAGE
MS:2:333:22
MS:3:333:22
MS:4:333:22
MS:5:333:22
MS:6:333:22
READINGS_END

Water outlet states

Note: REAL_STATE and SET_STATE should always match. REAL_STATE is the current digitalRead() of the pin, and SET_STATE is what the Arduino should have set the pin to.

OUTLETS_START
WO:1:0:0 # WO:ID:REAL_STATE:SET_STATE (1 = on, 0 = off)
WO:2:1:1
WO:3:0:0
WO:4:0:0
OUTLETS_END

Heartbeat

Heartbeats are sent on a timer, if you do not receive these after a period of time, assume the connection has died.

Be sure to read from the serial buffer, else this will fill up and stop new data being received by your program.

HEARTBEAT
HEARTBEAT
HEARTBEAT
HEARTBEAT

Dependencies

arduino-watering's People

Contributors

mewejo avatar

Watchers

 avatar

arduino-watering's Issues

Heartbeat

Send a heartbeat over serial every so often

Automatically turn water off after period of time

If a command is sent to turn the water on, turn it off again in the future if another command to turn it on again isn't received.

This is to prevent water staying on in the event of communication failure.

Startup message

Send data over serial when the program is running and ready for input.

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.