2
\$\begingroup\$

this is my first time designing and ordering a PCB, so I'm quite nervous about this. So I thought you guys could have a look, since you are more experienced than me by far.
The PCB is for an enclosure I already picked out, and it will function as a CAN bus controlled relay controller.
I will use it in our EV conversion for the taillights. I designed it to be able to handle 5A, with appropriate external fuses.
The ADC pins are to measure the bulb resistances, to give a blown bulb light or not. I started another topic about the PSU unit, so I don't know much about this part.

Also, does anyone have an idea what's best to do with the GPIO0 pin on the ESP32?

I've made some changes, so here's the EasyEDA project: https://oshwlab.com/pol.peerboom/patrol-lcu

The schematic, now with upload header, all grounds connected and updated layout: enter image description here

all pin 4's on the relays are the output lights in dutch, and all ADC nets are the voltage measurement for the resistance.

And here the updated board so far:

enter image description here enter image description here

thanks so much!

\$\endgroup\$
16
  • 2
    \$\begingroup\$ You appear to have not connected GND on U10 nor pin 15 of U1. Pins 2 and 4 of U10 should be connected too. \$\endgroup\$ Commented Nov 21, 2022 at 0:30
  • 2
    \$\begingroup\$ You’ll want the FET source to connect to ground and the drain to the relay \$\endgroup\$
    – Frog
    Commented Nov 21, 2022 at 3:22
  • 2
    \$\begingroup\$ You have big caps off (probably too much) of XL1509, but no 100nF! Why? \$\endgroup\$ Commented Nov 21, 2022 at 3:44
  • 2
    \$\begingroup\$ Read the ESP32 Hardware Design Guide on Keepout zone for the ESP32 antenna. Also the decoupling capacitors requirements. \$\endgroup\$
    – hcheung
    Commented Nov 21, 2022 at 4:42
  • 2
    \$\begingroup\$ @Lolimpol are you sure? Check out fig.14 on page 7 \$\endgroup\$
    – Frog
    Commented Nov 21, 2022 at 22:14

3 Answers 3

4
\$\begingroup\$

A few things I can see...

  1. As per comments, NUD3160 avalanche MOSFETs have S/D swapped

  2. AO3401A high-side P-channel MOSFET has S/D swapped

  3. AMS1117 has GND missing.

  4. AMS1117 10uF ceramic on the output does not guarantee stability as per datasheet. Suggest a series 2Ω resistor between the cap and 3.3V. Or switch to a tantalum.

  5. Bypass cap near the CAN transceiver.

It would be easier to follow the schematic if higher voltages were on top and power/signals flowed from left to right. Most of that schematic is opposite.

I'll let others comment on the layout, but I'll add images to the question.

\$\endgroup\$
6
  • \$\begingroup\$ On my next schematic I will definitely keep that in mind, I didn't know. I'll do some googling on the bypass cap. About the AMS1117, would you recommend a resistor or a tantalum? \$\endgroup\$
    – Lolimpol
    Commented Nov 21, 2022 at 11:52
  • 1
    \$\begingroup\$ Resistor most likely. \$\endgroup\$ Commented Nov 21, 2022 at 14:48
  • \$\begingroup\$ I will add it, Thanks! \$\endgroup\$
    – Lolimpol
    Commented Nov 21, 2022 at 14:51
  • \$\begingroup\$ About the NUD3160, I saw in the datasheet link that the way I have it wired is the way they do, are the pins swapped on EasyEDA? \$\endgroup\$
    – Lolimpol
    Commented Nov 21, 2022 at 21:31
  • 2
    \$\begingroup\$ Source (pin 2) is connected to ground in the datasheet, and Drain (pin 3) is connected to the relay. You have the opposite. \$\endgroup\$ Commented Nov 21, 2022 at 21:35
3
\$\begingroup\$

The grounding plane on the bottom layer has issues. Only 10-20 mil of copper (if that) exists on the current return path from the relays. The grounding system needs to be near continuous, and if you have a thick trace for VCC to carry current you also need the same thickness at least for the ground.

Remember that copper traces and planes have resistance, the smaller you make the traces the more resistance they will have. This will create problems with large currents so make sure that you look at the current return path from each device back to the ground pin of the power supply. You can even estimate the amount of resistance with a PCB Trace calculator

\$\endgroup\$
4
  • \$\begingroup\$ Thanks! I did do this, and that's why I decided to leave the VCC traces, and from the output pins to the pads exposed without soldermask, but like stated the big current will only be running from the VCC to the pads next to all the relays, ground for the loads is provided externally. \$\endgroup\$
    – Lolimpol
    Commented Nov 21, 2022 at 15:05
  • 1
    \$\begingroup\$ Might want to do some work on the ground plane, and make sure it's as continuous as possible \$\endgroup\$
    – Voltage Spike
    Commented Nov 21, 2022 at 15:44
  • \$\begingroup\$ I will do that, also I will add a via roster, at about 2mm apart. That's why there's via's next to every important component's GND \$\endgroup\$
    – Lolimpol
    Commented Nov 21, 2022 at 17:20
  • 1
    \$\begingroup\$ One of many reasons why 4 layers is pretty much standard for SMD PCBs nowadays. Trying to do a relatively complex board it with just 2 layers typically leads to one big mess. \$\endgroup\$
    – Lundin
    Commented Nov 24, 2022 at 7:48
3
\$\begingroup\$

Just some stylistic comments on the schematic:

  • Try drawing your ground symbols always pointing downwards.
  • In general, try drawing bigger voltages above lower voltages. It's the other way round under U9, which makes it unnecessarily difficult to understand what's going on. Being consistent here also makes it less likely to screw up polarity of certain devices.
  • Also try sticking to a left-to-right signal flow.
  • You are using both ground symbols and signal references for your GND net, for example. Don't use signal references for supply nets.
  • Please try to avoid "label hell". Tidy little boxes and a lot of on-page references may look "nice" from a distance. But it's really hard to understand what's going on. Try drawing complete wires whenever practicable instead of labels everywhere. You need to put a little effort into arranging your sub-circuits, of course.
  • Maybe you don't need pin 1 dots on schematic symbols. That's more common on layout symbols.
  • In many places there are junction dots on wires where there is apparently no junction (at pin 3 on K8, for example).
  • The part names of your relays obfuscate the net labels which are connected to pin 5.
  • P-channel FETs like Q1 are usually drawn horizontally with the incoming voltage on the left. Also double-check if that FET is really doing what you expect it to. If the FET is turned off, the body diode will still be conducting.
  • It's not obvious what net the wire connecting C6 and C7 is connected to. I suppose it's GND. If not, the circuit won't work.
\$\endgroup\$
2
  • \$\begingroup\$ Thanks so much, I will change as much of this as possible, and keep it in mind for future use. \$\endgroup\$
    – Lolimpol
    Commented Nov 22, 2022 at 8:18
  • \$\begingroup\$ Good answer. And not just stylistic, most of these remarks are what's expected from a PCB designer in a professional setting. \$\endgroup\$
    – Lundin
    Commented Nov 24, 2022 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.