Month 2 Box - Hardware 101 w/Soldering, PCB Design & more

Lesson 7 – Building the DIY UNO (Part 1): Power Section & Foundations

Building the DIY UNO, Part 1: Power Section and Foundations

This is the start of the biggest build in the course: your own microcontroller board, from scratch, based on the open-source Uno design and the same ATmega328P chip a real Uno uses. In this first part you will confirm the chip works on a breadboard, learn the power section that turns raw input into a clean 5 volts, and solder that power circuit onto a perfboard. It is a three-lesson project, so take it one section at a time.

What a Uno-compatible board really is

A Uno board is not magic; it is a well-documented, open-source design built around the ATmega328P microcontroller and a handful of supporting parts. Because the schematic is public and the chip is the same, a board you solder yourself from those parts functions identically to a store-bought one. This project makes that concrete: you assemble the exact power section, clock, and chip circuit that a Uno uses, and end up with a board that runs the same code.

The power section, part by part

The power section's job is to take whatever you plug in and deliver a clean, steady 5 volts. The 7805 voltage regulator does the conversion, dropping a higher input such as 12 volts down to 5 volts. A 1N4007 diode sits at the input to protect against reverse polarity, so plugging power in backwards does not destroy the board. Electrolytic and ceramic capacitors on the regulator's input and output smooth out voltage spikes so the supply stays stable. An LED with a resistor acts as a power indicator so you can see at a glance that the board is on.

Test the chip before you solder

Soldering is hard to undo, so you verify the chip works on a breadboard first. The bare-bones circuit needs surprisingly little: the ATmega328P, a 16 MHz crystal oscillator on pins 9 and 10 for timing, two 22 pF capacitors from the oscillator legs to ground, a 100 nF capacitor and a 10k resistor on the reset pin (pin 1, marked by a dot), and an LED with a 220 ohm resistor for the blink. The crystal is the chip's heartbeat, providing the steady timing it needs to run and communicate.

Two ways to program a bare chip

A bare chip has no USB port, so you need a bridge to your computer. The first way is an FTDI module, which converts USB data to the serial data the chip understands; you connect its DTR line through the reset capacitor, RX to the chip's receive pin and TX to its transmit pin, plus power and ground, and set its jumper to 5 volts. The second way is to use another board as an ISP (in-system programmer): you load the ISP sketch onto that board, wire its pins to the chip's reset and its programming pins, and use Upload Using Programmer. Either way, you are getting your compiled code onto a chip that cannot receive it directly.

Working through it

Build the bare-bones test circuit. On a breadboard, place the ATmega328P (dot marks pin 1, the reset pin), put the 16 MHz crystal on pins 9 and 10 with a 22 pF capacitor from each leg to ground, add the 10k reset resistor and 100 nF capacitor on pin 1, and wire an LED with a 220 ohm resistor to pin 14 (digital pin 8).

Program the chip with an FTDI module. Set the module to 5V, connect DTR through the reset capacitor, RX to pin 2, TX to pin 3, and power and ground. Open the Blink example, change the LED pin to 8, select the Uno board, and upload. The LED should blink.

Or program it using another board as ISP. Load the ISP sketch onto the programmer board, wire its pins to the chip's reset and programming pins, select the board as ISP as the programmer, and use Upload Using Programmer. This proves the same code runs on your chip.

Build and verify the power supply. Wire the 7805 with electrolytic capacitors on its input and output, feed 12 volts into the input leg, and measure the output leg with the multimeter. It should read a stable 5 volts before you connect it to the power rail.

Confirm the chip runs on its own power. Remove the programmer and power the chip from the regulator. If the LED keeps blinking, the code is running from the chip itself and your power section works.

Solder the power section to the perfboard. Following the provided schematic, place interconnected parts side by side (DC jack, diode, regulator, capacitors, power LED), solder them, add a ground line, and continuity-test every connection before applying power.

Blink test for the bare chip (LED on pin 8)

const int ledPin = 8; // pin 14 of the ATmega328P is digital pin 8

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}