
Green House Controller RPi Shield
janithcbk123/Automated-Greenhouse
Greenhouse Automation Project

A birdcage automation system based on Arduino UNO R4 WiFi
Custom shield is an open-source printed circuit board by SoF4rAway, from the SoF4rAway/birdcage-automation-system repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 119 × 103.5 mm with 29 parts on 49 nets, routed with 142 tracks and 35 vias.
It is built around the DHT11 and TIP120. Its parts include 10 connectors, 4 resistors, 3 capacitors, 2 ICs and 2 diodes. It belongs with the radio and wireless boards and the AVR (ATmega, ATtiny) boards of this library.
Open-source firmware, circuit schematics, and mechanical integration for an autonomous IoT bird cage management system. This platform consolidates solid feed dispensing, liquid water monitoring and replenishment, and a single-axis linear brush-and-spray tray cleaning mechanism orchestrated by an Arduino Uno R4 WiFi.
If you use this system, codebase, or hardware design in academic work, please cite the original peer-reviewed publication:
M. F. Rahman, M. K. Anam, N. F. Arfa, F. Husnayain, and R. Suwandi, "Integration of Sensor-Based IoT Automation for Feeding and Cleaning in Smart Bird Cage Systems," Jurnal Otomasi Kontrol dan Instrumentasi, vol. 18, no. 1, pp. 83–92, 2026. DOI: 10.5614/joki.2026.18.1.7
@article{rahman2026smartbirdcage,
title = {Integration of Sensor-Based IoT Automation for Feeding and Cleaning in Smart Bird Cage Systems},
author = {Rahman, Muhammad Farid and Anam, Muhammad Khoirul and Arfa, Nuril Fathara and Husnayain, Faiz and Suwandi, Rifki},
journal = {Jurnal Otomasi Kontrol dan Instrumentasi},
volume = {18},
number = {1},
pages = {83--92},
year = {2026},
doi = {10.5614/joki.2026.18.1.7},
url = {https://doi.org/10.5614/joki.2026.18.1.7}
}Conventional avian care systems focus solely on feeding or employ mechanically complex conveyor belts that struggle with dried waste. This architecture introduces three key improvements:
flowchart TD
subgraph Layer1["Physical Layer (Cage, Sensors & Actuators)"]
HC["HC-SR04 Ultrasonic Sensor<br/>(Solid Feed Level)"]
CAP["Grove Capacitive Sensor (10 cm)<br/>(Water Reservoir Level)"]
DHT["DHT11 Sensor<br/>(Ambient Temp & Humidity Telemetry)"]
RTC["DS3231SN RTC Module<br/>(I2C Offline Clock)"]
SERVO["MG996R Servo Motor<br/>(Food Gate Flap)"]
SOL1["ZE-4F180 Solenoid Valve 1<br/>(Cleaning Tray Flush Water)"]
SOL2["ZE-4F180 Solenoid Valve 2<br/>(Drinking Water Replenishment)"]
STEPPER["NEMA 17 Stepper + A4988<br/>(Linear Cleaning Brush)"]
end
subgraph Layer2["Control & Processing Layer"]
MCU["Arduino Uno R4 WiFi<br/>(RA4M1 Core + ESP32-S3 Coprocessor)"]
end
subgraph Layer3["Network & Cloud Layer"]
CLOUD["Arduino IoT Cloud Broker<br/>(REST / MQTT over TLS)"]
end
subgraph Layer4["Application Layer"]
DASH["Web Dashboard & Mobile App<br/>(Remote Monitor & Overrides)"]
end| Component | Model / Spec | Purpose in System |
|---|---|---|
| Microcontroller | Arduino Uno R4 WiFi | Core processing, 5V I/O logic, onboard ESP32-S3 Wi-Fi coprocessor |
| Solid Feed Sensor | HC-SR04 Ultrasonic | Non-contact distance measurement for seed level |
| Water Level Sensor | Grove Capacitive Water Sensor (10 cm) | Segmented non-contact capacitive detection (5 mm resolution) |
| Ambient Sensor | DHT11 Module | Ambient temperature and humidity monitoring (telemetry stream) |
| Real-Time Clock | DS3231SN (I2C) | Battery-backed high-accuracy offline timing |
| Feed Actuator | TowerPro MG996R Servo | High-torque mechanical hatch gate opening/closing |
| Water Flush Actuator | ZE-4F180 Solenoid Valve (12V) | Cleaning tray water flush control (SOL_1) |
| Water Refill Actuator | ZE-4F180 Solenoid Valve (12V) | Drinking water replenishment control (SOL_2) |
| Actuator Driver | TIP120 Darlington Transistor | Current amplification & 12V solenoid isolation |
| Cleaning Actuator | NEMA 17 Stepper (17HS3401) | Linear axis lead-screw actuation for bristle brush |
| Stepper Driver | A4988 Module | Stepper current limiting, direction, and step sequencing |
| Cleaning Brush | Custom Rigid Bristle Assembly | Waste tray scraping surface |
| Power Supply | 12V DC / 5A Buck System | Split rail supply (12V for actuators, 5V for logic) |
[!NOTE] The custom PCB shield includes footprints and pull-ups for the DHT11 sensor. While DHT11 readings are captured and streamed to the Arduino IoT Cloud dashboard for ambient climate telemetry, the automation control logic (feeding and cleaning cycles) operates strictly based on ultrasonic, capacitive, and RTC time inputs as presented in the paper.
The firmware runs a deterministic, cyclic state-machine loop incorporating safety timeouts inspired by critical software engineering principles (e.g., NASA "Power of Ten" Rule #2).
flowchart TD
Start([System Start / Loop]) --> ReadSensors[Read Sensors:<br/>HC-SR04, Capacitive Strip, DHT11 & RTC]
ReadSensors --> SyncCloud[Push Telemetry to Arduino IoT Cloud]
SyncCloud --> CheckFood{Food Level <= 25%?}
CheckFood -- Yes --> OpenFoodGate[Move MG996R Servo to 180°]
OpenFoodGate --> FoodLoop{Food Level > 95%<br/>OR Timeout > 10s?}
FoodLoop -- Yes --> CloseFoodGate[Return Servo to 0°]
FoodLoop -- No --> WaitFood[Loop Read Food Sensor] --> FoodLoop
CloseFoodGate --> CheckWater
CheckFood -- No --> CheckWater{Water Level <= 25%?}
CheckWater -- Yes --> OpenWaterValve[Energize SOL_2 Refill Valve]
OpenWaterValve --> WaterLoop{Water Level > 95%<br/>OR Timeout > 10s?}
WaterLoop -- Yes --> CloseWaterValve[De-energize SOL_2 Refill Valve]
WaterLoop -- No --> WaitWater[Loop Read Water Sensor] --> WaterLoop
CloseWaterValve --> CheckRTC
CheckWater -- No --> CheckRTC{Hour == 15:00<br/>AND Hour != LastChecked?}
CheckRTC -- Yes --> RunCleaning[Execute Linear Cleaning Routine:<br/>Energize SOL_1 + Run Stepper back-and-forth<br/>8200 steps x cleaner_rep]
RunCleaning --> CycleEnd([End of Loop Cycle])
CheckRTC -- No --> CycleEnd
CycleEnd -->|Yield / Loop Delay| StartEvery automated refill subroutine is bound by a strict 10-second timeout ceiling. If a sensor reading fails, detaches, or experiences boundary chattering, the valve/servo forces closed automatically after 10 seconds to avoid overflow or seed spilling.
The sensor is mounted orthogonally at the top center of the seed container:
$$\text{Feed Level (%)} = \left( \frac{18 - D_{\text{measured}}}{18} \right) \times 100%$$
The 10 cm capacitive sensor provides discrete height sensing over internal sensing segments:
The prototype was tested under controlled conditions ($27^\circ\text{C}$, 65% RH) across four validation axes:
pie title Dynamic Refill Failure Rates (n = 5 trials each)
"Grove Capacitive Sensor (0% Failure)" : 100
"HC-SR04 Ultrasonic Sensor (20% Failure)" : 20
"HC-SR04 Successful Refills" : 80Water Reservoir Accuracy:
Food Dispenser Accuracy:
Sanitation & Waste Removal Efficiency:
├── pcb-design/
│ ├── Fab/ # Manufacturing gerbers & drill files
│ ├── components/ # KiCad 3D models & footprints
│ ├── exports/ # PDF schematics and board plots
│ ├── custom-shield.kicad_sch # KiCad 8 schematic design
│ ├── custom-shield.kicad_pcb # KiCad 8 PCB layout
│ └── custom-shield.kicad_pro # KiCad project file
├── src/
│ ├── src.ino # Main Arduino Uno R4 WiFi firmware
│ ├── arduino_secrets.h.example# Template for Wi-Fi credentials
│ └── thingProperties.h # (Generated by Arduino IoT Cloud, git-ignored)
├── system-flowchart.png # System flow chart diagram
├── CITATION.cff # GitHub native citation metadata
├── references.bib # BibTeX citation entry
├── LICENSE # Creative Commons License
└── README.md # Project documentationVCC $\rightarrow$ 5V, GND $\rightarrow$ GND, TRIG $\rightarrow$ Pin D7, ECHO $\rightarrow$ Pin D8VCC $\rightarrow$ 5V, GND $\rightarrow$ GND, DATA $\rightarrow$ Pin D13SDA $\rightarrow$ A4 / SDA, SCL $\rightarrow$ A5 / SCL)SDA, SCL)SOL_1, Cleaning Flush): Driven via TIP120 through Pin D3SOL_2, Drinking Refill): Driven via TIP120 through Pin D4STEP $\rightarrow$ Pin D5, DIR $\rightarrow$ Pin D6, powered by 12V supplysrc/:
cp src/arduino_secrets.h.example src/arduino_secrets.hsrc/arduino_secrets.h and provide your local network credentials:
#define SECRET_SSID "YOUR_WIFI_SSID"
#define SECRET_OPTIONAL_PASS "YOUR_WIFI_PASSWORD"[!IMPORTANT]
src/thingProperties.his automatically generated by the Arduino IoT Cloud environment and is intentionally excluded from Git tracking to avoid credential/Thing ID collisions.
| Variable Name | Type | Declaration | Purpose |
|---|---|---|---|
food_lv | int | Read-only (Periodic 3s) | Seed container level percentage |
w_lv_value | int | Read-only (Periodic 3s) | Drinking water depth percentage |
temp | float | Read-only (Periodic 3s) | Ambient temperature (°C) via DHT11 |
humi | float | Read-only (Periodic 3s) | Ambient relative humidity (%) via DHT11 |
food_crit | bool | Read-only (On Change) | Critical low food flag |
wtr_crit | bool | Read-only (On Change) | Critical low water flag |
isCleaning | bool | Read-only (On Change) | Cleaning cycle active indicator |
cleaner_rep | int | Read/Write (On Change) | Configurable brush cycle repetitions |
man_cleaning | bool | Read/Write (On Change) | Manual dashboard override to trigger cleaning |
thingProperties.h will be auto-populated and linked to your sketch. Flash src/src.ino to the board.This project and associated documentation are distributed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | MountingHole_Pad | MountingHole:MountingHole_2.2mm_M2_DIN965_Pad | H1, H2, H3, H5 |
| 3 | 100u | Capacitor_Tantalum_SMD:CP_EIA-6032-28_Kemet-C_Pad2.25x2.35mm_HandSolder | C3, C4, C5 |
| 2 | 10k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R3, R4 |
| 2 | 1N4001 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D1, D2 |
| 2 | 1k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1, R2 |
| 2 | LM2596_DCDC | LM2596:YAAJ_DCDC_StepDown_LM2596 | U1, U2 |
| 2 | TIP120 | Package_TO_SOT_THT:TO-220-3_Vertical | Q1, Q2 |
| 1 | Arduino_Uno_R4_WiFi_Shield | PCM_arduino-library:Arduino_Uno_R4_WiFi_Shield | A1 |
| 1 | Barrel_Jack_Switch | Barrel Jack:CUI_PJ-002A | J11 |
| 1 | DC-PUMP_REL | Connector_JST:JST_PH_S3B-PH-K_1x03_P2.00mm_Horizontal | J4 |
| 1 | DHT_11 | Connector_JST:JST_PH_S3B-PH-K_1x03_P2.00mm_Horizontal | J8 |
| 1 | Pololu_Breakout_A4988 | Module:Pololu_Breakout-16_15.2x20.3mm | A2 |
| 1 | RTC_MODULE | Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_Horizontal | J10 |
| 1 | SERVO_MTR | Connector_JST:JST_PH_S3B-PH-K_1x03_P2.00mm_Horizontal | J9 |
| 1 | SOL_CTRL1 | Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal | J2 |
| 1 | SOL_CTRL2 | Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal | J3 |
| 1 | STP_MTR | Connector_JST:JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal | J1 |
| 1 | ULT_SNR | Connector_JST:JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal | J5 |
| 1 | W_LV_SENSOR | Connector_JST:JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal | J6 |

janithcbk123/Automated-Greenhouse
Greenhouse Automation Project

Febriyandi12/Desain_PCB
Kolaborasi untuk update desain pcb yang telah di research


robsonsmartins/usbflashprog
A memory device programmer (Flash/EPROM/E2PROM) board and software, connected to PC by USB port.

dcpedit/mission-control
Modern replacement PCB for the IBM Model M 122

RudgeLab/FluoPi
Code and teaching materials for UC/BackyardBrains raspberry pi "macro" scope.

jones139/catocam
Uses a custom trained YoloV8 model on a Raspberry Pi to Detect Cats in CCTV images and Unleash a Cat Deterrent

dcpedit/taptap
TapTap is a solenoid breakout board for those who are interested in adding a solenoid to their existing project. All you need are the following components, and an extra data pin on your microcontroller.
It measures 119 × 103.5 mm and has 2 copper layers, 1.6 mm thick.
29 parts, built around the DHT11 and TIP120. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the SoF4rAway/birdcage-automation-system repository on GitHub, at the commit this page was made from: the board is pcb-design/custom-shield.kicad_pcb and its schematic pcb-design/custom-shield.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).