Monday, 31 December 2012

Fun with Arduino - Arduino on a Breadboard

How to remove the 'Arduino' from your Arduino project

In this tutorial, we are going to build a 'stand-alone' circuit that will allow you to run your Arduino code without an actual Arduino board.

The term Arduino actually refers to a system of components that include the board, the microcontroller, the boot-loader ,and the programming environment. It is a system designed to 'protect' the user from a lot of the complication that is part of microcontroller programming.

At the heart of the Arduino board is a microcontroller called the ATMEGA328P. The Arduino board acts like a space suit for the ATMEGA, providing life support and doing its best to protect the chip from damage.

At the end of the day, the Arduino is a development board. While you can make the Ardino a permanent part of you project, once you have finished with the development phase of your design, it is often cleaner and less expensive to replace it with a stand alone ATMEGA microcontroller circuit. This is what we are going to build.

The Arduino board has built in power regulation circuitry that provides a steady 5 Volts to the ATMEGA328P. But, since the Arduino is going bye-bye, we have to build our own power supply circuit. We also need to provide a clock source for the microcontroller.  The 16Mhz crystal and 22pF capacitors take care of that.

Parts required:

1 - 9v DC Power Adapter - 500ma or greater (Wall Wart)
1 - DC Power Socket (2.1mm or sized to fit the plug of your power adapter)
1 - LM7805 - 5 Volt regulator
1 - 1N4001 - rectifier diode
1 - 100uF (Micro-Farad) electrolytic capacitor - rated at 25v or more
1 - 10uF (Micro-Farad) electrolytic capacitor - rated at 25v or more
2 - 22pF ceramic capacitors
1 - ATMEGA328P microcontroller
1 - 16 Mhz crystal
Hook-up wire (22 Gauge - Solid)

1 - SPST Switch
1 - 220 ohm resistor
1 - LED

How it works

First take a look at the schematic.

Let's look at what this circuit is doing. The 9 volt power from your adapter is being fed to a 1N4001 diode. This diode will only allow current to pass in one direction so if the adapter is connected backwards, the circuit will be protected. The 7805 regulator then drops the voltage down to 5 volts and holds it there. The 10uF and 100uF smooth out any ripples in the 5 volt supply.

This steady 5 volt power is supplied to the ATMEGA328P chip. The 16Mhz crystal and 22pf capacitors supply a steady clock signal to the microcontroller. Finally, in 10K resistor holds the microcontrollers 'reset' pin high, so the chip will run it's program. It's a very simple circuit.

Choose your Power

A couple of notes about choosing a DC Power adapter. This circuit will accept a variety of power adapters, but 9 volts is a good choice. You could go a little higher but the extra voltage will just be wasted as heat from the 7805 regulator. You may need to add a Heat-Sink if you go too high. If you go lower than 9v you may find the regulator may have difficulty putting out it's full 5 volts.

Also check the current rating of the adapter. I am using a 500mA unit. This is a fair choice as it is the same rating as the USB port that was probably powering your Arduino not long ago. If your project is larger, you may want to go with a 1 amp unit.

Finnaly, check the polarity of your adapter. Most adapters have a symbol printed on the label that shows the polarity of the tip and sleeve of it's power plug. You can see the symbol in the photo below. This one is showing that the sleeve of the plug is positive. You can use either type, just make sure you wire up your jack accordingly.

Build it

This video provides a step-by-step guide to circuit construction.

You should now have a funtional ATMEGA chip on your breadboard happily running your Arduino program.

In the next tutorial, we are going to look at programming the microcontroller directly on the board. See you then.


  1. may I ask... why isn't the ISP socket used in the video ?

    1. Hi there. Thanks for stopping by. The ISP socket is included in the schematic to make the circuit workable even off of a breadboard. The breadboard is basically a giant socket so to add another socket on it is unnecessary.

    2. thanks man!

  2. Thanks a lot! I used your multisim diagram in my project report :P

    1. Nice! I hope you at least got an A.

  3. Big THX! May I ask... Can i use instead of 25V capacitors 16V and 3.3V regulator instead of 5V? (And of course, it will be powered by a 2-6V)

    1. Hi There. 16V caps should be fine. I have not tested running from 3.3V but there may be issues trying to run it with the 16 Mhz crystal at that voltage. Also, you would want to use a 3.3v programmer.

    2. Thx again. What do you recommend to use crystals with 3.3V?

  4. Hi. I'm sorry Dave.

    I was thinking in make my personal Synth. But I have a just question:

    Is possible add a sequencer, the style drum machine?

    Sorry again, big thanks!

    1. Hi There. Anything is possible with a little ingenuity. What synth project are you working on?

  5. I have tried the same method bot it gives an error:
    Error while burning bootloader,
    avrdude: Yikes! Invalid device signature.
    Double check connections and try again, or use -F to override
    this check.
    please help me...

  6. Does it have to be a 9v wall wart? Could we just use a 5v wall wart and skip the voltage regulator?

    1. That would be dangerous. Most wall warts are not regulated so their actual output voltage can be very different from their printed rating. You could easily blow up stuff.

    2. Does the voltage regulator affect the amps?

    3. It's complicated. Think of your circuit as a resistance (load) that you are attaching to the wall wart. The lower this resistance, the more current will flow.

      The voltage of the wall wart will drop as more current flows. So when you see an adapter with a rating of say (5 volts, 200 mA) what it is actually saying is "This adapter will output at least 5v as long as you are not drawing more than 200mA".

      If you swapped this adapter with one rated at 5v,500mA. The voltage to your circuit would be higher. That's why a lot of products say "only use the official adapter that comes with the product".

      By adding the voltage regulator to our circuit, we are avoiding all this nonsense. Hope this helps.

  7. Thx for this post. Ive done the bread board part now im on to the soldering. As my first project im still unclear on how the real things components connect.

  8. This comment has been removed by the author.

  9. Dear Dave,
    this website will probably be one of the best things that happened to me so far this year! Amazing stuff.

    I noticed that the Breadboard isn't on the list of required parts, so I added it to my shopping list anyway. Is there anything else I should add apart that?

    1. Hi Omar. Welcome aboard! I think you should be good to go. If you want to make a permanent version later, check out this post

  10. This comment has been removed by the author.