Raspberry Pi Aquarium HAT


Thought for 4 mins 37 sec
1/4 Inspect current PCB outline, placement, routing, pours, airwires, and DRC

Inspect current PCB outline, placement, routing, pours, airwires, and DRC

Correct placement and board constraints against the final specification

Complete top-layer routing and bottom GND plane

Run final DRC/connectivity verification and remediate remaining violations

Thought for 4 sec
Referenced guidance.
Thought for 8 sec
Searching executors in /daveww00/raspberry-pi-aquarium-controller-hat~c8…
Thought for 6 sec
Reading Aquarium HAT PCB Layout's report…
Thought for 14 sec — Calculating footprint adjustments
Thought for 7 sec
Awaiting 1 background task
Received notification from "Aquarium HAT PCB Layout" that it finished — picking the work back up.
I reviewed the prior layout report and resumed the PCB build with a defined connector-placement compromise: J2 remains flush right, while J14 is positioned as close as safely possible because both connector footprints cannot fit flush along the 65 mm edge.
The layout task completed, but I could not retrieve its final report or independently confirm routing, bottom GND fill, zero airwires, or DRC status.
Remaining
  • Inspect the applied PCB changes.
  • Verify the 85 × 65 mm outline and J1 anchor.
  • Confirm 2.0 mm 5 V and 1.5 mm LED routing widths.
  • Run final airwire, connectivity, and DRC checks.
  • Fix any remaining routing violations.
Execution stopped because your ACUs ran out.
Inspect completed layout
Check routing completion
Verify critical widths
Review connector compromise
Inspect ground plane

J6
J2
J14
J11
Q2
Q1
Q3
Q4
J8
Q5
J7
C6
Capacitance
100nF
R3
Resistance
4.7kΩ
R9
Resistance
100Ω
C5
Capacitance
1uF
R7
Resistance
100Ω
R14
Resistance
4.7kΩ
R2
Resistance
4.7kΩ
C3
Capacitance
100nF
R6
Resistance
1kΩ
R12
Resistance
100kΩ
C1
Capacitance
470uF
C2
Capacitance
10uF
R5
Resistance
1kΩ
R15
Resistance
4.7kΩ
R4
Resistance
100Ω
R11
Resistance
100kΩ
R8
Resistance
100Ω
R13
Resistance
430Ω
C4
Capacitance
220uF
R1
Resistance
4.7kΩ
R10
Resistance
100kΩ
D4
D2
D1
U1
D3
J9
J13
J15
F1
J1
J10
J12
D5
Project Specification
Project Overview
  • Status: Draft
  • Raspberry Pi 4 baseboard/HAT for freshwater planted-aquarium monitoring and control.
  • The board distributes external regulated 5 V power to the Pi, hosts external I2C modules, reads wired sensors, dims three 12 V LED channels, and triggers a fish feeder through galvanic isolation.
Intended Use
  • Personal/learning aquarium controller used indoors near freshwater equipment.
  • First revision is a functional prototype; moisture exposure and cable fault protection are important.
What the Device Should Do
  • Mate with the Raspberry Pi 40-pin header.
  • Accept regulated 5 V DC through an 8-position 5.08 mm screw terminal and supply the Pi 5 V rail.
  • Connect Atlas Scientific EZO-pH carrier, Adafruit PCA9685 module, DS3231 RTC module, and a 0.96-inch OLED over I2C.
  • Read one 1-Wire temperature probe and two leak detector inputs.
  • Provide three low-side 12 V PWM LED channels controlled by PCA9685 outputs.
  • Provide one PC817-isolated fish-feeder trigger.
  • Export four Raspberry Pi GPIO signals through the power/logic umbilical terminal.
Main Features
  • Raspberry Pi 40-pin female stacking/header interface.
  • 5 V input path rated for 3 A continuous design target.
  • Shared 3.3 V I2C bus connectors.
  • 1-Wire pull-up: 4.7 kOhm to 3.3 V.
  • Three AO3400 N-channel MOSFET channels with gate biasing, rated for 2.5 A maximum continuous load per channel.
  • One 5-position, 5.08 mm-pitch LED field terminal: +12V, 12V return/main GND, and three switched MOSFET drains.
  • PC817 optocoupler input/output interface for feeder control.
  • Edge-mounted 8-pin, 5.08 mm-pitch terminal block.
