never connect components when there is power!
Step 1: The Microcontroller
Gently insert the ATmega328P into the breadboard so
that it straddles the center separator. Place it so as to keep
the board nice and compact. You’ll probably need to
bend the pins slightly inward as they’re normally angled
just too wide to fit easily into the breadboard. I place the
chip on its side on my anti-static mat, and gently bend
them in with a short ruler to keep them aligned.
If you prefer, you can use a ZIFF socket to allow for
easy removal and re-insertion. Personally, I don’t like this
option as the pins in the socket don’t always line up nicely
with the breadboard pins. Most ICs have a notch in the
center of one end and/or a dot/triangular marking at one
of the pins — this helps to orient the chip correctly. Pin 1
is always the pin to the left of the notch, or the pin
indicated by a dot. If in doubt, check the pin diagrams on
the first few pages of the datasheet.
Step 2: Connect the Power
With reference to the datasheet to help in identifying
the pins on the microcontroller, connect the MCU pins to
the power rails on the breadboard as in Figure 7.
Step 3: Connect the Crystal
The Uno has an external 16 MHz crystal to set the
speed of the microcontroller. We’ll therefore
connect one to the microcontroller — we need to
connect it to pins 9 and 10.
If you’ve been brave enough, you may have
looked at the ATmega328P datasheet (a
whopping 567 pages long). I often opened it,
skimmed through it, and then closed it in terror.
Slowly, I became more comfortable with it, and
eventually even started to find it useful.
Once of the things the datasheet states is that
the crystal needs to have capacitors connected
between the crystal pins and ground. Figure 8
shows that the recommended range is 12-22 pF —
I had some 22 pF ceramic capacitors lying
around, so I used those.
Step 4: Stop the Reset
Pin 1 of the ATmega328P is labelled RESET.
The line above the pin name means that it is “active low”
— in other words, the microcontroller will be in a reset
state when the pin is low.
We really don’t want the microcontroller to spend its
time in reset — it doesn’t do anything in this state.
Therefore, we need to tie this pin high (to +5V). We could
just use a jumper here to connect it to the +ve power rail,
but that will interfere with our efforts to program it later.
For now, we need to use a resistor to connect it to the
+ve rail; I used a 10K resistor successfully.
Almost There
We’re nearly done. Figure 9 shows the
microcontroller we’ve built that is able to function on a
March 2015 41
FIGURE 8. Crystal connection specifications from
the ATmega328P datasheet.
FIGURE 9. An Arduino on a breadboard.
Microcontroller Pin Pin Function Connect to Breadboard Rail
Pin 7 VCC +ve rail
Pin 20 AVCC +ve rail
Pin 21 AREF +ve rail
Pin 8 GND GND rail
Pin 22 GND GND rail
Figure 7. Power connections for the ATmega328P.