Daffodil

The swiss army knife of farm electronics. Daffodil monitors water troughs, septic tanks, flow meters, and environmental conditions — reporting back to the Digital Stables cloud over WiFi. Comes with a 10W solar panel that connects via USB, and is also ready for standard wall power — deploy it anywhere in the field or the shed.

Works with Annabelle — Through Annabelle, Daffodil receives hourly weather forecasts over LoRa and uses them to manage its power budget intelligently, conserving battery and adjusting LED brightness during predicted cloudy periods.
Dynamic Sleep — Using the onboard RTC and GPS-configured coordinates, Daffodil dynamically calculates sunrise and sunset for your exact location and season. Right after sunset it wakes roughly every 7–8 minutes; as night deepens the interval grows longer with no fixed cap; in the 90 minutes before dawn it wakes every 90 seconds — ready to catch the first moments of solar charging. When voltage drops below 2.8 V the device enters Coma state — sleep duration is still calculated by the power manager but sensor data collection is suspended until charge recovers.
ESP32 LoRa 433MHz Solar Powered Dynamic Sleep LittleFS TOTP Security WS2812 LEDs WiFi Upload

Hardware

The Daffodil shield has a 5-position DIP switch with a resistor network. The combination of switches set at power-on determines the operating mode. Switch 5 (SW5) enables solar power management when ON.

SW1SW2SW3SW4SW5
Switch Position Function Power

The 15 WS2812 LEDs are arranged in 3 rows × 5 columns (index 0–14 left-to-right, top-to-bottom). On each wake cycle the firmware cycles through 5 display modes. Color and the number of lit LEDs encode the current sensor value.

The system uses two custom PCBs that stack together. Wally is the main controller board; Daffodil is the sensor shield that mounts on top.

Wally

Main controller board

MCUESP32 (FireBeetle32)
RadioSX127x LoRa 433MHz (Ra-02)
RTCPCF8563T (I²C 0x51)
USBUSB-to-Serial for programming
WatchdogTPL5010 hardware timer
InterfaceSPI (LoRa), I²C (RTC), UART (USB)
Daffodil Shield

Sensor interface shield

PowerLiPo battery + solar charging
LEDs15× WS2812 RGB (pin 19)
SensorsADS1115 ADC, INA219 current, BH1750 lux, SHT humidity/temp, DS18B20 temp
ConnectivityScrew terminals for flow meters, ultrasonic, external sensors
ConfigAnalog resistor ladder switch (32 positions)
Sleep controlPower MOSFET on pin 26
I²C Addresses
AddressDevice
0x23BH1750 Light sensor
0x41INA219 Current sensor
0x44SHT Humidity / Temperature
0x48ADS1115 ADC
0x51PCF8563T RTC
Operating Modes

Selected at boot via analog config switch on ADS1115 ch2.

  • Water Trough monitoring
  • Septic tank level
  • Flow meter (1 or 2 channels)
  • Tank level (1 or 2 tanks)
  • Voltage monitor / data logger
  • Temperature + soil moisture

Daffodil uses its onboard RTC (PCF8563T) paired with GPS-configured latitude and longitude to precisely calculate sunrise and sunset for any day of the year. Sleep intervals scale automatically with the season — short summer nights get lighter sleep budgets than long winter nights — ensuring maximum uptime during daylight and minimum power draw through the quiet hours. The PowerManager library handles all the maths: sleep_seconds = 450 × night_minutes ÷ minutes_to_sunrise, minimum 90 s with no upper cap.

Daily Power Cycle
SUNRISE GPS location + RTC time reference PRE-DAWN ≤90 min to sunrise · wake every 90 s DAYTIME Solar efficiency > 30% forecast check FULL MODE Full LED brightness CLOUDY LEDs dimmed to 50% SUNSET Efficiency drops below 30% SLEEP min 90 s · no upper cap grows longer as sunrise approaches ↻ daily cycle
Sleep States
State Condition Sleep Duration (calculateOptimalSleepTime) LEDs Sensor Data
Full Mode #3 Daytime · voltage ≥ 3.28 V · clear sky forecast Continuously awake Full brightness (solar-adjusted) ✓ Yes
Cloudy #4 Daytime · cloud forecast ≥70% cloudiness via LoRa or BH1750 lux below cloudy threshold — either source triggers independently Sleeps between each LoRa cycle · same formula as Night Sleep Alternates on/off each cycle (50% duty) ✓ Yes
No LED #2 Voltage 3.12–3.18 V — too low for safe LED operation Continuously awake Off ✓ Yes
Sleep #1 Night (efficiency ≤ 30%) or voltage < 3.12 V ≥90 s · grows longer as sunrise approaches Off ✓ Yes
Coma #5 Voltage critically low (< 2.8 V) calculateOptimalSleepTime() · same formula as Sleep Off ✗ No
Night sleep formula: sleep_s = 450 × total_night_minutes ÷ minutes_to_sunrise
Minimum 90 s, no upper cap. Melbourne winter examples: ~457 s (7.6 min) at 6 pm · ~904 s (15 min) at midnight · ~1408 s (23 min) at 3 am — then pre-dawn kicks in at ≤90 min before sunrise and switches to fixed 90 s intervals.