Author Topic: Question: Common beginner's mistakes in PCB design (NOT for manufacturing)  (Read 9838 times)

0 Members and 1 Guest are viewing this topic.

Offline pawTopic starter

  • Contributor
  • Posts: 23
  • Country: pl
I'm at the point when I feel human/expert input is necessary for me to improve my ways & understand my mistakes better. I do learn in the process and I find it very rewarding but there is plenty of things I don't even realise I don't know (yet). So I would like to ask for pointers. I'm not expecting too much. On another forum someone suggested I find another hobby after seeing this pcb. But I don't think I will so...

Background:

This is a remote temp/humidity/light (pressure later) sensor board talking to the home server over the NRF24.

The goals are:
- multi month operation from CR2032 or 1xAA. Currently going for CR2032.
- indoor & outdoor (will be shaded and covered from atmospheric conditions)

There are:
- DHT11 for humidity (want to get rid of it as it's extremely slow but have a bunch of these so...)
- TMP302x (in place of DS18B20 which again was extremely slow)
- BPW34 photodiode for light measurement (although it's too sensitive right now will consider photoresistor etc)
- MCP1640 boost converter (I'm very impressed with it) providing 3.3V supply
- Atmega328p @ 8MHz external

Question:

I'm attaching one of my very first boards (this particular version has just been updated and has not materialised/been tested yet although couple versions of it were tested in the field).

Given that this is (will remain for now) a single sided PCB (home made) what are the:

1. Primary and unforgivable (you'd be lucky if it even worked) kind of mistakes I made?
2. What are the main improvements? The responsible things like decoupling, avoiding ground loops/single current return paths etc.
3. The switching frequency of the boost converter is 550kHz should I worry?

Ideally I wouldn't like to focus on my goals as I believe them to be sane.

Again I would be very grateful for any comments & suggestions.

Kind regards!

P.S. I'm not building a product. I'm learning electronics 101!


Edit:
Not to confuse anyone the two peripheral ICs are indeed powered from the micro as they draw couple of mA only.
« Last Edit: July 18, 2015, 11:04:05 pm by paw »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
On single sided boards with MCUs or other fast logic, wire links are vastly preferable to 'spagetti' power or ground tracks.

Home made PCBs etched with anything except air regenerated cupric chloride cost you more, the more copper you remove by wearing out your etchant.  Leave as much as possible of the board filled with copper connected to the ground track, save money and improve signal integrity.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Schematic / circuit diagram?

It should be easy to make a photodiode circuit less sensitive.

You mention mA, months and CR2032. You might like to check they are all compatible, and to very seriously power down most the circuit for most of the time.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 28141
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Welcome to the forum.

Clearances.
Layout of components for achievable soldering/rework. Think of order of population, always passives first when hand soldering.
330R, rotate 90 and move away from IC, that sort of stuff.  ;)
Power traces should be wider.
Label GND and VCC.

Print it on paper for physical checks.
Be prepared to spend real time on it, days even, you'll learn lots.  :-+

Search for more ideas and advice in these boards:
https://www.eevblog.com/forum/projects/
https://www.eevblog.com/forum/eda/


Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Rather than the bulky DHT sensor  plus the TMP have you considered the Sensirion combined temp and hum sensors SHT11/15   and SHT71/75 which have a much lower current, greater accuracy and small footprint ?
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
What Ian said plus:

- Make power tracks bigger and tracks that run between pads smaller (nothing worse, than sorting tracks under an IC during soldering - you'll never find the error)
- Decoupling is very important with spaghetti layouts, seems you've got that down
- Try for your labels not to be in the way, and have a common direction with labels
- Don't have 90 degree T-junctions (e.g. in the lower right corner), better:
« Last Edit: July 18, 2015, 11:40:52 pm by con-f-use »
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2074
Don't assume it's going to work! Make provision for test points that you can easily probe - especially when using surface mount components. And include a ground connection point where you can easily attach the ground lead (crocodile clip) of your measuring equipment.
 

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: ca
I am not a person to give advice as I am not I an experienced PCB designer, however this is the internets so I can pretend,  ;D

Some macro scale considerations, mounting holes!. Beginners always forget this! why!
Put connectors  all on one board edge or on two opposite edges (flow through design) depending on circuit. not hodge-podge random distribution.
check clearance  on the atmega pads, might want to increase it.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Print the net list and verify it carefully pad by pad. Mark on the schematic the nets you covered, look for missing or extra connections.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
+1 for mounting holes.

Arranging connectors nicely may make the spagetti layout problem much worse on single sided boards. Sometimes you have to compromise.

There is an intermediate step for DIY boards between single sided and full double sided.   Its single sided layout + continuous ground plane on the top side.   Spray one side of a double sided PCB blank with lacquer to protect it against the etchant, process the other side normally, then after drilling the board, use a Vero spot face cutter or similar to relieve the ground plane copper round any holes that don't need a ground connection.  Solder ground pins both sides or solder a cutoff of wire through the board if you need a via to ground for a SMD part.   It avoids all the alignment issues of a DIY conventional double sided board while permitting a ground plane adequate for VHF signals and fast MCUs. Obviously it is preferable to use mostly SMD parts so you don't have to relieve the ground plane on too many signal holes.  The only major disadvantage is you cant use bare wire jumpers.
« Last Edit: July 19, 2015, 01:11:39 am by Ian.M »
 

Offline pawTopic starter

  • Contributor
  • Posts: 23
  • Country: pl
Thank you all very much.

tggzzz:
Currently this runs at 8sec sleep (6uA) and 2sec full blast (8mA). Which gives about 4:1. It is going to run at 15 min (900000ms) sleep and 100ms awake which gives 9000:1 ratio. If it only improves by a factor of 100 I will be happy with the battery life. Most of the things drawing power are already powered by the micro (and only for minimum time required for readout). Worst case scenario I'll move to single AA.

tautech: Thank you!

picandmix: I've seen some of these and more but it seems humidity is always expensive or slow. In case of Sensirion it's the former at up to 2x the cost of all the other components combined.

con-f-use: Is this because they cause reflections? That T junction you showed. If it's the right way then why. Just a keyword please I'll look it up and read up.

Andy Watson: Thank you.

chickenHeadKnob: Those pesky beginners! I genuinely did forget the mounting holes which I do need. Connections are where my limited brain can route them to. I definitely appreciate the reasoning for them being placed together and possibly forming standard connectors too. I wondered about the pad sizes as they seem bigger than the pins and could be smaller and even though I haven't had bridges even without solder mask I'll see if I could reduce their size. I'm going to challenge myself with a batch of qfn atmegas (in the post) though before I go and do tqfp device from scratch in Eagle (only did sot23-6 so far and really looking forward to possibly doing atmega :) ).

Ian.M: Just what I thought. If not for the NRF24 (8pin) header I would have just gotten rid of all TH parts and did that. But since I actually am only now left with very few (actually less than on the design I posted) I will try your suggestion. The one downside is that I don't have double-sided presensitised boards. I do have double sided copper clad boards and Positiv 20 spray but I found that using presensitised boards cuts down the time (no drying) and increases the yield no redo due to specs of dust etc. I may get some double-sided presensitised boards though and move to double sided permanently. I would do that before ordering first board form the fab at some point anyway so perhaps now is the time. The wires running on my PCB gives me shivers (just as some of my silly mistakes make give some of you shivers).

Thank you all for a warm welcome and honest suggestions.
« Last Edit: July 19, 2015, 01:27:47 am by paw »
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
con-f-use: Is this because they cause reflections? That T junction you showed. If it's the right way then why. Just a keyword please I'll look it up and read up.

That chamfered T might have better high frequency properties, but when I say "high" frequency I mean high. The usual reason it's done is that it supposedly increases manufacturing yield (keyword: "acid trap"), but this does not appear to be a major concern except at very high production quantities where that tiny fraction of a percent yield becomes tangible... I have yet to do this on a PCB, and I have yet to have a problem from not doing it.
No longer active here - try the IRC channel if you just can't be without me :)
 

kc3ase

  • Guest
Okay now I have access!  :-DD
I see some things in what I think is your EAGLE design. And I'll post them next.
 

kc3ase

  • Guest
1) When your PCB is done measure your current to get you battery drain current. You can calculate this with some of Dave's other videos or ask how to get mAh.
2) The forth (what I think is a cap) on the bottom doesn't appear connected to anything on the left side. Use EAGLE's DRC and ERC they work very well.
3) The ATMEGA8 pad layout doesn't appear to be correct to me. The separation between pins in your image for the bypass cap on the left side appears blended and shorted.
4) The multiple traces from the battery negative should be a big pour in the PCB. Use a poly in EAGLE to connect this.
5) Even if you aren't doing a silk screen don't let the images overlap.
6) You have two different pad types on the anode and cathode of a diode.
7) The 100 uF main bypass is probably overkill.
8) I'm not sure why there is a pad and through hole just above the main IC.
9) The silkscreen should always contain the part numbers, R1, C1, etc. Even if you won't use a silkscreen. This is also necessary for design reviews and just to get in practice for it later. And then use the EAGLE renumber board feature to set the numbers after laying out the board on the X - Y axis.
10) The copper circle under the ATMEGA8 seems unnecessary.

