7
\$\begingroup\$

I'm trying to make my own wireless sensor using ATmega microcontroller. I've some basic understanding of electronics but I'm a total amateur when it comes to designing circuits and PCBs.

This is just a hobby project so it's not expected to be of a production quality or anything like that. But still I would like to make it as good as possible just for a good feeling of doing things right.

I've read something about decoupling, bypassing and grounding but not sure if I understand it correctly. So if someone could look at the board and point out things which should be done differently I would be really thankful.

enter image description here

enter image description here

Edit: added schematic of the circuit

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Your tracks going between header pins look a bit fat for the space. Is there enough clearance there? Do you really need them so fat? \$\endgroup\$
    – Majenko
    Oct 12, 2014 at 23:40
  • 1
    \$\begingroup\$ The status LED is just a regular 5mm LED or there's more connected to the STATUS_LED connector? If it's just the LED, 10K looks a bit too much for it. Maybe 470R to 1K would be better. \$\endgroup\$
    – Ricardo
    Oct 12, 2014 at 23:45
  • 1
    \$\begingroup\$ If you plan on etching the PCB yourself, do you intend to do through-hole plating? If not, you may have trouble soldering the component terminals on the top side of your board. \$\endgroup\$
    – Ricardo
    Oct 12, 2014 at 23:48
  • 2
    \$\begingroup\$ In general, dual-layer home-etched boards can be quite challenging, particularly for a first project. Maybe do a single-layer board first to get comfortable with the process? \$\endgroup\$ Oct 13, 2014 at 0:10
  • 1
    \$\begingroup\$ It's usually a good idea to make power traces thicker. \$\endgroup\$
    – miceuz
    Oct 13, 2014 at 12:27

2 Answers 2

17
\$\begingroup\$

Etching PCBs at home is fun, but the process makes PCB design a bit tricky for hobbyists like us. The most important constraint is that it's difficult to make plated through-holes. And those are essential for soldering components to double-sided boards like yours.

If you have your board made at a fab house, you'll get all of your PCB vias and holes plated like in the picture below. That's nice because you can then solder all components on the bottom of your board and be done with it. That's possible because all tracks on top will be linked to the bottom layer at the plated holes, thus ensuring continuity.

Plated-through hole

(Picture from RobotRoom.com)

If you don't master some kind of through-hole electroplating at home (a process that involves nasty chemicals), you won't get those holes plated. The end result is that you'll have to solder the component pads on the top of your board whenever there's a track reaching them.

Soldering on the top layer can be inconvenient at best, or just impossible, depending on the component and the PCB design. For example, headers are easy to access from the bottom, but they usually have a plastic support that gives them mechanical strength and that sits flush on top of the board. DIP sockets also brings problems as they sit flush on top as well.

Solder components on the top layer is usually a bad idea also because it hinders maintenance. You may assemble your board in an order that lets you access hard to reach pads, but when all the components are placed, you may be left without access to those pads. In my experience, because these pads are harder to reach, the soldering quality suffers and these pads end up being the first to fail.

To work around those problems, I suggest you do the following:

  1. Design single-sided boards whenever you can. Use your schematic as an exercise, for example. Try to place its components carefully so that they make single-sided routing easier and try and route all tracks that you can on the bottom layer. I usually change pin assignments if it makes routing easier. If you need to cross tracks, use plain jumpers (I usually use remains of through-hole components for that). I use the top layer to represent the jumpers. Also, plan to use resistors and capacitors as jumpers. I've done just that in the picture below, on ATmega328P pins 2 and 3 - serial TX & RX.

  2. If you can't make a single-sided board for some reason, make sure your tracks only change sides at vias, like in the places marked in orange in the picture below, and not at the component pads. You can then solder a piece of wire on both sides of your board on those vias. This will make for a much more robust solution than soldering at the components pads.

  3. Make the vias really large (I use 0.07 inch or ~1.8mm). If you follow rule #2 above and only make tracks change sides at vias, those large vias are the only features you'll have to match between both sides of your board. Large vias make the registration process of double-sided boards easier.

  4. I also try to stick to the 0.05 inch grid on Eagle, make only 45° turns and leave as much space as you can from tracks and pads of different signals.

Example of vias

Considering your design and the fact that you will etch it at home, and assuming that you can't make plated trough-holes, you'll have trouble with your oscillator crystal and all of your connectors. I would suggest you use the trick of bringing the track away from the pads into a via and then cross it over to the other side for those components.

