Please tell me if there are some mistakes or please give some suggestions for improvement.
-
Is one of the edges of U1 supposed to hang off the board? – Oskar Skog Oct 16 '22 at 06:56
-
Is R8 actually a resistor? Why a resistor placed directly across the AC input? – Kyle B Oct 16 '22 at 07:06
-
Are purple traces going the routing? i.e cut away the PCB for creepage purposes? If so, note, you have alot of them running across the board. This will be a mechanically weak board, easily cracked – Kyle B Oct 16 '22 at 07:08
-
@KyleB No, R8 is a varistor – Souvik Ghosh Oct 16 '22 at 07:26
-
Don’t label connector Ux… U is normally used for ics. Use CNx. C1 needs to be next to the ESP32. I’d suggest you try to keep the mains down one end of the pcb - keep the high current tracks short. Looks like you’ve got gnd fill on both sides - use vias to tie them together otherwise your islands become antennas. Spend some more time thinking about the layout. I can buy much the same device from the local hardware store for $15. So why make your own? At least learn from an existing product - see how they designed their circuit and pcb. C8 is interesting. What does it do? – Kartman Oct 16 '22 at 07:58
-
@Kartman Thanks, I will keep your suggestions in my mind. – Souvik Ghosh Oct 16 '22 at 08:04
-
Please, provide a description of what is it that you're trying to implement. Specify objectives and, if possible, specifications you're trying to achieve, Make it easy for people to instantly what you're trying to work on and give you better feedback. – Designalog Oct 16 '22 at 08:10
-
I would create the schematic in one block showing the interconnections between the various sections. As it is drawn, one needs to search the schematic for the matching network label and then search the rest of the schematic to see if it crops up anywhere else. If you're interested in improving your schematic skills then https://electronics.stackexchange.com/questions/28251/rules-and-guidelines-for-drawing-good-schematics?r=SearchResults&s=1%7C65.9366 has some very good tips. – Transistor Oct 16 '22 at 15:29
-
You should label R8 as "VR", not "R" then. That schematic symbol is for a variable resistor, not a varistor. – Kyle B Oct 16 '22 at 17:52
1 Answers
Let me start off with: If you haven't been told, PLEASE DON'T WORK WITH MAINS AC VOLTAGES.
From the question asked, it seems like you don't have a lot of experience with mains voltage AC, and AC voltage can both kill people directly and start fires which can kill people indirectly.
However, if you feel that you must persist, here are a couple of things you absolutely must think about:
- What kind of "applicance" do you have?
Controlling something like an LED lamp is fairly straightforward. It's a normal resistive load and isn't too complicatied. You need to make sure all your wires are sized to be able to deliver the maximum load you might have and that's pretty much it.
Controlling an air conditioner, refrigerator or motor is MUCH more complicated because it is an inductive load. There are surge currents on both startup and shutdown that you must be able to deal with. Being able to bound those currents takes some engineering experience.
- Why are you using a mechanical relay?
Since you are controlling AC voltage, something like an optoisolated triac is going to be cheaper, easier, safer and much more reliable. Normally, you need relays when you are dealing with DC loads.
- There are UL and CE standards that you have to pass for sale in the US and EU.
You can't just blow these off. If you don't have someone who knows how to deal with this, you are setting yourself up for a lot of grief. It's not impossible to do yourself, but it's not something an absolute beginning should be trying.
- You are assuming liability for anything that goes wrong
Are you sure you want this? If anything goes wrong, your fault or not, you and/or your company are headed to court if someone gets hurt or dies and your device is involved in any way.
- Are you sure there isn't something off the shelf that would work for you?
LOTS of companies have created products like this. They're generally called something like an IoT Relay.
If you get the sense that I am trying to scare you off--good. Because I am trying to scare you off.
Mains AC voltage isn't something to play around with--you can hurt yourself AND others if you are thoughtless.
Hope this helps.

- 1,091
- 4
- 12