Review Request - Pool Controller

I've only been tinkering with breadboards, ESP32 and Raspberry PI GPIO for a year or so. My initial goal was/is to create a pool controller with a Raspberry PI hooked up to Home Assistant via MQTT over wifi, maybe try and replace the raspberry pi with an ESP32.

But my current mechanical timer stopped working a few weeks ago so instead of designing the final version of the board I want with the relays and mains voltage on the board and doing that safely, I figured I've got this 4 channel relay that's enough to handle some light 110v stuff (lights already on a gfci circuit) and a couple of these to handle the pump and heater.

So I tried to create a PCB to sit between my 5v 5a power supply and the raspberry pi gpio on one side, and the above relays on the other. I know I could eliminate some of this with a level converter but it was more fun to do it this way. The schematic and PCB design are below and I'd appreciate feedback. If there's some fundamental thing I'm missing feel free to just tell me to google something. I still need to do math about the resistor levels but also feel free to tell me if they just seem way off.

J1:

  • pin 1&2 come off of a 5v5a power supply

  • pin 3-8 are GPIO from the PI/ESP32

J2:

  • Connects to the 4-channel relay board and other relay mentioned above.

  • It also has ground and +5v connector.

I don't know if there's really any point in having the +5v on this board. It will make sense once I get around to making V2 of this board that has the relays on it and not a separate board but it does seem silly routing it through the board.

Schematic: https://i.imgur.com/bOWG4BK.png

PCB: https://i.imgur.com/hzaIUwt.png

Posted Jan 14, 2022, 10:24 PM UTC

28
Hutableger•

Fundamental question: Why wouldn’t you just use a stripboard with THT components? It’s way cheaper, faster and easier to assemble.

Also take care with any mains power with water with humans nearby.

3
alkrunOP•

I'll definitely prototype it in a stripboard. Once working I may send it off to have the PCB made just to see the process. The Schematic and PCB were mainly me trying to capture what I'm looking for and learn KiCad.

And definitely understood about mains and water.

Thanks!

1
Enlightenment777•
  1. What physical size is your resistors? Do you really need to go that small? If you are going to solder, then maybe choose 0805 size or 0603, but you should avoid 0402 and 0201 for hand soldering.

  2. Concerning traces connected to header connectors... route trace horizontally a small distance before changing to 45 degree angle, otherwise the trace will be too close to nearby header pads.

2
Spegs21•

A few things I see right off the bat:

  1. You're using resistors that are way too small if you are going to try to do this by hand, unless with a microscope. I recommend 0805s for a beginner, maybe 0603.
  2. The holes for the pins are plated and will have continuity on both sides of the board. No reason to have vias in your 5V line. Just route it on the bottom from pin to pin.
  3. Make the 5V trace much thicker, like same width as the pin pad. This lowers resistance (less heat and voltage drop along the trace) and increases current capacity.
  4. Pour copper (GND) on the top layer too and tie the layers together with vias.
  5. Make you traces bigger. Same reasons as the 5V line. They don't need to be as big though.
2
alkrunOP•
  1. I was planning on some stripboard and THT components like someone else asked for a prototype, I might send off to have the PCB made just to see the process but 0805 or 0603 sounds good and I've got plenty of room

2-5. Done

Thanks for the help!

2
Spegs21•

No problem! Through-hole would be fine too, probably easier. Stripboard is a good idea for this design. It's always best to prototype a design first if possible. It can save you from wasting time and money on a PCB that won't work.

2
[deleted]•

[deleted]

1
alkrunOP•

I tried incorporating your suggestions and the others here. Updated PCB: https://i.imgur.com/G2V8wYu.png

The top layer ground pour let me clean up the previous vias and rerun wider traces. I've been reading and watching videos on ground planes and via stitching and I'm starting to get it. I saw a pretty helpful video that shows a EM simulation for a reference change with and without a ground via stich - https://www.youtube.com/watch?v=nPx2iqmVAHY.

If the updated PCB is heading in the right direction how much via stitching would make sense? Any need/benefit to place some between the components or add them to the periphery? How many vias, you thinking 5-10 or more? This will be in an enclosure with a Raspberry Pi or ESP32 using wifi so keeping EMI down will be important.

Thanks again.

1
Spegs21•

This isn't really going to be a high speed design so you don't need to get too crazy with them, like via fencing. I like to put them in corners of the pour and near any Gnd pads. Probably worth adding mounting holes that are connected to Gnd as well. You can add the symbol to your schematic and connect it to Gnd, then choose a footprint (with pad) that works for you. M3 or M2.5 is pretty typical. I like to override the thermal in pad properties to direct connection too.

You are also going to need to draw edge cuts in your layout. It defines the board shape.

The changes look good so far!

2