this post was submitted on 17 Sep 2023
19 points (95.2% liked)

Ask Electronics

3325 readers
1 users here now

For questions about component-level electronic circuits, tools and equipment.

Rules

1: Be nice.

2: Be on-topic (eg: Electronic, not electrical).

3: No commercial stuff, buying, selling or valuations.

4: Be safe.


founded 1 year ago
MODERATORS
 

Hi, this post is structured similarly to r/PrintedCircuitBoard 's review request format. Since we don't have any PCB communities over here yet, I thought that this might fit in here and can maybe spark some friendly discussion.

This is a relay board controlling electrically driven windows and blinds. For this purpose it has some additional connectors to a weather station, interior sensors and an LCD screen.

It is replacing a ~20 year old board that has started to develop some annoying quirks. I've mostly copied what the original board did and adjusted it for the ESP32. This is not a production board and if all goes well, I will only ever assemble a single one of these.

The primary usage scenario is that the MCU will monitor the weather station and then actuate the motor groups (M1 - M6 connected on J3 - J8) to keep the indoors temperature and humidity in check.

At least during summer time the board will likely run 24/7 and will hopefully be used for a number of years. For maintenance reasons I've tried to keep it simple and the component count low.

Mains power is supplied from J1 and being fed to the motors via the relays. PS1 converts the line voltage to +5V DC for the relay coils and some auxiliary components. The switching regulator U2 steps that down to +3.3V for the MCU U1 and IO Expander U3.

The board size is mostly constrained by the preexisting mounting holes which gives me plenty of space to work with even with just a 2 layer board. The enclosure containing the mounts is installed indoors and is finger-pokey-tight.

Jumper JP1 allows me to supply the MCU devkit daughter board with +5V, should I ever replace it with a different one. Similarly J11 exists for future expansion.

J10 mounts another daughter board (not included in review) facilitating communications with the weather station. Should the station ever need to be replaced I can swap in a new, matching board.

There aren't any high-speed connections on the board. The fastest one is likely the SPI connection to the LCD controller but I can slow it down in firmware if necessary.

Regarding the DNP components: There are only 5 motors installed at the moment so I will cover the sixth slot with a piece of plastic for now. R1 and R2 will only be populated if the 10k pullup resistors integrated into the MCU are insufficient for typical baud rates.

While it is not the first board I've designed, it is the first one carrying mains power (European grid 230V@50Hz). I'm using 2 oz copper to accommodate the motor currents within reasonably wide traces.

In case anyone is interested, it will be running the ESPHome firmware to easily integrate with the Home-Assistant smart home solution. This also pushes firmware maintenance from me onto the ESPHome devs.

3D render from front (no 3D model for relays K** and MCU board; 3D model for J1 and J2 is a stand-in of same outer dimensions): 3D Front

Orthographic view from front: Orthographic Front

Schematic:

Schematic

PCB All layers (For reference: thickest traces are 2.5 mm / ~98.4 mils; thinnest traces are 0.25 mm / ~9.84 mils): All layers

PCB Front layers excluding Silkscreen: Front layers

PCB Back layers + Front Fab layer: Back layers

you are viewing a single comment's thread
view the rest of the comments
[–] joulethief@compuverse.uk 6 points 1 year ago (1 children)

I haven't got enough time on my hands right now to review the whole desingn, but one thing that jumps to mind is that you'll want to use an antiparallel diode on each relay coil to suppress the negative voltage spikes when switching it off.

Be sure to keep adequate distance between high and low voltage traces. The ground plane seems awfully close to the N trace.

Other than that, I'd happily welcome more PCB and/or personal project discussions!

[–] Starfighter@discuss.tchncs.de 5 points 1 year ago (1 children)

It is my understanding that the ULN2003A (U4 and U5) has integrated flyback diodes. From the datasheet:

Each consists of seven NPN Darlington pairs that feature high-voltage outputs with common-cathode clamp diodes for switching inductive loads.

Good call on that ground plane. I'll scoot the relays a little bit to the right. That should resolve the issue.

Thanks for your feedback! :)

[–] joulethief@compuverse.uk 2 points 1 year ago

You're welcome!