Standalone Arduino / ATMega chip on breadboard

 by domiflichi
Featured
Step 5 - Crystal to Chip 6.jpg
If you're like me, after I got my Arduino and performed a final programming on my first chip, I wanted to pull it off my Arduino Duemilanove and put it on my own circuit. This would also free up my Arduino for future projects. 

The problem was that I'm such an electronics newbie that I didn't know where to start. After reading through many web pages and forums, I was able to put together this Instructable. I wanted to have the information I learned all in one place, and easy to follow.

Comments and suggestions are welcome and appreciated as I'm still trying to learn all this stuff.

Edit:
Fellow Instructable member, Janw mentioned to me that it's always a good idea to add a capacitor or 2 near your power. He mentioned using a couple of 100nF capacitors should work. I'm very grateful he pointed this out to me, because my first production circuit that I'm building upon this circuit, was having a little bit of strange behavior. So I hooked up one 10uF capacitor near my power, and it started behaving correctly! I don't know why it didn't affect my 'blinking LED' test, but I do know that I'm grateful for Janw for pointing this out to me. Thanks Janw.

Edit2:
Building upon the previous edit, I wanted to mention that Instructable member, kz1o brought out some more information regarding the capacitors. Please see his comment below, dated February 14th, 2010 @ 10:52 am.

Update - This Instructable is on Hack a Day!

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts needed

Step 1 - Parts Needed.jpg
I bought my parts from Digikey and Sparkfun Electronics - they're 2 of my favorite places to buy components. Anyway, here's the list:

#1 - (Qty: 1) - ATMega328 chip with Arduino bootloader pre-installed ($5.50)
#2 - (Qty: 1) - 5VDC Switching power supply ($5.95)
(Note: If you don't use a switching power supply, you must add in a voltage regulator and a couple of capacitors...see below)
#3 - (Qty: 2) - 22 pF ceramic disc capacitors ($.24 / ea)
#4 - (Qty: 1) - 16MHz Crystal ($1.50)
#5 - (Qty: 1) - Power jack ($.38) (Optional)
#6 - (Qty: 1) - Breadboard (hopefully you have one laying around, but if not, here's one. ($8.73)
#7 - Small pieces of 22 awg solid wire. If you don't have any, you can probably pick some up at your favorite electronics store.

Total cost for above before tax/shipping: about $14 (not including breadboard).

Alternatives / options:

Option / Alternative #1:
If you want to use an existing power supply you have around the house, make sure it is between 5V - 16V. If you are not sure if it is a regulated switching power supply, then you must use the following components too:
#1 option - (Qty: 1) - 5V Voltage Regulator (or another similar 5V voltage regulator) ($.57)
and
#1 option - (Qty: 2) - 10 uF Aluminum Capacitor ($.15 / ea)
(See below reference links for how to hook them up)

Option / Alternative #2:
If you don't want to use standard items #3 and #4, you can replace those with:
#2 option - (Qty: 1) - 16 MHz Ceramic Resonator (w/cap) ($.54)
This part looks like a ceramic capacitor, and you hook the 2 outside pins up to where you would hook the crystal up (covered later in the Instructable), and the middle pin goes to ground. At least this is what I've read - I haven't tried it yet. But as you may note, it is a little cheaper to go this route. :)

Ok, let's start hooking stuff up!

1-40 of 86Next »
tiggman93 says: Feb 15, 2010. 5:37 PM
I believe that pin 13 has a built in resistor, but that may be on the p.c.b. itself.
TakashiMoto in reply to tiggman93Dec 22, 2012. 8:34 AM
Correct, it's on the PCB next to the onboard LED.
TxPilot says: Feb 21, 2012. 1:48 PM
This is a fantastic Instructable! Very nicely put together! I do have one question though that is related to the capacitors for the power. You mentioned above "So I hooked up one 10uF capacitor near my power" . Could you elaborate on that a little bit? Was the 10uF capacitor placed across the VCC and GND (Physical Pins 7 and 8 on the ATMega328)? If not where exactly did you place this cap? Also, do you need a cap for the AVCC (Physical Pin 20 on the ATMega328) as well?
KingCups in reply to TxPilotNov 2, 2012. 12:20 PM
A polarized capacitor is commonly used on any power source, often an Electrolytic such as the 10uf. On a positive supply such as Vcc place the negative lead to ground and the positive to Vcc. This dampens ring and other fluctuations in the voltage which can cause instability in the function of the device. Also a smaller one such as a .1uf or .01uf ceramic may be added as they tend to act to dampen higher frequency spikes "noise" on the supply voltage. A clean power supply always has good filtering.
domiflichi (author) in reply to TxPilotFeb 22, 2012. 8:41 PM
Sure, I'm not even sure if I hooked this up properly, but what I did was place the negative lead of the cap right after the negative lead of the jack so it's basically 'between' the jack and the power rail of the breadboard that's connecting to the ATMega328. And the same goes for the positive lead of the cap - it's lead goes between the jack and the power rail.
If this isn't clear enough, I could probably take a photo and post it here.
And if I have this hooked up wrong, I would greatly appreciate it if someone with more knowledge would point it out and guide us to the proper way of hooking it up.
Thank you everyone for looking at my Instructable and thank you for leaving comments. I apologize for not really answering questions here. I feel that I am not qualified to do so, so I've been standing back and leaving it to the experts. ;)
TxPilot in reply to domiflichiFeb 26, 2012. 10:47 AM
Thank you for the reply. I did a little more research on this as well and thought I would post it here as well so anyone that runs across this would see the information. It sounds like two caps are recommended. These are being referred to as "Decoupling" or "Bypass" Caps. One across the VCC and GND (Pins 7 and 8) and another across the AVCC and GND (Pins 20 and 22) and it sounds like it is recommended that they be mounted as close to the pins on the ATMega328 as possible. (Make sure the the polarity is correct if you are using a polarized cap!) One of the explanations that I read about it says that this basically is was to pass any AC noise voltage to ground so that you are getting a clean DC voltage input. So getting the caps as close as possible to the pins makes sense in that you are basically cleaning up the noise at that point. .1uF caps are what is being used. A larger cap (10uF range) can also be used in the same way you did at the point where the voltage enters the breadboard or PC board. Hope this helps. :-) Cheers!

Redgerr says: Oct 15, 2012. 12:10 PM
I don't know if it's been said but this is the new link for the arduino chip... the ATmega328 with Arduino Optiboot (Uno)

https://www.sparkfun.com/products/10524

Great guide, am going to use it as soon as some more chips arrive!
fotokid says: Feb 17, 2011. 5:11 PM
This is exactly the tutorial I was looking but the ATmega chip is so large that I can't use it on smaller projects. Do you know if I can program a smaller chip using my arduino?
OCPik4chu in reply to fotokidOct 15, 2012. 11:54 AM
There are plenty of different arduino compatible chips with varying amounts of outputs and features (and thus, size) You can get several of the common types with the bootloader preloaded from sparkfun's website or similar
scottinnh in reply to fotokidFeb 28, 2012. 10:04 PM
You mean this?
http://hlt.media.mit.edu/?p=1229

It's a smaller avr chip, runs Arduino boot loader. Less capabilities of course..
Foxtrot70 in reply to fotokidMar 7, 2011. 2:40 PM
This is what I have been looking for also. I have taken my setup Arduino 3 steps further. (It has not been with out a lot of difficulty, due to lack of feed back, as this has been an ongoing project for 3 months.) 1. Programming from the Serial I/O port of my desktop & laptop; 2 USB Programming via USBtinyISP Pocket Programmer from Adafruit from my desktop & laptop; 3. Interface board for the 8 pin dip chips ATtiny series using the USB Programmer from step 2. I hope to have my first instructable on these items posted shortly. I will answer questions as best I can until then.
cinciredsfan10 says: Sep 19, 2012. 9:09 AM
Thanks!! set it up today and worked perfectly. Had to add the capacitor across the power otherwise it freaked out. well done

elzurdo86 says: Jul 4, 2012. 7:44 PM
You could also set up the internal clock and eliminate the crystal from the setup :D . I have recently programmed an Atmega48 using Arduino as an ISP. I will make an instructable about it.
unixtippse says: Feb 16, 2010. 9:10 PM
Great howto! Looks like a perfect way to cut much of the price for an arduino pro in a permanent installation by just using the bare-bones microcontroller. I didn't know that it's possible to buy the Atmega with pre-installed arduino bootloader. Sounds nice.
Cloudhail in reply to unixtippseMar 25, 2012. 11:16 PM
If it says arduino compatible it will come to you with the arduino boot loader all ready on it.
cblizza1 says: May 14, 2011. 2:47 PM
Could someone clarify this line:

"make sure you place it between the capacitors and the chip/microcontroller"

It was my understanding that each row of the bread board was a node in a circuit and it didn't matter what order (left to right) the leads are placed into it. Is this a correct understanding of nodes and rows on bread boards?

If so is there another reason the crystal needs to be between the capacitors and the chip?
adam159 in reply to cblizza1May 31, 2011. 1:00 AM
I think he just means that you need to make sure that one cap is connected to each leg of the crystal rather than connecting both cpas to one leg
adam159 in reply to adam159May 31, 2011. 1:05 AM
*caps
Jimmacle says: May 26, 2011. 7:56 PM
Wonderful 'Ible. Easy to understand, and complete. I just recieved the parts from Sparkfun.com, and am about to try it out!
Jimmacle in reply to JimmacleMay 29, 2011. 7:37 AM
It worked perfectly.
meyer_lanski says: May 20, 2011. 5:39 AM
Awesome instructions, Thank you SO much for sharing! It hasn't been very long that I started playing with arduino and this definitely cleared up some questions I was having regarding multiple arduino projects with just one board.

I'd like to know, can this board be used with any chip or does it have to be an Atmega chip? Also, would you happen to know how to modify this board to so that batteries are used instead of power jack? I have a few projects in mind that require the use of batteries so it would help me a lot.

Thanks again for sharing!
Mahox says: Apr 27, 2011. 8:24 PM
Does this also work with 20pF capacitors? Can't get 22pF over here...
johnpoole says: Mar 27, 2011. 4:30 PM
1ST reply here.. this is the best i've seen, not because others miss points but you're just getting started. you had to learn and document the steps as you went.. the results are great.. if you want to read a little on that cap you added to the power side, google pie filter.. old school to take the ripple out of any dc power supply.. your hardware side build is clear and precise.. thanks, keep playing with this and one day bill gates will work for you.. lol
purpulhaze says: Oct 28, 2010. 3:50 PM
Hey, what about the serial input? Where and how would you connect it?
JohnBailey in reply to purpulhazeJan 22, 2011. 10:21 PM
At a guess.. You don't. This is for when you have done the programming, and built the project, and now you are ready to let it fly free with the smallest component count you can manage as a standalone boxed finished project.

All the pins are direct connections from the chip it's self anyway, so all you add are the external "non Arduino" components.
bhunter736 says: Sep 14, 2010. 9:24 AM
I could re-iterate the previous comments, I agree completely. I would like to add that your use of photos is fantastic. You have included enough quality visual information that someone could simply mimic what you have done and have success! Very nice. :)
noik says: Sep 13, 2010. 9:41 AM
You made my day!, thanks, great information!
ZombieDUG says: Sep 8, 2010. 3:24 PM
This is really great, and was exactly what I was looking for today! Opens up a LOT of possibilities for hobby micro-controllers and custom boards. Can't wait to play around with this! Keep up the great work!
shad0w88 says: Feb 16, 2010. 3:53 PM
Hey, i can't get the ATMega328 chip with Arduino bootloader preinstalled in my country. I can get the ATMega328 chip without the bootloader, what should i do?
Muling in reply to shad0w88Jul 27, 2010. 4:32 AM
Hi, you could write your Arduino Bootloader with .. an Arduino :-D You just need to solder in a Header and connect a few cables. There you go: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html I use that Method myself and it works great.
shad0w88 in reply to MulingJul 27, 2010. 6:24 AM
Thanks for the response, but i don't have an Arduino, others i would have used it to burn the bootloader.
domiflichi (author) in reply to shad0w88Feb 16, 2010. 6:48 PM
 Hi saad.dawra,

Here's a couple of links to get you started: itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard#toc9 and www.arduino.cc/en/Hacking/Bootloader

Hope this helps. 
shad0w88 in reply to domiflichiFeb 16, 2010. 10:57 PM
Thanks, I'll probably have to go the parallel progammer way, cuz i don't have access to an FT232 Breakout Board, which is also probably not available. What should i do if i can't get a FT232 Breakout Board?
domiflichi (author) in reply to shad0w88Feb 24, 2010. 3:29 PM
Did you try here:
uk.rs-online.com/web/search/searchBrowseAction.html
?
(Sorry it took so long to get back to you)
CalcProgrammer1 in reply to shad0w88Feb 22, 2010. 8:12 PM
http://www.arduino.cc/en/Main/ParallelProgrammer

Build this, I built one because I didn't want to buy an expensive programmer for a small project, but I just keep on using it because it works great.  Follow that guide, it says how to build a cheap, easy to build programmer out of parts that you should easily be able to get a hold of.  You do need a parallel port on your PC, and I think you have to set it into a certain mode (in the BIOS), took a little while to get it working but I have used this to flash the Arduino bootloader on plenty of "plain" AVR chips.
toelle says: May 25, 2010. 2:24 PM
I just did this following this instructable. This is the first time I've started an atmega outside of the arduino, and it worked 100%. It powered up, ran the blink sketch, and everything was successfull. Looking at this instructable first, it might seem like a lot of wiring, but it is actually incredibly easy to hook up. Thanks for this great instructable :)
andrew101 says: Apr 3, 2010. 3:09 PM
okay, i have some 15pf capacitors, and the datasheet for the microcontroller says they are within the correct range, but whenever they are in place, the arduino wont work..... I need this for a speedometer circuit, where it is measuring km/h from a slot sensor on a bike. its measuring time in miliseconds so i don't think accuracy will make a whole lot of difference. it works seemingly perfect when they are not in place.
Derin in reply to andrew101May 21, 2010. 10:54 AM
the caps are to make the quarts start oscillating every time you are fine without them but without them sometimes (very low chance) the quartz won't start oscillating
brunoxyz says: Feb 14, 2010. 12:48 PM
you can also make your life easier by using this:
http://www.sparkfun.com/commerce/product_info.php?products_id=9420

instead of a crystal and two capacitors.

it worked great for me.
RazorConcepts in reply to brunoxyzMar 10, 2010. 2:35 AM
Resonators like that are horribly inaccurate, I would not recommend using them unless what you are doing is not timing-critical. 
1-40 of 86Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!