Maker.io main logo

Build Your Own Arduino Breadboard

2016-03-28 | By Maker.io Staff

License: GNU Lesser General Public License Arduino

Overview

I’ve been tinkering with Arduino boards for many years and I always find myself wanting something more; something flexible in terms of my prototyping needs. I decided to build my very own Arduino using a breadboard and components; this allowed me to prototype my projects before taking the decision to embed them and develop a custom PCB design.

Parts

For this example, I used the Atmel™ ATmega328P AVR™ integrated chip; you can, of course, use other Atmel ICs with any DIP package configuration for use with a standard breadboard, such as ATmega® 8/168. Below is list of parts that are required to build the Arduino breadboard:

Building Your Circuit

For your reference, I have provided a schematic using Digi-Key Scheme-it, where you can also find the bill of materials used.

Arduino%20Breadboard%20Scheme-it

Adding Power to Your Circuit

First and foremost, you need to power your circuit. The best way to do this is using a standard 9V PP3 battery with a barrel jack adaptor as show in the below image or with a 9-12V DC power supply.

Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%201

Figure 1: 9V Battery with barrel jack adaptor

Unfortunately, the ATmega328P IC does not take any other voltage input than 5V, this means we need to use a 7805 5V power regulator. This regulator is a TO-220 package where the input power supply is provided on pin 1 (left leg), ground is pin 2 (middle leg) and finally the 5V output is provided on pin 3 (right leg). This particular regulator allows you to input a varying voltage between 7-16V which is ideal for 9V batteries.

  1. Insert the 5V regulator into the bottom of the breadboard, taking note of the orientation of the first pin.
  2. Add power output and ground wires from the regulator to the power rails on the breadboard.
  3. Insert a 100µF capacitor between pin 1 (input) and pin 2 (ground) on the regulator. If the capacitor is polarized, which means it will only work if connected to a circuit one way, the polarization can be determined by a small silver strip down the side of the capacitor which indicates ground.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%202

    Figure 2: Voltage regulator circuit

  4. Insert a red LED into the breadboard power rails on the opposite side to the regulator, in series with a 220ohm resistor. This LED will give you an indication if power is reaching the ATmega IC and ultimately an output from the 7805.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%203

    Figure 3: LED connected in series to the breadboard power rail

  5. To make sure that both sides of the breadboard’s power rails are connected you must insert two jumper wires between the positive and negative rails (figure 4).

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%204

    Figure 4: Connected the breadboards power rails in circuit

  6. Take the DC socket with screw terminals and screw in two jumper wires. Connect the positive jumper wire to pin 1 (input) on the regulator and the negative jumper wire to pin 2 (ground) on the regulator. This method allows you to easily unplug and swap the battery, if necessary, without unplugging all the jumper wires.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%205

    Figure 5: Connecting a screw terminal DC socket to the regulator

  7. Finally, test the circuit by connecting your power source to the DC socket; you should see the red LED light up if successful (figure 6)

Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%206

Figure 6: Power circuit connected

ATmega328 Circuit

Before you insert the ATmega328P IC, it would be wise to learn a little bit about what each of the pins do in relation to the Arduino functions. For further reading, please refer to the datasheet which can be found on the Digi-Key website.

  1. Insert the ATmega328P IC into the breadboard, making sure that either side of the IC has bridged the small gap in the middle of the breadboard, as shown in figure 7. Note: Pin 1 of the chip can be identified by a small circle next to it on the silicone.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%207

    Figure 7: ATmega328P IC inserted into the breadboard

  2. Now you need power to the ATmega IC so connect the following pins using jumper wires:
    1. Pin 7 – Positive Voltage
    2. Pin 8 – Ground
    3. Pin 22 – Ground
    4. Pin 21 – Positive Voltage
    5. Pin 20 – Positive Voltage

      Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%208

      Figure 8: Power connected to the ATmega IC

  3. Add a 16MHz crystal between pins 9 and 10 on the ATmega IC; also connect a 22pF capacitor from each of the crystal’s pins to ground rail. A crystal is used to provide clock input to the microprocessor. Note: The crystal and ceramic capacitors are not polarized which mean it doesn’t matter which way you insert them into the circuit.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%209

    Figure 9: Crystal and 22pF capacitors inserted into the breadboard

  4. Now add the momentary tactile switch to act as a reset button to restart the firmware. Insert the switch just above the ATmega IC making sure the two sets of pins are abridged; insert one jumper wire to the ground rail and to the first pin on the switch and the second jumper wire from the second pin below the first and into the row of pin 1 on the ATmega IC. Also insert a 10k resistor from the positive rail to the reset pin on the ATmega; refer to the schematic for reference.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2010

    Figure 10: Reset switch added to the circuit

  5. Finally add a green LED to digital pin 13 on the ATmega IC, which you can use to upload an example sketch and blink the LED.

Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2011

