0
\$\begingroup\$

I need some advice on the layout of my board.

I'm using Atmega328P and intend to use it in industrial environments.

The purpose is to take a 30Vdc max input and step down to 5V with LM317 to power the Atmega and other IC's.

A relay will use the input voltage and if needed a series resistor, the LEDs will be driven by ULN2003. The main idea is to make a reliable system for monitoring battery packs during charge, up to 65Vdc, and based on the voltage the relay will cut the charge off. The SMD buttons will make the configuration for the relay operation.

On the next version will try to make SMPS power suply instead of LM317, first I need to test the software in use and then make changes on pcb if needed.

Schematic

SCHEMATIC

Layout

Layout

\$\endgroup\$
5
  • \$\begingroup\$ 30V -> 5V using a linear regulator: bad idea. Use a switch-mode regulator for large voltage differences. It absolutely makes no sense whatsoever to control LEDs with an ULN2003 (that component generally makes little sense in 2021, even for its original purpose, but that's a different story). \$\endgroup\$ Jan 23, 2021 at 21:26
  • \$\begingroup\$ You got a diode that you labeled with "30V max", but you attach it to your up to 65 V battery voltage. That will immediately explode, I guess? What's D22 for? \$\endgroup\$ Jan 23, 2021 at 21:26
  • \$\begingroup\$ Will that relay switch mains voltages? How much current does the LM317 regulator has to output for the 5V circuits? Do you intend to sell product? How does 65V relate to low voltage legislation in your country - i.e. is it above or below the limit for needing special care? \$\endgroup\$
    – Justme
    Jan 23, 2021 at 21:32
  • \$\begingroup\$ @Justme: assuming half of the 4·7 segments are on at any given time, and the 9 other LEDs are, too, and and each is set to 10 mA, then we got 230 mA. At a voltage difference of 25 V, that's nearly 6W. Definitely a case where the LM317 is not a sensible choice. \$\endgroup\$ Jan 23, 2021 at 21:39
  • \$\begingroup\$ 65V is the max not 30V, will change that, my Idea is to filter voltage spikes or transientes with him. D22 will be a ESD rated diode, not quite sure which yet, since i can't protect the board from touch during mouting or mainetence, i'm not familiar with protections for this purpose. The relay will switch mains voltage with indutive load, 5-7A in worts case. 65v is considered low voltage here, It will be used on battery charger circuit. The LM317 will be replaced , thanks for the calculations and advice. \$\endgroup\$ Jan 23, 2021 at 22:37

1 Answer 1

2
\$\begingroup\$

Schematic

  • 30V -> 5V using a linear regulator: bad idea. Use a switch-mode regulator for large voltage differences. Assuming half of the 4·7 segments are on at any given time, and the 9 other LEDs are, too, and and each is set to 10 mA, then we got 230 mA. At a voltage difference of 25 V, that's nearly 6W of power that a linear regulator converts to heat. That thing will start to become unsustainably hot and – hopefully – shut itself down.
  • The ULN2003A gives you nothing you actually need – it's a Darlington array, but you just need to sink some current. You'd be better served with discrete NPN transistors, or n-channel mosfets.
  • Since MOSFETs are rarely as good in p-channel as in n-channel form, it's generally a better idea to use your microcontroller's GPIO to sink current, rather than sourcing it; i.e. connect your LEDs exactly the other way around and turn them on by pulling the output low.
  • I don't know what "+C_BAT" and "-C_BAT" are, but I'm almost certain you're operating your opamps in a way that damages them: the input voltages must be within the supply voltages, and you specified V_Bat_ext to be up to 65V, but you're only dividing that by 10, and supply your opamp with 5V.
  • C31 / C29: assuming you added these for noise reasons: they do (nearly) nothing. You need to add them after a series resistor, otherwise there's very little source impedance that would lead to a voltage drop for higher frequencies!
  • You sprinkle things like D22 in a lot of places. I don't think that actually helps.

Layout

  • Ground plane. Have it. Ground return paths are necessary, especially around your microcontroller, where you actually do have a "high-speedish" clock.
  • Your design is far too crowded and is also lacking any option to safely mount it anywhere. Board space is relatively cheap, so make it twice as big, try to stay on exactly one layer with all your signals if possible
  • Do not route analog signal lines across half the board. Re-arrange your analog signal processing (the opamps) to be close to the source of observation.
\$\endgroup\$
4
  • \$\begingroup\$ Thats was a great review, thank you. About the points you made, i'm going to a SMPS suply now, the uln2003 is just for more sinking so which good NPN could be used in there ? The opamps should have a trimpot on the voltage divider forgot about them, the +C_bat and -C_bat are from a shunt resistor with at least 60mv on rated current. On the input for opamps If i put the capacitor after the voltage dividir will make the desing better or its a waste of use. \$\endgroup\$ Jan 23, 2021 at 22:54
  • \$\begingroup\$ D22 and other are for ESD protections, not sure how to use them properly but the board Will bem exposed on production and mainetence. Now about the Layout, will make a ground plane, the board is made to be small , will keep all im mind for the redesign. \$\endgroup\$ Jan 23, 2021 at 23:09
  • \$\begingroup\$ yeah, but if you don't know how to use them, then using them in random places protects nothing. \$\endgroup\$ Jan 23, 2021 at 23:11
  • \$\begingroup\$ Will rethink about some choices , thanks !! \$\endgroup\$ Jan 24, 2021 at 0:21

Your Answer

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

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