ESP32 Chicken Coop PCB


PCB thickness is chosen when ordering; it is not determined automatically by the schematic.
For this controller, select:
  • Finished PCB thickness: 1.6 mm
  • Copper weight: 1 oz
  • Layers: 2
1.6 mm is the common default and is strong enough for the ESP32 sockets, headers, and wiring. It also works with most ordinary mounting hardware and enclosures.
You can verify the selected thickness in three places:
  1. The PCB manufacturer’s order form under PCB Thickness.
  2. The manufacturer’s final order summary.
  3. With digital calipers after receiving the board; a nominal 1.6 mm board may measure slightly above or below 1.6 mm because of manufacturing tolerance.
Do not confuse board thickness with copper thickness. “1 oz copper” is about 35 µm (0.035 mm) per copper layer.
Can you add me a couple screw holes? Use as small of an amount of ACU's as possible. Don't go rearranging the whole board just like 1-2 holes to pin it down will suffice in the already empty areas
I’ll inspect the board once, place two small mounting holes in existing clear corners without moving components or traces, then run only the targeted clearance checks.
Added two 3.2 mm non-plated mounting holes for M3 screws in the open lower-right area. No components or routing were moved, and the targeted clearance/edge checks are clean.
Export manufacturing files
Add mounting-hole labels
Check enclosure fit

Board Bring-Up Plan
What each board section does
  • ESP32 controller: the DOIT ESP32 DevKit V1 plugs into sockets J1 and J2.
  • Power interface: J3 receives regulated 5 V and GND from the external 12 V-to-5 V DC/DC converter. The 12 V motor supply does not enter the ESP32 controller power rail.
  • External motor-driver interface: J4 carries only common GND and the low-current L298N control signals: OPEN (GPIO19), CLOSE (GPIO18), and PWM/EN (GPIO5).
  • Manual controls: J6 is manual OPEN and J7 is manual CLOSE. Each external normally-open button connects its two connector pins when pressed.
  • Light sensor: J8 connects the external photoresistor/sensor wiring to 3.3 V and the protected light-sense input.
  • Break-beam sensor: J9 is the receiver/power cable interface; J10 is the IR emitter connection. Use only a receiver output that is safe with 3.3 V logic.
  • Security-disable switch: J11 connects the external security-disable switch.
  • Motor wiring: schematic references J5/J12 are intentionally excluded from the PCB. Connect the actuator directly to the external L298N output terminals using wire and connectors rated for at least 3 A. Motor current must not pass through this controller PCB.
Connector hookup rules
  1. Disconnect all power before inserting wires or the ESP32.
  2. Follow the PCB net/silkscreen labels; never assume a connector pin from its physical position alone.
  3. The DC/DC converter's 5 V goes to the J3 5 V terminal and converter GND goes to J3 GND.
  4. Join the controller GND, L298N logic GND, DC/DC GND, and 12 V supply negative at a suitable common-ground point.
  5. J4 goes only to the L298N logic header. Do not connect 12 V or motor outputs to J4.
  6. Keep sensor and button cables away from the actuator motor wires when practical.
ESP32 insertion orientation
  • Install two straight 1x15 socket strips at J1 and J2. The rows are exactly 25.4 mm center-to-center.
  • Insert the DOIT ESP32 DevKit V1 with its USB connector facing the lower board edge and accessible from outside the board.
  • The ESP32 antenna end faces toward the marked antenna keepout area at the upper end of the sockets. Do not add metal, wires, components, or copper tape over this area.
  • Check that all 30 module pins are centered over socket holes before pressing down. If alignment requires force, stop and correct it.
LED and part identification
  • D1 is the red closing LED driven by GPIO23 through R1 = 360 Ω.
  • D2 is the green opening LED driven by GPIO22 through R2 = 330 Ω.
  • For both 5 mm LEDs, the long lead is the anode (+) and goes toward its series resistor/GPIO side. The short lead and flat side are the cathode (-) and go toward GND. Match the flat-side/cathode mark on the PCB before soldering.
  • Ordinary resistors are rectangular 1206 parts. Read their value from the designator/BOM and place them flat between the two pads; resistors have no polarity.
  • Small ceramic capacitors are rectangular 1206 parts and have no polarity.
  • The round bulk capacitors are radial through-hole parts. Their body stripe marks the negative lead; install that lead in the GND/negative hole. Reversed electrolytic capacitors can be damaged.
  • ESD diodes and the MOSFET are polarized/oriented parts; match their package mark and pin-1 marking to the PCB outline.
Safe first-power procedure
  1. Leave the ESP32, L298N logic cable, sensors, buttons, IR devices, and actuator disconnected.
  2. With a multimeter in resistance/continuity mode, verify there is no short between 5 V and GND or between 3.3 V and GND.
  3. Power the external DC/DC converter by itself from 12 V. Adjust or verify its output is 5.0 V before connecting J3.
  4. Switch power off, connect only J3 5 V and GND, then switch power on through a current-limited or fused source if available. Stop immediately if anything heats, smells, or draws unexpected current.
  5. Verify 5 V at J3 and approximately 3.3 V on the ESP32 3V3 rail. Switch power off.
  6. Insert the ESP32 in the orientation above and power again with the motor supply/output wiring still disconnected.
  7. Load firmware that initially keeps GPIO18, GPIO19, and GPIO5 inactive.
Basic test sequence
  1. Test D1 and D2 one at a time from firmware; confirm red indicates closing and green indicates opening.
  2. Connect J6 and J7 buttons and confirm each input changes state only while its button is pressed.
  3. Connect the J11 security-disable switch and verify its state in firmware.
  4. Connect the J8 light sensor and watch the GPIO36 ADC value while changing the light level. The input must remain between 0 V and 3.3 V.
  5. Connect the break-beam receiver at J9 and emitter at J10. Confirm GPIO39 changes cleanly when the beam is blocked and restored.
  6. With actuator power still absent, connect J4 to the external L298N and verify OPEN, CLOSE, and PWM/EN logic with a meter or logic probe.
  7. Finally connect the separately fused 12 V motor supply and the direct heavy-gauge L298N-to-actuator wiring. Test only short movements first and confirm the actuator's internal end limits stop travel.
Pass criteria
  • 5 V and 3.3 V rails are correct and stable.
  • No ESP32 input exceeds 3.3 V.
  • Motor-control outputs are inactive at startup.
  • Every button/switch has a stable released state.
  • Both status LEDs show the intended firmware role.
  • The actuator current flows only through the external L298N and ≥3 A wiring, not through the controller PCB.
  • What each board section does

  • Connector hookup rules

  • ESP32 insertion orientation

  • LED and part identification

  • Safe first-power procedure

  • Basic test sequence

  • Pass criteria