plantwaterer

Public

@compnski

Download board files

Files for version 1. Pick what you came for.

Share plantwaterer

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading…

README

plantwaterer

Plant Waterer v2.

A robotic plant watering system in two parts.

embeddedwaterer: Tinygo program for a microcontroller that waters on a fixed schedule. watererserver: Go program for rasberryPI that communicates with the embedded application to report stat and control remotely. Currently is a standalone parser that emits CSVs with stats data.

Big Features:

  • Soil humidity sensors
  • Multiple relays, allows different water circuits
  • Read stats / update config remotely
  • Webcam for monitoring, takes snapshots

Arduino

  • Turns relays on/off for specified on/off periods.
  • Takes commands, sends stats back over serial.
  • Monitors humidity sensors, reports back to Pi

Future Plans

  • Humidity based control, water when soil dries past certain threshold
  • Store customization data in EEPROM

Raspberry Pi

  • Currently just records serial data to disk for later analysis
  • Takes webcam snapshot every 5 minutes

Future Plans

  • Simple go service, hosts website.
  • Polls Arduino via serial link on some interval. Keeps state of last values to show deltas.
  • If Arduino resets, Pi monitor should automatically reset the water on/off durations if they’ve been changed.
  • Awair integration to pull in room humidity/temp/co2 levels

More details on the linux side in the pi/README.md, and the hardware side in hardware/README.md In general, standard arduino serial at 115200 baud.

3-byte header, 4-byte request Request: CMD <command> <8bit number> <16bit number> Response: Echo command back. Stats is special and will then send stats followed by a terminator.

Commands

commandvalueargs?Notes
water_on0x028bit water idResets water timer
water_off0x038bit water idResets water time
set_water_on_duration0x048bit water id 16bit duration seconds
set_water_off_duration0x058bit water id 16bit duration seconds
set_next_water_at0x068bit sensor id 16bit valueSets wait time to desired value. Useful after resets

To send a command, echo over the serial link. echo -e 'CMD\x03\x00\x00\x00' > /dev/serial0

Stats Return:

Stats are continually sent via serial every StatsIntervalSeconds, default of 5.

{"now": 1485775,
"sensors":[
 {"id": 0, "d":[ 1, 37440, 2, 37376, 3, 37376, 4, 37440, 5, 37440 ]},
 {"id": 1, "d":[ 1, 37376, 2, 37440, 3, 37376, 4, 37376, 5, 37376 ]}
],"sections":[
 {"id": 0, "on": false, "next": 1555513, "last": 1296313, 
 "onTime": 50, "offTime": 259200, 
 "onAcc": 306, "offAcc": 1296007 }
]}

Notes:

  • Number of sensors and length of history is determined at compile-time. It is limited by the memory capacity of your chip. More powerful chips can support more sensors and longer histories.
  • All timestamps are relative to the local epoch, when the board was turned on.
  • The data in sensors.d are pairs of (timestamp, value) from the analog input.
  • onTime / offTime are current status values
  • onAcc / offAcc accumulate time spent in on / off states over time

References

Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.