Project: Stand-Alone Arduino on a Breadboard

This tutorial shows you how to build an Arduino on a breadboard

Build a fully functional "stand-alone" Arduino Uno on a breadboard and in the process learn a great deal about the Arduino hardware. The total cost of parts for the stand-alone circuit is about $10. These parts were purchased from Sparkfun.com but are commonly available for other Arduino suppliers. It is important that the ATmega328P IC is loaded with the Arduino Optiboot (Uno) bootloader which is necessary to load new programs on to the Arduino chip. The FTDI USB to Serial module provides the power source and connection to the Arduino IDE programing software.

Circuit Diagram


Bill of Materials (BOM):

You can order these parts from Sparkfun (www.sparkfun.com) or other web stores.

Qty Part Description Sparkfun Part #

1 ATmega328 with Arduino Optiboot (Uno) DEV-10524

1 Crystal 16 MHz COM-00536

2 22pf Ceramic Capacitor COM-08571

1 0.1uf Ceramic Capacitor COM-08375

1 FTDI; USB to TTL converter; 5 volt*

*Pay attention of your choice, it should have the same 6 pins as the one used here. Cheaper 5-pin versions do not have the CTS and required DTR pins.

Usually Available Locally

1 Red LED 5mm

1 Green LED 5mm

1 Yellow LED 5mm

3 470 ohm resistors ¼ w (200 ohm to 500 ohm resistors will work)

1 10k ohm resistor ¼ w

1 Push button

Existing Components

1 USB cable appropriate for the connector on the FTDI.

10-15 Breadboard wires

1 Breadboard


ATmega328P Processor

The ATmega168 and ATmega328 have the same layout. For this project we are using an ATmega328P in a dual-inline package (DIP). That means it is a chip with a row of pins on each side. The size and spacing of the pins is designed to fit the breadboard. The ATmega328P, provided, has a label on it with the Arduino pin names. The instructions below identify the pins by numbers. On a DIP, pins are numbered starting a 1 in the upper left and proceeding counter clockwise down the left, across the bottom, and up the right. The top of the DIP is identified by the notch cut in the center of the top edge.


Steps to Build Circuit

1.  Prepare your breadboard rail wiring for 5 volts and ground by cross connecting the right and left sides near the bottom of the breadboard. Caution: Do not apply power on the breadboard until circuit is complete.

2.  Wire the Red LED and a 470 ohm resistor across the 5 volt and ground rails near the bottom of the breadboard. This will give an indication of power present on the breadboard. One leg of the resistor connects to 5 volt. The other leg of the resistor connects to the long leg of the LED. The short leg of the LED connects to ground.

3.  Insert the push button near the top of the breadboard center ravine. Only on pair of pin will be used.

4.  Next to the push button, insert the FTDI so that each of the six pins is in separate rows, i.e. parallel to the side of the breadboard, facing left.

5.  Insert ATmega328 Chip across the breadboard center ravine. (Note the location of the indent marker on the pin 1, top, end of the chip). The top of the chip should be near to FTDI pin 6, GND. Leave two blank rows between the FTDI and the chip.

6.  Use breadboard wires to connect 5 volt rail to pins 7, 20, 21.

7.  Use wires to connect ground rail to pins 8, 22.

8.  Connect green LED and 470 Ohm resistor in series from pin 19. Pin 19 is the 5 volt source. Refer to the Red LED in step 2.

9.  Connect yellow LED and 470 Ohm resistor in series from pin 15. Pin 15 is the 5 volt source. Refer to the Red LED in step 2.

10.  Connect 22pf capacitor from pin 9 to ground.

11.  Connect 22pf capacitor from pin 10 to ground.

12.  Connect 16 MHz Crystal across pins 9 and 10.

13.  Connect pin 1 (reset) on the ATmega328 to one side of the push button. Connect the other side of the push button to ground.