System Architecture

Diagram


8-pin terminal: node_5V, GPIO, GND Protected node_5V input Raspberry Pi 40-pin header I2C bus EZO-pH carrier PCA9685 module DS3231 module OLED header 1-Wire temperature input Two leak inputs 3x AO3400 LED drivers PC817 feeder trigger
Hardware Subsystems
Power
  • Terminal pins 1 and 2: protected board 5 V input, paralleled.
  • Terminal pins 7 and 8: board ground, paralleled.
  • Feed both Raspberry Pi 5 V header pins and multiple ground pins.
  • Use wide copper/pours and appropriately rated terminal contacts for 3 A.
  • Add input bulk/ceramic decoupling plus practical surge and overcurrent protection without excessive voltage drop.
  • Do not use a conventional series diode in the 5 V input path for reverse-polarity protection.
I2C
  • Raspberry Pi GPIO2/SDA1 and GPIO3/SCL1 at 3.3 V logic.
  • Female sockets/headers for EZO-pH carrier, PCA9685, DS3231, plus a 4-pin OLED header.
  • Avoid unintentionally excessive parallel pull-ups from breakout modules; board-level pull-ups may be optional/DNP if included.
Sensors
  • 1-Wire data uses Raspberry Pi GPIO4 and a 4.7 kOhm pull-up to 3.3 V.
  • Leak input 1 uses GPIO22 and leak input 2 uses GPIO23. Both use Raspberry Pi internal pull-ups and external ground-contact sensing.
Outputs
  • Three PCA9685 channels drive AO3400 gates through series resistors; each gate has a pull-down.
  • Maximum continuous LED load is 2.5 A per channel.
  • MOSFET sources connect to main board GND; drains connect to external 12 V LED negative outputs through a single 5-pin field connector. The external 12 V return is tied to the same main GND net.
  • PCA9685 gate drive target is approximately 5 V. The AO3400 design estimate uses RDS(ON) approximately 36 mOhm, giving about 0.225 W conduction loss at 2.5 A. Final thermal acceptance must be verified against the selected device datasheet, PCB copper, and enclosure ambient.
  • PC817 LED input is current-limited from Raspberry Pi GPIO17. The transistor side is exposed as an isolated dry/open-collector-style output connector and is not tied to board ground.
Interfaces and Connections
8-pin Umbilical Terminal

Table


PinNet
1+5V input
2+5V input
3Raspberry Pi GPIO5
4Raspberry Pi GPIO6
5Raspberry Pi GPIO13
6Raspberry Pi GPIO19
7GND
8GND
Raspberry Pi Standard Bus Pins
  • GPIO2 / physical pin 3: I2C SDA.
  • GPIO3 / physical pin 5: I2C SCL.
  • 3.3 V and ground supplied to external low-voltage modules.
5-pin LED Field Terminal

Table


PinNet
1External +12V_LED input/common
2External 12 V return, tied to main board GND
3MOSFET drain, LED channel 1
4MOSFET drain, LED channel 2
5MOSFET drain, LED channel 3
Power and Runtime Expectations
  • External source must be a regulated 5 V supply capable of at least 3 A at the board after cable loss.
  • The HAT does not generate the external 12 V LED supply.
Power Tree and Power Budget

Table


RailLoadDesign allowance
5 VRaspberry Pi 4 and attached HAT modules3.0 A input-path target
3.3 V from PiI2C module logic, OLED, pull-upsMust remain within Pi 3.3 V rail capability; verify module populations
External 12 VThree LED loads2.5 A maximum continuous per channel; external current does not pass through the 5 V input
Manufacturing and Assembly Expectations
  • Professional mixed SMD/through-hole PCB.
  • Through-hole Raspberry Pi header and 5.08 mm screw terminals; SMD semiconductors/passives.
  • Initial target: standard 2-layer prototype unless placement/current-return constraints justify 4 layers.
Firmware-Relevant Hardware Requirements
  • I2C on GPIO2/GPIO3.
  • Umbilical GPIO mapping fixed to GPIO5, GPIO6, GPIO13, GPIO19.
  • 1-Wire temperature input on GPIO4.
  • Leak inputs on GPIO22 and GPIO23.
  • Feeder trigger on GPIO17.
  • PCA9685 LED outputs use channels 0, 1, and 2 for LED channels 1, 2, and 3 respectively.
  • Leak inputs configured with internal pull-ups; active state is contact closure to ground.