Figure 11: Green LED connected to pin 13

Bootloader

Before you upload any sketches to the ATmega IC first you must install something called a bootloader. A bootloader is a basic hexadecimal file that runs when you turn on the board. The bootloader is responsible for two things; first, it looks to see if a computer is trying to program it, if it is then it grabs that program and uploads it to the IC’s memory. Secondly, if nothing is trying to be uploaded then it runs the program which is already stored in the memory; this is why the program runs every time you switch on your Arduino.

There are a number of different ways in which we can install a bootloader to your ATmega IC, such as using a dedicated programming board such as SparkFun’s pocket AVR™ programmer (1568-1080-ND) or you can use an existing Arduino board.

In the following example I will be using the Digi-Key Metro board to install the bootloader and also to upload the first sketch example. There are four SPI pins which must be connected between the ATmega IC and the Metro board as shown in the table below:

Arduino as ISP

ATmega328P

MOSI/D11

MOSI/D11

MISO/D12

MISO/D12

SCK/D13

SCK/D13

D10

Reset

Go ahead and connect the Metro board to the Atmega328P IC on your breadboard.

Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2012

Figure 12: Metro board connected to the ATmega

  1. Plug in the power to your ATmega and then insert the USB cable from the Metro board to your computer.
  2. First, we need to setup the Metro board to act as an in-serial programmer (ISP). Open up the Arduino IDE software and open up the “Arduino ISP” example sketch. Select the Metro board from the list of Arduino boards and click the upload button. Once completed the Metro board can now act as an ISP.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2013

    Figure 13: Arduino ISP sketch

  3. To upload the bootloader, select the board settings for the board you want to program by navigating to Tools > Boards, which in our case is the ATmega328P IC. Select the option “Arduino Duemilanove or Diecimila”.

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2014

    Figure 14: Select the board option for the ATmega328P

  4. Select which processor of the ATmega IC you are using, Tools > Processor > 328.
  5. Select the method of programming to the ATmega®, Tools > Programmer > Arduino as ISP

    Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2015

    Figure 15: Selecting the Programming method

  6. Finally, select Tools > Burn Bootloader and the process of installing the bootloader will begin.

Uploading Blink Example

Now that the bootloader is on the ATmega IC, it is waiting for a program to run. The process of uploading a sketch to the ATmega IC is simple.

  1. Open the Blink example sketch in the Arduino IDE, File > Examples > 01 Basic > Blink
  2. To upload the sketch through the Metro board, ensure that the settings are the same as when you uploaded the bootloader:
    1. Board - Arduino Duemilanove or Diecimila
    2. Processor – 328
    3. Programmer – Arduino as ISP
  3. To upload simple click, File > Upload using Programmer

Build%20Your%20Own%20Arduino%20Breadboard%20-%20Figure%2016

Figure 16: Upload sketch using programmer in Arduino IDE

Once the sketch has been uploaded to the ATmega board, you can simply remove the Metro board and the jumper wires linking the two.

制造商零件编号 700-00078
BREADBOARD TERM STRIP 6.88X2.56"
Parallax Inc.
制造商零件编号 ATMEGA328P-PU
IC MCU 8BIT 32KB FLASH 28DIP
Microchip Technology
制造商零件编号 LM7805CT
IC REG LINEAR 5V 1A TO220-3
onsemi
制造商零件编号 SSL-LX3044GD
LED GREEN DIFFUSED T-1 T/H
Lumex Opto/Components Inc.
制造商零件编号 SSL-LX3044ID
LED RED DIFFUSED T-1 T/H
Lumex Opto/Components Inc.
制造商零件编号 CFR-25JB-52-220R
RES 220 OHM 5% 1/4W AXIAL
YAGEO
制造商零件编号 K220J15C0GF5TL2
CAP CER 22PF 50V C0G/NP0 RADIAL
Vishay Beyschlag/Draloric/BC Components
制造商零件编号 9B-16.000MAAJ-B
CRYSTAL 16.0000MHZ 18PF TH
TXC CORPORATION
制造商零件编号 35ZLH100MEFC6.3X11
CAP ALUM 100UF 20% 35V RADIAL TH
Rubycon
制造商零件编号 PTS645SK43-2 LFS
SWITCH TACTILE SPST-NO 0.05A 12V
C&K
制造商零件编号 658
AC/DC DESKTOP ADAPTER 5V 50W
Adafruit Industries LLC
制造商零件编号 368
ADAPT TERM BL 2POS TO 2.1MM JCK
Adafruit Industries LLC
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum