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.
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.
| 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.
Main controller board
| MCU | ESP32 (FireBeetle32) |
| Radio | SX127x LoRa 433MHz (Ra-02) |
| RTC | PCF8563T (I²C 0x51) |
| USB | USB-to-Serial for programming |
| Watchdog | TPL5010 hardware timer |
| Interface | SPI (LoRa), I²C (RTC), UART (USB) |
Sensor interface shield
| Power | LiPo battery + solar charging |
| LEDs | 15× WS2812 RGB (pin 19) |
| Sensors | ADS1115 ADC, INA219 current, BH1750 lux, SHT humidity/temp, DS18B20 temp |
| Connectivity | Screw terminals for flow meters, ultrasonic, external sensors |
| Config | Analog resistor ladder switch (32 positions) |
| Sleep control | Power MOSFET on pin 26 |
| Address | Device |
|---|---|
0x23 | BH1750 Light sensor |
0x41 | INA219 Current sensor |
0x44 | SHT Humidity / Temperature |
0x48 | ADS1115 ADC |
0x51 | PCF8563T RTC |
Selected at boot via analog config switch on ADS1115 ch2.
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.
| 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 |
sleep_s = 450 × total_night_minutes ÷ minutes_to_sunrise