this post was submitted on 17 Sep 2023
21 points (100.0% liked)

Ask Electronics

3315 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

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 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!

[–] [email protected] 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! :)

[–] [email protected] 2 points 1 year ago

You're welcome!

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

I'd agree with the tip of that ground plane is close to the high voltage part. And there's still space left on the right.

The ULN2003A claims to have the flyback diodes and they're connected. So you don't need another set.

I'm not an electronic expert myself. But I don't get why the fuses are the way they are. Most of the times I see boards having one fuse and when it's blown, the whole board is separated from electricity. You're kind of splitting it up 3 ways.

And the 5A of the fuses doesn't match with the 10A rating of the relais or the 400W you wrote for the connectors. But I get that you have maybe 6 motors moving simultaneously.

(And why do you have the N trace to the connectors split in the middle and a whole other trace going all the way around? Is that to balance things when there's much current going over that single trace? Or to match the 2 fuse design?)

[–] [email protected] 2 points 1 year ago (1 children)

The main reason for splitting up the relays into two sets is that with 10A traces the connector pins would violate minimum separation distances. I would have to get even larger connectors. The ones in the design have 5 mm pitch.

I'm assuming the original board also did this for the same reason although their board is set up for 8 motors split into sets of 4.

I've also had some trouble sourcing a 10A fuse suited for inductive loads but I'm sure I could find one with some more time.

The whole board is on its own house circuit fused with a 16A breaker.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Thanks for explaining. Yeah, I'm sure it's pretty much alright with your circuit breaker. I suppose your main concern for having the fuses is so that those relais can't start a fire once the current is between 10A and 16A for too long. I was just thinking about failure modes. And having something fail, the fuse blow and then half the board still has 230V feels a bit strange. But I guess it's alright. I'm not an expert anyways.

I saw those PCB mounted 5V power supplies coming up in ESP32-projects before. I always thought they were some cheap chinese stuff and you shouldn't trust them. But if they have a proper fuse inside and do proper 5V... Maybe I need to change my mind and start digging deeper.

Idk about mixing 10A relais and 5A traces and connectors. Everytime I buy some shelly stuff, I just have a look at the print on the relais before I wire something up. That'd be wrong in case someone had made the traces smaller. But I guess you can just write 5A MAX on the pcb and everyone can see that, even if one day somebody else does some maintenance. In this case you obviously need a 5A fuse.