Wiring diagram — controller board terminals, wire for wire
Everything outside the box is 12 volt. The board makes its own 3.3 V. You never land a wire on the ESP32 pins.
Looking down on De-Fly v1.0. Square pad is pin 1 of that connector. ESP32 DevKit: EN pin toward the top of the board, USB toward the bottom.
| From | Wire | To, on the board | Notes |
|---|---|---|---|
| Battery positive | 16 AWG red | 12V IN + | Through the 7.5 A fuse first. Fuse sits within about 6 inches of the battery post. |
| Battery negative | 16 AWG black | 12V IN − | Straight to the board. Do not fuse the negative. |
| Pump positive | 16 AWG, usually red | PUMP + | This pad is switched raw 12 V. The pump only sees 12 V when the relay closes. |
| Pump negative | 16 AWG, usually black | PUMP − | Board ground. Same rail as battery −. |
| Eye 1 brown | sensor cable | EYE 1 12V | Sensor power. About 11.6 V after the onboard protection diode. |
| Eye 1 blue | sensor cable | EYE 1 GND | Sensor ground. |
| Eye 1 black | sensor cable | EYE 1 SIG | NPN signal. Do not put 12 V on this pad. |
| Eye 2 brown | sensor cable | EYE 2 12V | Same as eye 1. |
| Eye 2 blue | sensor cable | EYE 2 GND | Same as eye 1. |
| Eye 2 black | sensor cable | EYE 2 SIG | Tied on the board to eye 1 SIG. Either beam broken = cow present. |
| Solar panel | as marked on the panel | Charge controller solar / PV terminals | Not to the De-Fly. |
| Charge controller battery + and − | as marked | Battery posts | The controller box also lands on the battery posts. Never on the charge controller LOAD terminals. |
Both sensors: 12 V retroreflective, NPN (sinking) output. Baomain E3F-R2NK or equivalent. Listing must say NPN. PNP will not work and can damage the board.
| Sensor wire | Function | Board pad |
|---|---|---|
| Brown | +12 V power | 12V (square pad of that eye) |
| Blue | Ground | GND |
| Black | NPN open-collector signal | SIG |
Mount one eye just outside each end of the nozzle run, chest high (about 24–30 inches), reflector straight across. Keep them within about 6 feet of each other so a cow between them always breaks at least one beam.
| Wrong | Why |
|---|---|
| PNP photo eyes | They source 12 V onto SIG. The board is built for NPN only. |
| Brown and black swapped on an eye | Puts 12 V on SIG. Same damage as a PNP eye. |
| Controller on the charge-controller LOAD terminals | Many cheap controllers disconnect LOAD at night or under a low-voltage cutoff. Land on the battery. |
| Battery reversed | Can kill the board. Red to 12V IN +, black to 12V IN −. |
| 12 V to any numbered ESP32 pin | You should never be on those pins. Use the labeled pads only. |
| No fuse | A pump stall or a short will cook the wiring. 7.5 A is right for a typical 1 GPM 12 V spot-sprayer pump. |