I have been trying to make a watch for the past few months, but all my prototypes have been unsuccessful.

So, to try ironing out some problems, I made a practice PCB to try testing my base Atmega32u4 system. It has a CR2032 battery with a boost converter to 3.3V and an LDO to drop 5 V to 3.3 V. It has a basic ATMEGA32U4 circuit with some pins to control and an LED to indicate power.

However, this circuit didn't work and I am entirely lost on where to go. I am wondering if anyone here would be willing to help me figure out what is wrong with my PCB.

Thanks in advance!

BOM: https://drive.google.com/file/d/1pEHvOWhBokQecm0XZuEtKeW-RIPA1_cn/view?usp=sharing



Whole PCB

Top Layer PCB:

Top layer

Bottom Layer PCB:

Bottom Layer

  • \$\begingroup\$ does it work on a breadboard? \$\endgroup\$
    – jsotola
    Commented Jun 15, 2021 at 16:07
  • \$\begingroup\$ I couldn't test it on a breadboard because most of the components are SMD only. \$\endgroup\$
    – user29946
    Commented Jun 15, 2021 at 16:13
  • 2
    \$\begingroup\$ Where are the decoupling capacitors? \$\endgroup\$
    – asdfex
    Commented Jun 15, 2021 at 16:19
  • 2
    \$\begingroup\$ Just a side note: at least for me, the schematic is hard to read since you are not following common conventions like positioning Vcc at the top, GND at the bottom or signal flow from input on the left to output on the right. If you want to improve the readability of your schematics, check out electronics.stackexchange.com/questions/28251/… \$\endgroup\$ Commented Jun 15, 2021 at 16:56
  • \$\begingroup\$ Aren't C2, C1, C7, C10 decoupling capacitors? Also thanks for the guide will take the tips! \$\endgroup\$
    – user29946
    Commented Jun 15, 2021 at 16:56

4 Answers 4

  • vias don't cost a thing (at your scale). So, if you've got a pad that connects to your ground plane, simply put the via right next to it; don't have a long trace running to a via that goes to ground.
    • This also means you have less traces on the top layer, which might simplify routing as a whole.
  • you've rotated your Controller1 such that all the pads that connect to the top connector are at the bottom. Don't do that! The things on the other side are more flexible in layout. You probably don't even have to route them on the bottom.
    • things like SW1 are slow signals, so these can take a detour without a problem. Even routing them around both connectors might work.
  • J1's third pin connects to a trace that cuts the ground plane in half, thereby eliminating the advantages of a ground plane (namely, guaranteed return current paths directly beneath the topside conductors). That thing needs rerouting. Put it on the top side.
  • Your schematic is a bit bad: always let GND symbols point down, never sideways, never up.
  • I strongly recommend making the large pads on your USB connector part of a large ground plane - otherwise, they will very easily be ripped off. They are large for mechanical reasons!
  • \$\begingroup\$ Thanks I will take these all into mind when redesigning, but have you noticed anything that would ruin the functionality of the device as currently it won't even power on? \$\endgroup\$
    – user29946
    Commented Jun 15, 2021 at 16:58
  • \$\begingroup\$ yes, point 3 above \$\endgroup\$ Commented Jun 15, 2021 at 17:17
  • \$\begingroup\$ and probably grossly underdimensioned decoupling caps, but I didn't check the datasheet of your COntroller. \$\endgroup\$ Commented Jun 15, 2021 at 17:17
  • \$\begingroup\$ What does it mean to have undimensioned decoupler caps? Also ATMEGA32U4 is the controller. \$\endgroup\$
    – user29946
    Commented Jun 15, 2021 at 18:22
  • \$\begingroup\$ @user29946 He said underdimensioned, not undimensioned. \$\endgroup\$ Commented Jun 15, 2021 at 18:32

There are some issues with your circuit on the schematic already. Have a look at your switching regulator supply:

Schematic excerpt

The problem here is the load switch Q1. It is an N-channel MOSFET so it will be switched on when the gate-source voltage \$V_\mathrm{gs}\$ is significantly higher than the threshold voltage \$V_\mathrm{th}\$. Since the desired voltage at the source connection is about 3.6V and \$V_\mathrm{th}\$ of your MOSFET is about 3V, the gate voltage needs to be higher than 3.6V+3V=6.6V for the MOSFET to be somewhat switched on.

