Target "Snitchbox Kratky"

GOAL: Design an automated sensor device to monitor conditions in a Kratky grow tank and report readings regularly to the LabMom server.


Explanation

If I want any chance of developing and refining a hyper-efficient home garden system, I'm going to need data, and the sooner I begin collecting it, the better. But I also know my own tendencies, and being the guy with clipboard in hand, moving from experiment to experiment and making meticulous notes just is not me. So if I'm going to collect useful data, I'd better automate as much of that process as I can.

Deliverables

Logical features

A compact device capable of automatically measuring the state of a Kratky grow tank and reporting those measurements over WiFi to the LabMom server, using the Snitchbox API. It must be able to capture readings every 15 minutes and report:

  • air temperature (DHT22)
  • relative humidity (DHT22)
  • illumination (TLS2591)
  • water depth (HC-SR04)

Each snitchbox should know its own ID and report that with each sample reported. (ID === network device name)

Timestamps should not be included in the telemetry. Since small devices like this are notorious for clock drift, it will be more robust and consistent for the server to apply a timestamp to each incoming report.

Finally, each snitchbox should provide a simple web interface over which its operating parameters can be managed:

  • ID number
  • reporting frequency
  • URL of the LabMom
  • active/inactive state
  • duration of pause cycle

Physical features

  • a pause button, so that data capture can be suspended during tank maintenance
    • toggled by long press
    • max pause time set on config screen
    • issues a device reset when unpaused
    • this will cause minor gaps in report timing
  • an RGB LED to reflect the current operating state
  • an easily visible QR encoding of its ID string

The status light will have 5 states, noted here but also fleshed out more fully in Finite State Machine Sketch:

  • blue: all is well, the monitor is standing by for the next sample period
  • green: all is well, the monitor is currently taking samples and relaying data to the collector
  • yellow: monitor is in pause mode for N seconds or until unpaused
  • purple: same as blue, but some metrics are outside expected range, consult logs for more info
  • red: some kind of error has been detected, consult the logs for more info
  • brightness varies with measured light levels
  • energy saving mode: lights wink every M seconds rather than shine continually (toggled by double click?)

The surface mounted push button controls the following behaviors: - single click: toggle blink mode (power saver) - double click: send a telemetry report now - long press: toggle pause

The physical design should be as compact as possible, and should make at least some attempt to protect against water intrusion.

Temperature and humidity readings should be made outside the case and the sensor should be physically isolated from the heat generated by the microcontroller inside.

The case will also act as a cover for a circular access port in the tank lid, through which internal measurements can be taken.

Anti-deliverables

The Kratky Snitchbox will not collect: water temperature, pH, EC, or TDS values.

Doing so would be costly and require significant maintenance. It will be better to capture these values manually, with a single, portable tool, and limit maintenance requirements to that single device.

It also will not capture air temperature or relative humidity inside the tank. At present, I see these are largely redundant and of little value.

Ruminations

What are these monitor pucks called? Watching lights, humidity, temperature, waterlevel. Sending reports to central collector. Words to inspire name: snitch, gossip, weatherwise, probe-oscis, telemetry, scarecrow, voyeur, chatterbox, kratky, grow, seedling, germinate, fountain, calorie snitchcraft, weathersnitch, soilsnitch watersnitch, snitchInTime, snitchbox

Tasks

  • [/] Design SnitchBox case
  • [/] Design SnitchBox hardware/code ✔
    • [x] Add light sensor ✔
    • [x] Add depth sensor ✔
    • [x] Add hum/tmp sensor ✅ 2023-04-27
    • [/] Add status LED
    • [/] Add input button
    • [ ] Connect to LabMom

Log

  • 2023-04-12: started work on base code, with OTA updates and a web config interface
  • [x] Create a list of nec modules ✅ 2023-04-10
  • [x] Acquire the modules ✅ 2023-04-10

Comments