Recommendations:
1) Use a two layer PCB. Even if done at home. Positive resist PCBs are cheap to buy and the small fish tank plastic etching kits with Sodium etchant work really well. I have used Ever-Muse boards I'm not sure if they are still made under this name. It's easy to line up the photo images even double sided and there are probably tons of videos.



« Last Edit: July 19, 2015, 02:26:28 am by kc3ase »
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Pour ground around everything, and stitch it as much as possible.  Especially if you're doing single sided.  Use jumpers liberally!

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
con-f-use: Is this because they cause reflections? That T junction you showed. If it's the right way then why. Just a keyword please I'll look it up and read up.

It's just icing on the cake not 100% necessary. The keywords here are under etching and corrosion. It's the same reason you shouldn'd have 90 deg turns but rather 45 (as you do). The 90 deg angles are the first to go when your copper corrodes and the first do be etched away if your etchant is too warm, too strong or you leave the board in it too long. Also it looks nicer ;-)

There is an intermediate step for DIY boards between single sided and full double sided.   Its single sided layout + continuous ground plane on the other side.
I was going to suggest that, then I forgot. It's really easy too do and makes a lot of the spaghetti traces go away. If you have through hole stuff with this kind of "ghetto ground plane" and are worried about one leg making contact with the ground plane, get a track cutter. They go for two or three dollar on ebay. You drill holes as usual, flip the board to the ground plane side and use the track cutter to remove a bit of copper around the holes that you are worried about.
« Last Edit: July 19, 2015, 08:59:01 am by con-f-use »
 

