And (sorry) an other nitpick (you can call me nickpick):
The label J-B at J2 is drawn as an input, it is an output. Also, you should not use global labels (I do use global labels too, now that I have discovered that they have a different style (is that true?), I’ll change my habbit).
Also using the label is no longer necessary, they are really close together. Mark the block around the relay, move it a bit up (key M) and draw a wire.
Well i am pretty happy with my work. i just need to start over completely on the PCB design.
I was looking at it earlier seeing that J2-8 was so close, but i liked having the two screwterminals at the bottom exactly next to each other so i never moved it.
And now i know there are different global labels for input, output, bidirectional and so on.
And also have to figure out why the damn transistors footprint is not working.
You are correct in that.
I thought that’s where i put it?
I can’t get any transistor footprint to work.
I wanted to use as mush SMD components as possible but when that didn’t work i switched out to THT components, getting same error when loading into PCB viewer:
Warning: No net found for component Q1 pad 2 (no pin 2 in symbol). Warning: No net found for component Q1 pad 3 (no pin 3 in symbol). Warning: No net found for component Q1 pad 1 (no pin 1 in symbol).
Or what am i doing wrong?
Select the symbol for your transistor and edit the properties to temporally show the pin numbers / names. I suspect you’ll find the symbol pins named E,B,C or the like while your footprints will show 1,2,3.
Some (more) notes…
For an easy to ready schematic, it’s good to go further in standardization. Your relay driver is a simple example, and if you completely follow “signals from left to right, and voltages from top to bottom”, you get something like the screenshot below. A neatly drawn schematic is also useful, because it helps to catch silly errors such as diodes connected the wrong way around.
For resistors and capacitors, it’s also common to use https://en.wikipedia.org/wiki/RKM_code Normally the unit (Ohm, Farad) is omitted both by resistors and capacitors. So R1 just becomes 4k7 and C2 becomes 22u.
1N4007 is also not a good choice as flyback diode over the relay. It is a quite slow power diode. 1n4148 is pretty much standard for applications such as this (and thus very cheap) but almost any small signal diode that can at least handle the relay peak current would work (I.e., you can reduce the BOM if you need some other diode at another location. Reducing the amount of different sized parts is also a common trick to make building easier, both for factories, and for DIY. I would also use electrolytic capacitors for C1 and C2 Beware that the XX1117 is a low drop regulator, and this regulator does have some stability issues with very low ESR capacitors. So it may be unstable with a ceramic cap on it’s output, but work normally with an electrolytic capacitor.
@paulvdh Yeah i was looking at it last night realising i was not following the standard on that part of the schematics, i just thought it looked better after flipping, mirroring and rotating it around for about 10 times.
Yeah i was wondering why needing such a big flyback diode and was gonna research that today, thanks for the suggestion of 1N4148.
I had the wrong symbols on the capacitors, but at the time it was the only capacitor symbol i found. I’ll put some electrolytic caps on there. And i have found a polarized cap symbol now.
Thanks for the help.
Alright, spent some time on trying out a pcb.
If understood everything correctly, low current signals are using a track width of 0.3mm and should be enough. 5V is at 0.5mm and 12V is at 0.7mm.
According to calculations it should be enough, i suppose the 12V tracks can be made bigger, there are plenty of space around them.
The back is ground except for parts under the ESP. I’ve read somewhere at some point that a ground backplate under the antenna might not be good for reception.
So what are the thought’s on this?
Oh, and yeah, there are a few silkscreens overlaps i have ignored for now.
Two major things:
The diode has to be placed as close as possible to the relay’s coil. Best place would be on the back side.
And I’d place the relais close to the screw terminal. Thus horizontally on the bottom.
Edit, adding a third major thing:
You should add a fuse.
Ah ok. I see a few changes i can do with that.
I could probably move both 1x2 screw terminals to the other side. Getting the pump one up by the relay, and 12 volts in next to the regulator.
I’ll post a new one shortly.
OK!
As you do have a GND zone on the back (if not, make one), remove all the GDN tracks on the front.
Place a via at C2 pin 2 and C1 pin 2. This might enable some better routing. And maybe (more maybe not) place D1 back on the front, just for convenience while assembling.
Please explain why.
I’ve heard this often, but never got any decent reason for it. Best I know, it’s a stubborn misconception. If you’re optimizing for EMC, then the best place of the diode is close to the “switch”, because it minimizes the change in the path of the current takes. A DC current is no EMC problem, but changes in currents (and current paths) are important for EMC performance. For more background info, research with the magic words “hot loop” in SMPS design.
Because of the inductive nature of the relay coil, changes in current though it will be relatively slow (and thus generate not much EMC problems in the first place, but switching the long current path from the transistor, to the diode is a fast change. You do not want a big change in loop size for this current.
The keepout area around the antenna looks a bit small. In general, more empty room around then antenna is better. There are some recommendations for this, but those should generally be treated as a minimum. I guess you have (relatively high) headers in between your PCB and the ESP32. This also “complicates” the effectiveness of the keepout area for the antenna. It also looks like you have an edge of the zone coinciding with a keepout (rule) area. I don’t like such constructions. KiCad uses integers, and those don’t have as much rounding errors as floating point numbers, but I still prefer to avoid the possibility of rounding errors to cause a problem. I would just add a few more corners to the zone, and not use the rule area at all.
G5V is a quite small relay, with a maximum current of 1A. Your:
probably has a higher peak current. Maybe it’s good enough, maybe your relay fails after some time… (months, years).
Well, here is my explanation.
Lets say, the transistor is “far” away from the coil.
You switch on the transistor and that transient travels along the path, emitting noise. That is an argument to place the transistor close to the coil.
Now if you switch off the coil, you get an inductive transient, that travels from the coil to the diode, so same effect as with switching on.
The voltage generated by the coil depends on dU/dt (switching time). So for both cases, a slow switching time helps to reduce noise. And placing the transistor close to the coil reduces EMI when switching on. The diode close to the coil reduces EMI when switching off. Furthermore, the voltage generated by the coil mostly is higher than the coil driving voltage.
Is that good enough?
@Patrik_R
Seems my editing didn’t reach you: I suggest adding a fuse. If the motor gets blocked, your relais will overload.
And an extra suggestion (that you might ignore) is reverse polarity protection. At least in front of U1/C2. A voltage drop from the diode doesn’t hurt the supply to the ESP.