You may get away with soldering the ceramic capacitors and resistors on the top layer, but I don't recommend that. I'd just re-route your board to try and bring most, if not all tracks to the bottom layer.

I don't know whether there are issues with the external components you plan to use (the NRF905 for example), but I would watch it if they use high-frequency signals for driving them (anything above 500kHz).

Below is my (quick and dirty) attempt at a single-sided version of your board. Pardon me if I made any mistakes, but it should give you an idea of how to try and route most of the tracks on the bottom layer. I had to use 5 jumpers, but you may be able to do better.

My attempt at a single-sided version of the OP's board

I now realize that my version of the 14-pin connector is mirrored in relation to yours, which made my version easier to route. But, if you don't have any software or hardware restriction, you may reassign the MCU pins to the connector so that it is easier to route your version as well.

I hope this helps.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Thanks a lot for taking the time to explain the issue very clearly. I was somewhat aware of the problem with the crystal and the headers. But obviously I wasn't paying enough attention to this. I was also interested in electrical aspect of the design. In case I would use some cheap chinese manufacturer to make the PCB for me are there some things I should really reconsider in my design? Since I don't have any tools and chemicals for PCB etching yet it could be just easier and cheaper to let them make it. \$\endgroup\$
    – loblik
    Oct 13, 2014 at 6:02
  • \$\begingroup\$ That can be done on one layer if you have enough clearance to send a trace between two pads. Looks like all of your layer changes can be removed with some needle-threading. \$\endgroup\$ Oct 13, 2014 at 6:03
  • \$\begingroup\$ I haven't yet sent a PCB to a fab house, so I could comment on that. It's on my list of things to do before I die :D So I cannot comment on that. But others may chime in and address these complementary aspects of your question. Just don't accept any answers for a few days so that people see that you're still looking for answers. If that doesn't work, post another related question. Just be aware that folks here don't usually welcome broad questions, so make sure you focus your next question on the specific aspects you want addressed. \$\endgroup\$
    – Ricardo
    Oct 13, 2014 at 12:10
  • 1
    \$\begingroup\$ It may be worth noting that a jumper which is soldered at two places may be nicer than a trace which connects two vias, each of which requires a piece of wire and two solder connections. On the other hand, using a ground plane for the top side (along with vias) might be good even if one uses discrete wires for all other top-side connections. \$\endgroup\$
    – supercat
    Oct 28, 2014 at 21:38
4
\$\begingroup\$

How did no one mention this yet?

Add decoupling capacitors!!

Your MCU will probably be running and switching lot's of transistors on and off (internally) at 8/16/20 MHz. It will pull higher current periodically on every clock cycle. Since traces have some inductance and can't deliver current instantaneously you should add a capacitor to supply those peaks of current for the MCU. This capacitor also shunts noise to ground.

It's very common to put a 0.1uF ceramic cap on each power pin of the MCU, as close to the MCU as possible. It's also common to put some some bulk capacitance nearby on the board.

Decoupling the RF module header you got there is probably redundant if the RF module has local decoupling on in (which I assume it will).

\$\endgroup\$
4
  • \$\begingroup\$ A thought the C5 is for decoupling, is there something I've missed? \$\endgroup\$
    – loblik
    Oct 13, 2014 at 8:31
  • 1
    \$\begingroup\$ Oops, I missed C5 since I have looked at the pcb silk screen and didn't see any caps. C5 is probably an electrolytic capacitor, right ? It could be used as the bulk capacitor but not the decoupling capacitor. Electrolytic capacitors have higher ESL and ESR comparing to ceramic capacitors, so they cant provide high current quickly. AVR MCUs are known to work even without decoupling caps, but it's good practice to put them anyways. \$\endgroup\$
    – Mike
    Oct 13, 2014 at 8:46
  • \$\begingroup\$ I thought I would use film PET capacitor. This is one of these I can get here gmelectronic.com/film-capacitor-cf-22n-250v-p121-011. Is it good for decoupling? \$\endgroup\$
    – loblik
    Oct 13, 2014 at 9:31
  • 2
    \$\begingroup\$ Notice it's a 22nF and uF capacitor. You already have one 100nF capacitor in the schematic, just use another one of those. In general film capacitors are good for decoupling. But ceramics are usually cheaper. \$\endgroup\$
    – Mike
    Oct 13, 2014 at 9:40

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.