Offline Dago

  • Frequent Contributor
  • **
  • Posts: 659
  • Country: fi
    • Electronics blog about whatever I happen to build!
With a quick calculation assuming a 200 mAh CR2032 (assuminging you can drain it fully, which is most likely not quite true), 100 ms wake time and a draw of 8 mA 96 times a day (every 15 minutes) the battery will last slightly over 390 days. So accounting for other factors like sleep mode consumption and not perfect efficiency I'd assume a single CR2032 will last 6-8 months or so.

Remember to have a capacitor in parallel with the CR2032, they tend to have very high impedance and can only supply maybe tens of milliamps before the voltage really goes down.
Come and check my projects at http://www.dgkelectronics.com ! I also tweet as https://twitter.com/DGKelectronics
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
7) The 100 uF main bypass is probably overkill.
9) The silkscreen should always contain the part numbers, R1, C1, etc. Even if you won't use a silkscreen. This is also necessary for design reviews and just to get in practice for it later. And then use the EAGLE renumber board feature to set the numbers after laying out the board on the X - Y axis.
10) The copper circle under the ATMEGA8 seems unnecessary.

10 or even 1uF should be sufficient in most desings. Any more will cause too much inrush, which can be a problem especially with home-made USB devices. But since this  using a coin cell for power with has a large internal resistance, 100uF might not be that bad. However remember, that larger valued capacitors as a rule of thumb have higher leakage currents. And good silk screen with component names and values helps you when populating your board, even if you don't but it on the final board. Especially when you revisit a design in a year and have no idea about the layout anymore. The copper circle is for knowing the orientation.
« Last Edit: July 19, 2015, 09:07:34 am by con-f-use »
 

