PCB design feedback

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

This is my second PCB prototype and and I would like to get some feedback on it. Basically there is a BLE113 to send receive BLE commands. These commands get transmitted via UART to an ATmega328p. Furthermore the Atmega can control a DC motor. The first one I made behaved as expected but now I added decoupling caps, an H-bridge and changed some other things. There is a copper pour on the bottom which is the ground plane. VCC is 5V and VDD is 3.3V. My goal is for this PCB to be as robust as possible while not really caring about budget constraints. I've read the EMC Design Considerations note (http://www.atmel.com/images/doc1619.pdf) and Hardware Design Considerations (http://www.atmel.com/Images/Atmel-2521-AVR-Hardware-Design-Considerations_ApplicationNote_AVR042.pdf) as well as a lot of other forum posts on good design. It would be nice to get some feedback from the AVR community so if you have any remarks please let me know (and no need to be sparse). What I personally don't like about the current design is that I have too many traces on the ground plane. I also I have a couple of questions:

1) The AVR EMC Design Considerations note describes a circuit for an external reset button (page 15) which contains a diode and cap. Should I use this setup for all resets or only for the ATmega? On the BLE113 for instance I implemented what I found in its datasheet and this does not contain a diode and a cap. Would it be better to add this here as well?

2) I have a big cap (470uF) at the power supply. I used this value because it seems to be common but I'm not sure whether that's a good value for my design. Sometimes I also see 4x100nF caps in parallel at the power supply. Which one is better for my design?

3) For the ATmega power decoupling I use an LC for each VCC and then one for AVCC. Can't I just use one LC for both VCC's? Also AVCC comes after the LC from VCC, is this good or could it just come directly off my voltage regulator? Also for BLE113 I just use C (no L) because thats how it is in the datasheet.

4) I have a lowpass filter for reading analog inputs with cutoff frequency fADC/2 (from datasheet). Should I also have a filter on my UART signals?

5) I have two 5V voltage regulators on the PCB, 1 for the DC motor and 1 for the ATmega. Could I get by with using only 1 for both atmega and DC? Also, should the ATmega net and the DC motor net each get there own "big" cap?

6) My trace width for power is 0.024in and for all the rest 0.012in (saw these values in a tutorial). Is this ok? Seems like big traces to me.

7) I read somewhere (http://electronics.stackexchange.com/questions/15135/decoupling-caps-pcb-layout/15143#15143) that it’s better to have a local power net for the ATmega (for any uC really) and have only one connection between this local net and the ground (with a via) and power planes. This would supposedly limit radiation and prevent the ground plane from becoming a patch antenna. I’m not sure about this though so I didn’t implement this on the PCB, any thoughts?

Thanks in advance!

Schematic

PCB

Attachment(s): 

Last Edited: Mon. Dec 29, 2014 - 01:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Nimyz,

 

A couple of points before I head out shopping... so apologies that I haven't addressed all of your points.

 

A. Where are your mounting holes?

B. Where is your crystal? If you are hoping to use the internal RC oscillator, be aware that it doesn't produce accurate baud rates.

C. I wouldn't use all of the L/C filters... just the one on the AVcc, but only if I intended to make use of the ADC.

D. Your traces to the motor are too thin.

E. A PDF for each of your schematic and pcb layout would have been better on my eyes.

 

Cheers,

 

Ross

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply!

 

A. I didn't make mounting holes yet as this isn't the final design, but thanks for reminding me!

B. Yes, I was planning on using the internal crystal.  I assume you mean that the frequency is not accurate and hence the baudrate is inaccurate? That's really cool I didn't know that. So I should probably go with a crystal then.

C. Yes I'm using ADC for the current sense on the motor.  so I'll just use a capacitor at the VCC's and then LC for ADC

D. I'll also make them 0.024in.

E. I made a pdf first but it seems that AVR freaks doesn't let me upload pdf's. So I converted them to PNG's. Sorry

 

Thank you very much for your feedback. You've pointed out some really nice things that I didn't know!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nimyz wrote:
I was planning on using the internal crystal (sic).

There is no internal crystal; it is just an RC - that's why it's (relatively) inaccurate.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems a bit odd to identify D1 & D2 as "diode" - we can see from the schematic that they're diodes!

 

It's a bit like the pointless comment:

++c;  // increment c

It would be more usual & useful to give the type number;  as you've done for the transistors - you didn't just mark them as "transistor".

 

 

On the silkscreen, you've used Zener symbols for the diodes - but they're just "plain" diodes on the schematic...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nimyz wrote:

E. I made a pdf first but it seems that AVR freaks doesn't let me upload pdf's.

Works for me. Below the edit window, there is a blue text/click link "Add Attachments". That is where we upload such things.

 

 

Cheers,

 

Ross

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Regarding the voltage regulators, the "best" value for the input and output caps is what their specific data sheets recommend.

 

Some might say, for instance, Cout must be >= 33 uF can can be increased without limit.

 

Generally one puts most of the capacitance on the input to the regulator these days, but it depends upon the specific application.

 

Nothing wrong with using a separate voltage regulator for the micro and for the motor, especially if you are only building a few of the PCBs.  If you are building many boards, then the extra costs add up quckly.

 

If the input supply is several volts above the micro's voltage regulator's minimum Vin, then putting a diode from the Vsupply to the voltage regulator would be a good idea.  It helps protects the VR from brown outs during large current draws by the motor, and helps filter some of the motor noise.

 

Run the motor's ground back to the supply separately from the grounds of the micro and other circuitry.

 

Additionally, on the PCB, it is generally wise to include a Pin #1 Marker on the silkscreen.  The square pad will be covered up by the connector.

 

JC

Last Edited: Mon. Dec 29, 2014 - 03:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My goal is for this PCB to be as robust as possible

I would make most of the (TH and via) pads significantly bigger (I can't tell whether your pictures are showing true sizes for these.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vias definitely too small if that image is truly representative. Ditto through-hole pads (such as under connectors). 

 

CON1 - the slots come too close to the edges of the pads.

 

Is there a back side ground plane? Your schematic and the presence of vias all over suggests so, but I don't see any physical evidence of it.

 

I cannot tell, off-hand, which are the motor power  traces. Those are potentially noisy. And, maybe those ought to be wider, depending on the currents involved. Ditto, the supply traces to the driver IC. Also, do not see good bypass caps at the power input  pins of the motor driver - that could be critical.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Mon. Dec 29, 2014 - 04:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How does the power rating for your current sensing 1 ohm resistor R2 compare with the expected current?

 

Ross McKenzie ValuSoft Melbourne Australia

Last Edited: Mon. Dec 29, 2014 - 04:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Think about minimising the number of vias.

 

One track alone has a half a dozen unnecesary vias in it

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

I see the connector to program BLE has some ISP signal and the module on your schema do not show this connection,

How  will you use the BLE113? if your UART will run to 115Kbaud, dangerous with RC must have crystal or resonator.

Do you have make BLE113 working, you write it is your 2nd prototype? 

Thierry

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, I think I’ll just stick to the datasheet’s recommended 100nF and 10uF caps then.

 

Nothing wrong with using a separate voltage regulator for the micro and for the motor, especially if you are only building a few of the PCBs.  If you are building many boards, then the extra costs add up quckly.

Even if there’s nothing wrong with it, does having two separate ones serve any purpose? I thought it might maybe give extra protection against brownouts but I’m not sure about this. 

 

If the input supply is several volts above the micro's voltage regulator's minimum Vin, then putting a diode from the Vsupply to the voltage regulator would be a good idea.  It helps protects the VR from brown outs during large current draws by the motor, and helps filter some of the motor noise.

The diode would go to the microcontroller’s voltage regulator (not the motor’s), right?

 

Run the motor's ground back to the supply separately from the grounds of the micro and other circuitry.

So I wouldn’t use my ground plane for the motor’s ground but a separate path on the top layer?

 

And good point about the silkscreen marking. I might even label all of the motor connector pins separately.

Last Edited: Mon. Dec 29, 2014 - 11:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vias definitely too small if that image is truly representative. Ditto through-hole pads (such as under connectors). 

The minimum via diameter is 35 mil, is this too small?

 

 I cannot tell, off-hand, which are the motor power  traces. Those are potentially noisy. And, maybe those ought to be wider, depending on the currents involved. Ditto, the supply traces to the driver IC. Also, do not see good bypass caps at the power input  pins of the motor driver - that could be critical.

 Valusoft mentioned this too, so I will definitely make the motor power traces bigger. Would I need bypass caps both at the power pins of the motor driver as directly across the leads of the motor itself (I read that this is sometimes done as well)?

 

And yes, there is a ground plane on the bottom layer but I removed it before I posted here to make it less crowded.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wouldn't use the two 5V voltage regulators, seems overkill and brings cost up and has no real use. Just use one big bypass cap for the DC (over GND and V_DCM) and you need bigger MOTOR1 and MOTOR2 traces (24mil should be fine). Usually H bridges have (fast recovery) diodes but maybe they are built into the IC? And as you mentioned you need less traces on bottom because they really split up the ground plane which is considered bad grounding. Finally, I would probably drop the inductors at the VCC decoupling. Usually I don't see them. I would leave the LC filter at ADC though.

Last Edited: Mon. Dec 29, 2014 - 11:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do not minimize via number. Additional vias makes better ground plane. In this board, this is the case.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maks,

 

Read the post.

It referred to minimising vias in signal lines not ground plane interconnects.