Fixing My DIY Arduino PCB Design Mistakes After 3 Years

About three years ago, I built and manufactured a DIY Arduino board with a custom PCB design. I created the schematic and PCB layout myself and had it fabricated by NextPCB. They were generous enough to manufacture and provide the board free of charge.

diy Arduino PCB board

After receiving it, I assembled the components onto the board, but unfortunately, it didn’t work. That was disappointing, and despite my efforts, I couldn’t identify the fault. I had always wanted to figure out what went wrong, but between being busy and uncertain whether repair was even possible, I left it aside. At the time, everything looked fine to me, yet the problem remained hidden.

This week, I finally had the chance to revisit the board. I investigated thoroughly, discovered the issues, and repaired it. Now, it works perfectly. 

diy arduino board design working

The problems were in my design—I had made a couple of mistakes in the schematic. NextPCB had manufactured the board exactly as I had designed and submitted the files, so the errors were entirely on my end. Actually, NexPCB did a fantastic job. Their tools were easy to use, process of uploading pcb design files, finding possible layout error was also fantastic. The NextPCB DFM tool, better known as HQDFM, is a free online Gerber viewer and Design for Manufacture (DFM) tool that helps analyze PCB production files. You can also download the HQDFM tool for free.

DIY Arduino

Actually, this time around, it did not take long to find and solve the problems on the PCB board. I began troubleshooting by checking all the pins of the ATmega328P to the headers with a continuity checker. There was nothing wrong with the connection between the IC pins to the header pins. This was a bit of a relief, but at the same time it was also scary since the problem could be far more serious, possibly beyond repair. I think I did this continuity check back when I first realized the board was not working.

There were several mistakes in my circuit and PCB design, and I wanted to record here my hands on experience repairing the board. The main problem was the power supply connection to the Vcc pin, incorrect use of one of the resistor value, used a capacitor which was not needed at all, connection to the Vref pin. 

diy arduino schematic diagram

I will break the problem and explain individually how I repaired them. 

1. Reset Pin 1 direct connection to Vcc pin 7

This was one of the main blunders. I connected the reset pin 1 directly to the Vcc pin 7. This was a fatal connection. The $V_{CC}$ pin 7 is connected to power supply +5V via the $R_1$ $10 k\Omega$ resistor. That is the $R_1$ $10 k\Omega$ resistor is sitting between the $V_{CC}$ pin 7 and +5V power supply. This is shown in the circuit schematic and on the PCB layout.

reset pin 1 connected to Vcc pin 7 Schematic and PCB layout view

The fix:

To remedy this, I had to physically cutoff the trace between the reset pin 1 and $V_{CC}$ pin 7. 

trace removed

2. AVCC pin 20 was left unconnected.

Another blunder was that the $AV_{CC}$ pin 20 was left unconnected. It was just routed to the header pin as shown in the picture below. The thing is even if we aren't using the ADC, $AV_{CC}$ must be powered for the chip to function reliably. The ATmega328P uses this pin to power the internal ADC and some of the Port C I/O. If left floating, I might get erratic behavior on those pins.

AVCC pin 20 unconnected

The Fix: 

I solved this by connecting the ($AV_{CC}$) pin 20 to $V_{CC}$ pin. That is, I added a small jumper wire between Pin 7 ($V_{CC}$) and Pin 20 ($AV_{CC}$).

VCC pin 7 connected to AVCC pin 20

After solving the pin 1 $V_{CC}$ problem and the connection to $AV_{CC} pin 20, I soldered a jumper wire from their junction to the +5V power rail.

pin1 and pin 20 connected to power rail

3. Capacitor removed

A $0.1 \mu F$ capacitor ($C_6$) was connected from one end of the $R_3$ $10 k\Omega$ pullup resistor to the header pin. In Arduino-compatible designs, a $0.1\mu F$ capacitor is used for Auto-Reset.

capacitor problem

The Fix

$C_6$ was removed from that position. Perhaps at the time when I made the circuit it was intended for DTR/Auto-Reset (for programming via USB-to-Serial). It should sit between an external "DTR" pin and Pin 1 if that were the case. But for now, I just cut off the capacitor as I was more interested in running the board and so I simply bridged or joined its legs as shown in the picture below.

removing capacitor

4. AREF Cap: 

I came to know that while it is not strictly "critical" for the chip to boot, adding a $0.1\mu\text{F}$ cap on Pin 21 to Ground is standard practice to keep your analog readings stable. So, I connected one as shown in the picture below.

capacitor added to AREF to GND

5. The Resistor $R_2$ value 

When I measured the voltage at the output of the LM317 voltage regulator and at the reset pin 1 of the ATmega328P IC, I got 5.6V. In my original design, I used 3.3 $k \Omega$ resistor for $R_2$. I had used LM317 voltage regulator (I know there are better IC for this) and the output voltage was set by the $R_1$ and $R_2$ resistors value. 

resistor problem
Since I used $R_1 = 1\text{k}\Omega$ and $R_2 = 3.3\text{k}\Omega$, the math for a LM317 adjustable regulator is:
$$V_{out} = 1.25 \times \left(1 + \frac{3300}{1000}\right) = 5.375\text{V}$$


When one adds in the Adjustment Pin Current (usually about $50\mu\text{A}$ to $100\mu\text{A}$) that flows through $R_2$, the voltage climbs even further. On the board, that current adds roughly another $0.2\text{V}$ to $0.3\text{V}$:

$$5.375\text{V} + (100\mu\text{A} \times 3300\Omega) \approx \mathbf{5.7\text{V}}$$

The Fix: 

I replaced the $3.3\text{k}\Omega$ resistor with a $2.7\text{k}\Omega$ resistor. Using  $ R_1=1\text{k}\Omega$ and  $R_2=2.7\text{k}\Omega$ I got roughly $4.8\text{V}$, which is perfect.

So, these are the fixes I made. Below is picture that shows the bottom side of the PCB board where I made the various changes.

repaired diy arduino board

The board size is comparable to the standard Arduino Uno as shown in the picture below.

diy arduino and standard arduino board size compared

I inserted a pre-programmed Atmega328P programmed to blink a LED connected to PD2 pin to test the board. As soon as I inserted the chip into the IC holder, it turned on and started blinking. This was a big relief for me. Since I have 5 or more of these boards, I can now reuse them in various projects.

I recorded all the repair work, soldering and what not if you wish to know how I did that.


Special thanks to NextPCB for the excellent PCB board and the support. I highly recommend their HQDFM tool which is a free online Gerber viewer and Design for Manufacture (DFM) tool that helps analyze PCB production files. 

Post a Comment

Previous Post Next Post