Physical Design Expectations
  • PCB outline: 85 mm x 65 mm, with Raspberry Pi mounting/interface geometry retained.
  • Screw terminal and field connectors accessible at board edges.
  • Keep low-level pH/I2C cabling away from PWM LED current loops where practical.
  • Enforce a minimum 1.5 mm trace width for the shared +12V_LED terminal line and each MOSFET drain/current-path trace. Use copper pours or wider traces where routing and thermal performance permit.
Important Design Decisions
  • Replace the earlier RJ45 umbilical concept with an 8-pin 5.08 mm screw terminal.
  • Paralleled terminal contacts are used for both 5 V and ground.
  • The Pi is powered through its 5 V header rail; therefore the external source must be accurately regulated and protected against accidental reverse/back-power conditions.
  • No series diode is permitted in the 5 V path because its voltage drop would compromise Raspberry Pi supply margin.
Assumptions
  • The 5 V source is SELV, regulated, and dedicated to this system.
  • PCA9685 is an external Adafruit module rather than a bare IC.
  • EZO-pH, RTC, PCA9685, and OLED connector pinouts will be matched to documented module headers during component selection.
  • LED current is limited to 2.5 A continuous per channel. AO3400 thermal safety remains subject to datasheet and PCB-copper verification rather than package rating alone.
Change Notes
  • Replaced RJ45 power/logic umbilical with an 8-pin 5.08 mm screw terminal.
  • Fixed terminal GPIO mapping and established a 3 A 5 V copper requirement.
Final Schematic Constraints (2026-09-03; supersedes conflicts above)
  • GPIO4 is 1-Wire temperature data. GPIO22 is leak input 1. GPIO23 is leak input 2. GPIO17 drives the PC817 feeder input.
  • PCA9685 logic/gate drive target is approximately 5 V. Use I2C level shifting so module-side pull-ups to 5 V cannot expose Raspberry Pi SDA/SCL to 5 V; keep PCA9685 VCC logic separate from V+ servo power, and leave V+ unused for this design.
  • Maximum continuous LED load is 2.5 A per channel. AO3400 design estimate uses about 36 mOhm at approximately 5 V gate drive, giving about 0.225 W at 2.5 A. Final thermal safety depends on PCB copper and ambient and remains a layout verification item.
  • Use one 5-position 5.08 mm LED terminal: pin 1 = +12V_LED input/common; pin 2 = GND / 12 V return tied to board main GND; pin 3 = MOSFET drain channel 1; pin 4 = MOSFET drain channel 2; pin 5 = MOSFET drain channel 3.
  • Give the LED connector and MOSFETs current/voltage-rating metadata. In later PCB layout, use at least 1.5 mm trace width on +12V_LED and all three MOSFET drain/current-path nets.
  • The 5 V input path must contain no conventional series diode. A low-loss fuse/PTC, shunt TVS, and bulk/ceramic capacitance are permitted. Omit reverse-polarity protection rather than introducing unacceptable series drop.
  • Board outline target for the later layout phase is 85 mm x 65 mm.
  • Added 2.5 A-per-channel LED load, consolidated 4-pin LED terminal mapping, AO3400 loss estimate, and 1.5 mm minimum LED-current trace requirement.
  • Finalized GPIO4/GPIO22/GPIO23/GPIO17 sensor and feeder assignments, changed LED wiring to a 5-pin terminal with 12 V return tied to main GND, prohibited a 5 V series diode, and set the PCB outline to 85 mm x 65 mm.
  • Project Overview

  • Intended Use

  • What the Device Should Do

  • Main Features

  • System Architecture

  • Hardware Subsystems

  • Power

  • I2C

  • Sensors

  • Outputs

  • Interfaces and Connections

  • 8-pin Umbilical Terminal

  • Raspberry Pi Standard Bus Pins

  • 5-pin LED Field Terminal

  • Power and Runtime Expectations

  • Power Tree and Power Budget

  • Manufacturing and Assembly Expectations

  • Firmware-Relevant Hardware Requirements

  • Physical Design Expectations

  • Important Design Decisions

  • Assumptions

  • Change Notes

  • Final Schematic Constraints (2026-09-03; supersedes conflicts above)