Offline pawTopic starter

  • Contributor
  • Posts: 23
  • Country: pl
Since the 100uF draws attention let me explain. This is a decoupling cap for the nRF24l01+. That board basically does not work properly until 100uF is placed there. I am talking about the whole market of these boards not my particular batch.

kc3ase:
1. Sure, the numbers I provided come from this but yes there of course is more i.e. boost's draw etc.
2. It only appears so. I do use DRC and ERC. It is connected if you follow the path the on the other side of the micro.
3. I'm not certain what to say. I don't see that.
4. Changing my single sided ways so this won't be a problem much more
5. Will work on my silkscreen
6. I guess this is how you indicate cathode/anode. It's not my component but I thought it was ok. So it's not and should be done in silk screen?
7. 100uF is a necessary bypass for the radio.
8. I think you may be referring to a single pin header connected to the reset pin pulled hight by a 10k.
9. Will work on my silkscreen
10. Poor man's silk screen thingy as con-f-use correctly inferred.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4208
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
You've routed your GND net as a trace instead of using a solid plane. To a good first approximation, this is *always* a mistake.

Please, save yourself a whole world of grief, and use a double sided PCB, with GND on the back and components on the top. Debugging boards which don't work because of poor grounding is a slow, painful exercise. It's very hard to diagnose grounding problems unless you have the proper equipment and a great deal of experience, and in any case, they're also hard to fix with any kind of retro-fitted kludges. It's not even a good learning exercise to try.

Whenever I route a PCB, the rule-of-thumb I follow is that if a power or ground trace is longer than the component pad to which it connects, then it's worth trying to shorten it.

There's quite a good discussion on power supply noise, planes, decoupling and vias here.

kc3ase

  • Guest
2) The forth (what I think is a cap) on the bottom doesn't appear connected to anything on the left side. Use EAGLE's DRC and ERC they work very well.
ANS: 2. It only appears so. I do use DRC and ERC. It is connected if you follow the path the on the other side of the micro.

I looked again, I  don't see it connected to anything.


3) The ATMEGA8 pad layout doesn't appear to be correct to me. The separation between pins in your image for the bypass cap on the left side appears blended and shorted.
ANS: 3. I'm not certain what to say. I don't see that.

The distance between your pins on the Y axis appears incorrect. The gaps between the top pins are different as they go down the rows. The capacitor connected on the left side seems shorted across because of the pin connections under the main chip.

4) The multiple traces from the battery negative should be a big pour in the PCB. Use a poly in EAGLE to connect this.
ANS: 4. Changing my single sided ways so this won't be a problem much more

5) Even if you aren't doing a silk screen don't let the images overlap.
ANS: 5. Will work on my silkscreen

6) You have two different pad types on the anode and cathode of a diode.
ANS: 6. I guess this is how you indicate cathode/anode. It's not my component but I thought it was ok. So it's not and should be done in silk screen?

7) The 100 uF main bypass is probably overkill.
ANS: 7. 100uF is a necessary bypass for the radio.

8) I'm not sure why there is a pad and through hole just above the main IC.
ANS: 8. I think you may be referring to a single pin header connected to the reset pin pulled hight by a 10k.

9) The silkscreen should always contain the part numbers, R1, C1, etc. Even if you won't use a silkscreen. This is also necessary for design reviews and just to get in practice for it later. And then use the EAGLE renumber board feature to set the numbers after laying out the board on the X - Y axis.
ANS: 9. Will work on my silkscreen

10) The copper circle under the ATMEGA8 seems unnecessary.
ANS: 10. Poor man's silk screen thingy as con-f-use correctly inferred.


In the future please try to quote back responses with your answers like I have shown. It makes it easier for people reading this to always have the result response on the current posting.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
When routing power, I like to lay down sections (or individual IC's) segmented by 0-ohm resistors.  That way If I have any problems with the board, i.e. (excessive current draw or unknown source of noise) I can simply de-solder a 0-ohm resistor and power off a complete section (or individual IC) for analysis.

The 0-ohm pad also makes a good place to measure current going into that section (or IC)

If you get a chance to re-spin the board then you can remove these once you're satisfied they are not needed anymore, or you can just leave them in, as they don't cost much anyways. Whether or not to do that depends on how cost-sensitive you are.

 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 2681
  • Country: de
The ATMega Footprint looks like it was made for some sort of high power QFP chip, something with double pins and a disipation surface on the bottom. The hole under the IC was probably a via to take the heat to the other side. The left and right centre pins definitely look shorted.

@kc3ase: Can you upload a picture highlighting the cap you say isn't connected? I've been staring at the picture too long and I can't see it.

McBryce.
30 Years making cars more difficult to repair.
 

Offline pawTopic starter

  • Contributor
  • Posts: 23
  • Country: pl
2) The forth (what I think is a cap) on the bottom doesn't appear connected to anything on the left side. Use EAGLE's DRC and ERC they work very well.
ANS: 2. It only appears so. I do use DRC and ERC. It is connected if you follow the path the on the other side of the micro.

I looked again, I  don't see it connected to anything.


3) The ATMEGA8 pad layout doesn't appear to be correct to me. The separation between pins in your image for the bypass cap on the left side appears blended and shorted.
ANS: 3. I'm not certain what to say. I don't see that.

The distance between your pins on the Y axis appears incorrect. The gaps between the top pins are different as they go down the rows. The capacitor connected on the left side seems shorted across because of the pin connections under the main chip.

4) The multiple traces from the battery negative should be a big pour in the PCB. Use a poly in EAGLE to connect this.
ANS: 4. Changing my single sided ways so this won't be a problem much more

5) Even if you aren't doing a silk screen don't let the images overlap.
ANS: 5. Will work on my silkscreen

6) You have two different pad types on the anode and cathode of a diode.
ANS: 6. I guess this is how you indicate cathode/anode. It's not my component but I thought it was ok. So it's not and should be done in silk screen?

7) The 100 uF main bypass is probably overkill.
ANS: 7. 100uF is a necessary bypass for the radio.

8) I'm not sure why there is a pad and through hole just above the main IC.
ANS: 8. I think you may be referring to a single pin header connected to the reset pin pulled hight by a 10k.

9) The silkscreen should always contain the part numbers, R1, C1, etc. Even if you won't use a silkscreen. This is also necessary for design reviews and just to get in practice for it later. And then use the EAGLE renumber board feature to set the numbers after laying out the board on the X - Y axis.
ANS: 9. Will work on my silkscreen

10) The copper circle under the ATMEGA8 seems unnecessary.
ANS: 10. Poor man's silk screen thingy as con-f-use correctly inferred.


In the future please try to quote back responses with your answers like I have shown. It makes it easier for people reading this to always have the result response on the current posting.

I'm sorry I don't know what you mean about the distance of the pads. Not sure what to say.

Which cap do you think is shorted? C2? C6? None of them is. I'm confused. Sorry. Please explain if you still think something is shorted.
 

Offline McBryce

  • Super Contributor
  • ***
  • Posts: 2681
  • Country: de
Ok, now the ATMega pads look fine. The pictures in your original post have possibly been over compressed. Take a look at the screenshots, the pads join there.

McBryce.
30 Years making cars more difficult to repair.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf