Pages: [1]   Go Down
Author Topic: My first PCB (shield) design, please help critique  (Read 833 times)
0 Members and 1 Guest are viewing this topic.
Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6935
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

Finally got enough confidence to design my very first shield. I have no experience making pcb or using Eagle. Here is the diagram and board:




My intention is to have arduino sense two digital channels, three buttons and display results on the LCD (2X16). The digital channels are on 3.5mm stereo audio jacks so they receive 5V, gnd, and signal. The little jumper is to decide whether to use the LCD backlight or not. The 16pin female connector will connect with 16 header pins soldered on a standard LCD pannel. There are no connectors for the original arduino channels since they're all used up except for the analog inputs and one digital input. Any suggestions or comments are very welcome. Thank you.
Logged


0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 417
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd bring out all the pins so can be plugable... Also you could use the 4bit liquid crystal library and save some digital pins... I'd stay free if you could from the pwm pins if any are left over. Just my 2 cents smiley-wink
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6935
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks chris. I can't bring the digital pins out since I've used them all, 6 for LCD, 3 for buttons, 2 for digital signals, only 1 left besides Tx and Rx, which I may need for serial. Yes, I'm already using 4bit LCD. The only unused digital pin is 3, a PWM pin. I may use that pin to control backlight in the future. Can I use the analog pins as digital pins?
Logged


Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

IIRC digital pin 13 is dodgy for INPUT.

And yes, you can use the analog pins, as digital ones. They start at 14.
« Last Edit: June 18, 2010, 11:09:29 pm by leppie » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6935
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks leppie. I'll shift my connections one pin to the right so digital 13 is empty. So is this because there is an LED on 13?

Thanks again for your answer. I didn't know I could use those analog pins as digital I/O. Does the atmega328 have internal mux/demux to hook those pins to analog or digital as needed?
Logged


Cape Town, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 177
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So is this because there is an LED on 13?

I think so.

Quote
Does the atmega328 have internal mux/demux to hook those pins to analog or digital as needed?

You can use one or the other. There is no special way to do this. It just works  smiley
« Last Edit: June 19, 2010, 04:15:15 am by leppie » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Does the atmega328 have internal mux/demux to hook those pins to analog or digital as needed?
Quote
You can use one or the other.
Well you can actually use both as I found out.

If you define it as a digital pin and run it as such then you can still do analogRead(0) to read the analog from it, it will still function as a digital pin after this. A useful way to quickly change types which I needed in a project.

I was reading a high/low value but I wanted to check how far off the middle (state change point) I was so I could debug it so I would read the analog value to check but use a digital read for speed later in the code.

Mowcius
Logged

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 106
Posts: 6379
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll start with the same advice I give everyone: make your traces thicker unless they really need to be thin.   See: http://www.instructables.com/id/Make-hobbyist-PCBs-with-professional-CAD-tools-by-/  (This was mostly written for homemade boards.  However, I still think it's mostly still true even for professionally manufactured boards.  It makes them sturdier, easier to assemble, easier to fix, etc.)

On the left, the vertical topside traces are VERY close to the pads of the buttons; move them further away.

Avoid the 90 degree turns in the signals from d12 and d11, and the acute angle in the 5V trace at the bottom.

On the right, the trace from D4 seems needlessly convoluted.  If it were on the top, couldn't it go straight down and not need to pass between any pins?  And there are more 90degree bends.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6935
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks mowcius, westfw.

Updates:

I used 8mil trace as suggested by sparkfun's tutorials. They say their fab house uses 8mil (is 8mil a bit too thin?) Should I use 50mil?

Board:



Schematic:

« Last Edit: June 19, 2010, 08:08:18 pm by liuzengqiang » Logged


Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Since this is a very sparse layout I would use 12 mils for signal. The 8mil trace
sounds like it is the manufacturers capability for a specific process. The more
margin you have the less likely you are to have problems. For a dense board
you would need to re-evaluate the trace sizes.

I would size power traces based on the voltage drop and temperature rise. Unless you had currents above a few hundred mils I would just use 20-25mil power traces. There are trace size calculators on-line.

One thing you may want to consider is the way you are routing the traces across the
board. If you ever want to add circuitry to the large open area in the middle you
would need to re-route. If the traces were grouped tighter additions would be
easier.

If you use the internal pull-ups on the digital input pins and have the pushbuttons
pull the pin to ground you could remove the three pulldown resistors.
I usually debounce the pushbuttons in hardware but this would add a fair amount
of parts to a sparse board.

(* jcl *)


Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6935
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks jluciani,

I didn't know about the pull-up resistors in arduino. You helped me understing arduino more. Now I've removed the resistors and tested the pull-up resistor settings on my breadboard version. Here's the new board now.



Schematic:

Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 65
Posts: 6935
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks everyone for great suggestions! I've uploaded my board file to www.batchpcb.com and will report back when I get the board and test it!
Logged


Pages: [1]   Go Up
Jump to: