Intro: Standalone Atmega328
We all have a deep fondness to our Arduino with its familiar shades of blue/green, but the time has come to explore other project options. One that involve fewer pieces, fewer parts, and fewer dollars. Building a standalone Atmega328 is far simpler than you might have imagined and can open up a wide range of of new project possibilities.
Step 1: Materials:
The shopping list contains parts that are entirely plug and play. No configuration or setup needed! These parts are from Sparkfun using their parts #, but are widely available from other electronic websites.
Sparkfun is kind enough to put a little sticker on the chip so that you know what each pin corresponds to ex. 1 is RESET.
Atmega328 DEV-10524 - make sure that it has the boot-loader on it. You can put it on, but this one has it and it makes everything far simpler.
28 Pin DIP socket PRT-07942 - helpful for reprogramming the chip so that you don’t have to de-solder it every time you need to make a change (breadboard friendly).
Power (3 options depending on power source):
a) 4x AA NiMH Batteries PRT00335- They are each 1.2V so *4=4.8V, safely with the Atmega328′s operating range. Also helpful is the fact that they will give you around 2500mAh versus ˜800mAh from a 9v Battery.
b) 1x 5v Voltage Regulator COM-00107 - The Atmega328 needs a regulated voltage to run and 5v is well within its operating range. You will need a 9V+ power supply for the voltage regulator 2x Electrolytic Decoupling Capacitors COM-00523.
c) 1x 5v Voltage Regulator - http://www.pololu.com/catalog/product/798 - Takes less than 5v and steps it up so that your Atmega328 is running at 5v.
Resonator COM-09420 - No fuss or extra parts. The middle leg goes to ground and the other 2 legs go to Pin 9 and 10.
1x Pushbutton - it does not matter what kind, this will be used for reset.
1x 10K Ohm resistor.
Breadboard with channel
300 Ohm resistor
Step 2: Hooking It All Up
You can access the schematic at Upverter
These parts can be hooked up directly to VCC and GND.
Otherwise the you can power the Atmega328 with less than 5v, although, some protection is probably a good idea. Perhaps a Zener diode assuming you can waste some power as heat?
If you are using the Ceramic resonator the 2 outside legs go to pins 9 and 10 (where it says VCC and GND on the left) and the center goes to GND.
If you are using the ceramic crystal connect the crystal between pins 9 and 10 going to GND and connect the 22pf capacitors between GND and the pins.
From pin 1 (RST) create a connection to your push button. On the other leg (same side of push button) connect the 10k Ohm resistor to GND. Now whenever you push it the Atmega328 will reset itself.
Lastly wire a resistor from D13 to a LED connected to GND so that you can test the Atmega328 with the blink script. You can also add various LEDs to test for example, is the power flowing in.
Step 3: Programming
At this point you might be wondering how this will ever be programmed? There is no USB connector anywhere. The simplest and cheapest solution is if you look at your Arduino Uno or equivalent and notice that the Atmega328 in that is not soldered down, but in a similar DIP package that your Atmega328 is resting in on the breadboard. With a screw driver gently, gently (watch the tiny legs on the end) pry it out and insert your other Atmega328. Program it, pop it out, and now you can run the Blink sketch or whatever you choose on your breadboard!
Congratulations! You are now free to control the Atmega328 in any form without any constraints.