But what you actually intend is that Q1 is turned off, when the gate voltage is 5V and that it is turned on when the gate voltage is 0V. The easiest way to do this would be using a P-channel MOSFET with a low threshold voltage, let's say lower than 2V:


simulate this circuit – Schematic created using CircuitLab

Before doing any major changes, you could try to to test if your boost converter works by measuring the voltage across C7. If it is close to 3.3V-3.6V then it looks good for now. Then you could desolder Q1 and short the drain and source pads with a small wire and see if your LED lights up.

Another problem with your circuit is the lack of decoupling capacitors for the microcontroller. Each supply voltage pin of the controller should have its own decoupling capacitor close to the pin. Have a look at this design for example:

Example circuit

Source: AVRfreaks forum post

The VCC and AVCC pins all have their own \$0.1\mathrm{\mu F}\$ capacitor to GND and UVCC and VBUS have a \$1\mathrm{\mu F}\$ capacitor (the datasheet even says \$10\mathrm{\mu F}\$). You will need these close to each pin to make sure that the power for the microcontroller is stable enough.


The two connectors on top are quite close together. When you plug in the programming connector, there is a chance you won't be able to plug the other connector.

You should put some vias in the large USB connector pads, when you solder it these will fill with solder and anchor the connector to the board. Otherwise it will only be held by the adhesive between the copper and the PCB, and it could rip off the board.

The switching regulator is a bit weird. Since the power switch is on the output, the regulator will be on constantly even if the power switch is off, or if the USB port is connected, which will drain power from the battery needlessly.

The circuit with Q1 will not work since it's a NMOS BF170, it won't turn on in this position. Even if it did, it would turn on when 5V USB is present, which is probably the opposite of what you want. Besides if you put a diode in series, the FET is unnecessary. If you want to use the FET as a zero-threshold diode, then use a PMOS that is fully on with 3.3V Vgs, with the internal diode the correct way around (cathode to "VCC"). This way it will turn off when USB 5V is applied. Then D2 is redundant and can be removed.

If the DC-DC regulator has an internal output diode, the whole circuit is also probably unnecessary. You could instead use the 5-pin version of this switching regulator, which has an ENABLE pin. Then you can disable it when it is not needed.

Or you could put the power switch on the battery side, to be able to turn it off. You could put the power switch on the input of the regulator instead, and use a SPDT switch, to power it either from the battery, or from the output of the 3V6 LDO. This eliminates Q1/D2 and gives best efficiency when running on battery, which is what you want, and a slight loss of efficiency when running on USB.

With the current schematic the micro will get 3V6 minus one diode drop, so 3V, when running on USB. Can the internal USB work with that? You should check.

Another option would be removing the switching regulator, since this Atmega has a minimum supply voltage of 2.7V, it will run fine on a coin cell voltage. You could also use something a micro which works down to 1.8V.

The current in the LED is way too high, increase R6. You can power the LED from a micro's GPIO so you can turn it off to save battery.

The cap on AREF pin is suspicious, 100pF won't decouple anything. Shouldn't it go to GND?

Since the orientation of the micro is decided by the USB pins, it would be more convenient to move the programming connector.

There are no decoupling caps, and these are required.

Each decoupling cap needs a via to the ground plane. C3 and C7 share a via which means switching regulator noise will be coupled into the micro's internal USB power supply through pin UCAP.


As no one has mentioned it yet, follow Figure 1-1 in the AVR186: Best Practices for the PCB Layout of Oscillators. It gives this layout recommendation:

AVR186 1-1

Your layout has the caps behind unnecessarily long tracks, which adds inductivity and diminishes the effect of the caps. It may even introduce weird oscillation modes of the crystal.

Please place the caps between the µC and the crystal and keep the tracks as short and wide as possible. Keep the caps on the same side of the board as the µC. Also, use a guard ring (local ground plane) around the crystal which is connected to ground only by one single thick lead near the µC. Do not connect other GNDs to that ring.


Your Answer

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

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