14.  Connect pin 1 (reset) on the ATMega328 to one side of the 0.1uF capacitor. Connect the other side of the capacitor to pin 1 (DTR) on the FTDI.

15.  Connect pin 1 (reset) on the ATMega328 to one side of the 10kOhm resistor. Connect the other side of the resister to 5 volts.

16. Connect pin 2 (rx) on the ATmega328 to pin 3 (tx) on the FTDI.

17. Connect pin 3 (tx) on the ATmega328 to pin 2 (rx) on the FTDI.

18. Connect ground on the breadboard to ground (pin 6) on the FTDI.

19. Connect 5 volt on the breadboard to 5 volt (Vcc) (pin 4) on the FTDI.

20. Double check circuit before adding power to the circuit.

21. Connect USB cable to computer and the FTDI. The Red LED should indicate that the breadboard has power.

22. IDE: Check Uno board is selected in tools/board.

23. IDE: Check correct serial port is selected in tools/com.

24. Check to the red LED on the breadboard lights up and verifies you have 5 volts.

25. Load Blink sketch from Examples/Basic/Blink.

26. Upload Blink sketch.

27. Check green progress bar is working correctly, rx/tx leds twinkle correctly and there is no error message.

28. Check to see green pin 19 blink at the 1 second on/1 second off rate.

29. Congratulations you just made a working stand-alone Arduino.

30. Load fade into the IDE from Examples/Basic/Fade and upload this sketch.

31. Check to see the Yellow LED fading on and off.

32. You just reprogrammed your breadboard stand-alone Arduino with a completely different sketch.


Troubleshooting Tips:

·  Confirm you have 5 volts present.

·  Make sure all circuit connections are correct according to diagram.

·  Check upload green bar works, rx and tx LEDs twinkle.

·  Check crystal and capacitor connections carefully. Caps are small and space is limited on breadboard.

Further Refinements to the Circuit:

·  Add 5 volt regulator LM7805 to circuit to allow you to operate the circuit from higher voltages such as a 9 volt battery thereby making the circuit portable. This would require three additional capacitors and a 7805 voltage regulator chip.

·  Utilize the serial port connection to write a program in 'Processing' to switch between Blink and Fade by typing in a 'B' or an 'F'.

Lastly, you can use a perf board and solder up this circuit for a dedicated project.


Project 2: Add OLED display and DHT11 humidity and temperature sensor

Additional part required:

Qty Part Description

1 10k ohm resistor ¼ w

1 DHT-11 Humidity and Temperature Sensor

1 128x64 OLED I2C display

Steps to Build Circuit

1.  Unplug the USB cable from the FTDI. Caution: Do not apply power on the breadboard until circuit is complete.

2.  Wire the OLED display.

1.  Connect pin 1, on the left top of the display, to GROUND

2.  Connect pin 2 to +5 volts

3.  Connect pin 3 to SCL, ATmega pin 28, Arduino pin A5 or SCL

4.  Connect pin 4 to SDA, ATmega pin 27, Arduino pin A4 or SDA

3.  Wire the DHT11 Digital Humidity Temperature sensor.

1.  Connect pin 1 (on the left) of the sensor to +5V

2.  Connect pin 2 of the sensor to Arduino Digital 2 (pin 4 on the ATmega).

3.  Connect pin 4 (on the right) of the sensor to GROUND

4.  Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

4.  IDE: Install the U8glib library. (Sketch/Include Library/Manage Libraries)

5.  IDE: Verify that the DHT sensor library by Adafruit is installed.

6.  IDE: Load the sketch OLED_DHT11. Copy this from the memory stick to your Arduino folder.

7.  Connect the USB cable to the FTDI.

8.  Upload OLED_DHT11.

9.  In the IDE File/Examples, at the bottom, are sample sketches using this library.

Another popular graphics display library is Adafruit GFX. To use this library you will also need to install the Adafruit SSD1306 library.

David Robson

June/2016

Page 7 Bend Arduino Group Stand-Alone Arduino June 2016