Introduction: $2 Arduino. the ATMEGA328 As a Stand-alone. Easy, Cheap and Very Small. a Complete Guide.

In this instructable you will learn how to use the Arduino ATMEGA328 microcontroller chip as a stand-alone microcontroller.

They cost only 2 bucks, can do the same as your Arduino and make your projects extremely small.

We will cover the pin layout, how to make it ready for the Arduino software by burning a bootloader and how to upload sketches.

Watch the rest of this instructable to find out how you can make your Arduino projects smaller and cheaper in no time.

Step 1: Parts List

  • 1 Arduino
  • 1 ATMEGA328P-PU chip. I got mine here:
  • Breadboard
  • Wires
  • Optional: LED and 330 ohm resistor for testing

Step 2: Download and Install Library

An Arduino board comes standard with a 16MHz external oscillator.

We don't really need this 16MHz oscillator as the ATMEGA328P-PU has a 8MHz oscillator build in.

In order to make this chip work as a stand-alone microcontroller at 8MHz, we have to download and install a library for our Arduino environment.

To do this, click the link that match your Arduino version to download the zip file.

It will be eater, or

Next we have to find the Arduino sketchbook folder by clicking on File → preferences → “Sketchbook Location”. In my case “C:\Users\tomtomheylen\Documents\Arduino” this can be different in your case.

Copy the location and go to “this pc”, paste it in the bar and press enter.

If you see a folder named “hardware”, open it.

If not, make a new folder named “hardware” by right clicking and select “new → folder” and type “hardware”. Now open it.

Move the breadboard folder from the zip archive to the “hardware” folder.

Restart your Arduino IDE and go to “Tools → board”.

If everything is OK, you should see in the list “Atmega 328 on a breadboard (8MHz internal clock)”.

The most difficult part is done now so let's have some fun pumping life in that ATMEGA328.

Step 3: Burn Bootloader

These ATMEGA328 microcontroller chips usually come empty. To make them work with the Arduino IDE, we have to do something what's called “burning a bootloader”. It is a tiny bit of code we burn on the chip so it will understand the Arduino software.

To do this, connect your Arduino to your computer and go to “File → examples → ArduinoIsp” and select “Arduino Isp”. Upload this sketch to your Arduino and disconnect from your computer.

Next we connect the Arduino with the ATMEGA328 as you can see in the image.

Note the half circle on the chip. Make sure it is on the correct side.

Now connect your Arduino and in the Arduino IDE go to “tools → Programmer” and select “Arduino as ISP”.

Next go to “Tools → Board” and select “Atmega 328 on a breadboard (8MHz internal clock)”.

Now go to tools and select “Burn Bootloader”.

Your bootloader is burned and your chip is ready to upload sketches!

In case you have an error message, unplug your Arduino and repeat the previous steps.

Step 4: Uploading Sketches

To upload a sketch you have to remove the ATMEGA328 chip from the Arduino board and connect to the breadboard as shown in the image.

You can also use a USB to serial programmer like the FT232RL to do this. I have made a mini instructable on this here:

I have connected a led with resistor on the board to test the blink sketch.

Here is how to use this image for the
pin layout.

So for example if you initialize pin 13 in the IDE, it represents pin 13 on the Arduino board or pin 19 on the ATMEGA328 chip.

Congratulations, you made it! You can now start soldering your own minified Arduino projects for next to nothing.

Step 5: A Few Helpful Tips

I will end this instructable by giving you a few more more helpful tips:

If you solder a project, you need to use a 28 pin DIP socket and add the ATMEGA328 after soldering the project.

I got mine here

It is good practice to solder some malevor female header pins to the 3 first legs so you can still change or upload sketches if needed.

If your micro controller is behaving weird, you can add a 10 to100 uf capacitor in between + and -.

Make sure when you order the chip that it is the ATMEGA328P-PU.

Step 6: Final Note

Did you like this instructable, please click the Favorite button and subscribe.

Also check out my "How to fix Chinese Arduino clones" instructable.

See you in the next Instructable.


Tom Heylen


Donate to help me keep doing this work:


adouble42 (author)2017-05-02


--scientists-- (author)2016-05-02

Can i program atmega328 without removing microcontroller from arduino i mean to program like attiny with arduino isp

adouble42 (author)--scientists--2017-05-02

adouble42 (author)adouble422017-05-02

if you have problems recognizing it in atmel studio with that method you probably have a libusb issue, this answers that

ToughRocket52 (author)2016-06-18

Hi tomheylen, I'm having some difficulties with burning the bootloader. The error is as follows "avrdude: Yikes! Invalid device signature. Double check connection and try again, or use -F to override this check. Error burning bootloader". What is going on here? Thanks in advance!

jrobinette (author)2016-06-16

I got as far as unzipping the files and putting them in a ..Arduino\hardware folder, then got distracted by something else. Later when I returned to Arduino projects I started seeing this message in red - "Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB" when compiling any sketch. One cure is to delete the above folder.

I don't notice anyone else reporting this, but I'm a novice so maybe everyone else said to themselves "Oh yeah" and applied the necessary tweak. Could anyone tell me what the tweak is? I hate red messages, even if they are warning/information.

Hoanpham (author)2016-05-24

Hi Tom. I have made several single chip arduino based on your instruction. Thanks a lot. However, I got some other annoying problems:
"avrdude stk500_cmd() protocol error"
"avrdude: stk500_recv(): programmer is not responding"

Sometimes it works, sometime not. Restart/unplug many times then suddenly it works again. So how can I solve this?

claytonuk (author)2016-05-05

Thanks for putting this together. Will be great to integrate this chip directly onto a PCB with a few other components my project needs. Sometimes 'integrated' is much more helpful than 'smallest'. Great instructable.

WasimA22 made it! (author)2016-04-16

I am using IDE 1.6.8 and tried same but here is error I am facing ...

avrdude: Device signature = 0x0000ff
avrdude: Expected signature for ATmega328P is 1E 95 0F

Hoanpham (author)2016-04-04

I don't have this type of Arduino board that can pull out the micro processor. Is there any way to upload sketches 'without' removing the onboard micro processor?

tomheylen (author)Hoanpham2016-04-04

You can use a FT232RL chip. Cost less than 2 dollar. It is a USB isp programmer. Here is the link:

MarkP176 (author)tomheylen2016-04-14

...does that mean you can use it to program the ATM328 WITHOUT needing a full Arduino to hand? Including the bootloader? Because that would make this method MUCH more practical for cash starved noobs like myself.

(Price and ease of using the Nano aside, it WOULD be much cooler to be able to wave a bare old-skool style microchip at someone and say "I programmed this!" before clipping on a button cell and some LEDs or the like and having it run through a pretty flashing pattern, vs an obviously manufactured board with them built in that connects to a powerbank :D )

MarkP176 (author)tomheylen2016-04-14

...does that mean you can use it to program the ATM328 WITHOUT needing a full Arduino to hand? Including the bootloader? Because that would make this method MUCH more practical for cash starved noobs like myself.

(Price and ease of using the Nano aside, it WOULD be much cooler to be able to wave a bare old-skool style microchip at someone and say "I programmed this!" before clipping on a button cell and some LEDs or the like and having it run through a pretty flashing pattern, vs an obviously manufactured board with them built in that connects to a powerbank :D )

tomheylen (author)tomheylen2016-04-04

Hi Hoanphom, I need to have some beers with some friends now. So I will be back with you tomorrow. It is quiet easy but I like to provide a clear working answer.

Hoanpham (author)tomheylen2016-04-04

No problem. Thank you. This is very useful when I need to keep the battery as long as possible. Just ordered both components. I'm really appreciate a lot with some simple wiring between the ATMEGA328P-PU and the FT232RL.

tomheylen (author)Hoanpham2016-04-06

Hi sorry for the late reply. I got this question alot so I made a mini instructable for it. Here it is:

Hoanpham (author)tomheylen2016-04-08

Thank you so much :-)

voblak (author)2016-04-13

I have bad experience with chips from china specially 328p, now that is so popular. I rather spend little more and buy it on farnell, DK, mouser etc. Also for 2$ you can get arduino clone from china.
Anyway the AVRs are overpriced, compare (original) arduino board with STM32 board and you'll see the difference!

erik.m.brage (author)2016-04-13

I didn't read all of this but dont you somewhere have to modify the fuse bits to go to/from internal/external oscillator? Also I read somewhere that the internal osc may work with the serial port but bc of its inaccuracy sometimes needs calibration. I prefer to add xtal, caps and a 5 pin header so I can re-program my sketch in-circuit. The greatest savings is in not having to include the serial chip in the design. I have a dedicated chipless old Uno that acts as a programmer, one Avr Dragon for the fuse bits and then some home-made shield for burning the bootloader.

Bobby2015 (author)2016-04-09

Hi Tom Heylen,

Thanks a lot. I did it and it works ok. I have a question. What modification do I need to do If I want to use the 16MHz oscillator? I appreciate your help.

tomheylen (author)Bobby20152016-04-09

You need to connect a 16Mhz oscillator between pin 9 and 10 with 2 x 22pf capacitor. And then select board "Arduino Uno" in the IDE.

legoman44 (author)2016-04-04

Just out of curiosity, can the enabling of the internal 8MHz clock be done with the ATmega168 microcontroller using the same Atmeg328 on a breadboard file and following the same procedures as described?

tomheylen (author)legoman442016-04-05

Not sure. I have never worked with an atmega168. Give it a try.

se4587 (author)2016-04-05

Hi Tom, are the Atmega328P chips from china/aliexpress actually good? If so, maybe it's worth waiting for the slow boat to get them in bulk, instead of from Mouser for 3-400% of the cost...

tomheylen (author)se45872016-04-05

Make sure to order the ATMEGA328P-PU. They come by airmail and usually takes around 2 weeks. Look at the link in parts list. That are the ones I got and they work perfect.

LiamOSM (author)2016-04-03

This is a very simple - yet tremendously useful - Instructable you have written. The ability to use an ATmega chip embedded in a compact circuit can be extremely useful. Instead of integrating the USB port, all the header pins, 5v regulator, and all that, you could just have an ATmega right on the PCB. I love this idea. I'll still use an arduino for experimenting, but in permanent applications the bare ATmega chip will suffice.

tomheylen (author)LiamOSM2016-04-03


jerry.ericsson2 (author)2016-04-03

You can indeed pull the chip from an arduino (if you have that type) and replace it with another chip to burn the boot loader, however it is easier to just buy a chip with the bootloader already burned, they do sell them that way, skip a step, but it may cost you a few cents more. I have also pulled the chip and replaced it with one that needed fixing and managed to reburn the bootloader and get it going again. That is the fantastic thing about arduino, you can do most anything you can dream up buy just doing a bit of research.

GaryD36 (author)2016-04-03

If you can do all these functions using the socket already on the Arduino, would it work to convert that socket into a ZIF (perhaps plugged into the original socket), and you're done? Would that work?

Oddstr13 (author)GaryD362016-04-03

That would likely work, yes. You won't be able to use shields with it, and if you are plugging it into the original socket, you are likely to widen the contacts so that you can't use just a chip with it afterwards, as the flat pins on the ZIF socket go the other way than the DIP pins.

Images are CC BY-NC-SA 3.0

jerry.ericsson2 (author)2016-04-03

Guess things are a bit more expensive in the UK, Jullian did this last year and it cost him 5 bucks. Nice redo of Jullian's project though, you can see his video on the subject here:

I built two of these last year, the first I managed to burn up the second time I used it, my own fault by hooking it up backwards.

John T MacF Mood (author)2016-04-03

Great ideas, and a MUST about the socketing of chips. I've burned out a few of the more expensive chips by soldering them into a circuit - never again.

I also must admit to trying to test a circuit and wondering why it won't work! (Because I forgot to insert the chip into the socket! Joke was on me!). But they all worked fine once the chip went in.

Great instructable!

GDC (author)2016-04-03

Thanks for the great instructable. I am building a thermal flashlight and will will attempt to use this method to not tie up an arduino. BTW the current price for the chips is $1.46 each. All of the other components I already have. For me, this is a $1.46 arduino.

tomheylen (author)GDC2016-04-03

Great to hear. The atmega328 as a stand-alone give you a lot of opportunities for future projects.
Would be great if you post a picture when your flashlight project is finished. Cheers Tom

mg53 (author)2016-04-01

Thanks Tom. Would also be great to have an instructable on using the atmega (or programmed Arduino) without connection to the computer.

tomheylen (author)mg532016-04-01

Just connect pin 7 and 8 on the atmega328 to a 5v power supply and you are ready to go. Make sure to connect pin 7 with 20.

praveenkumar2000 (author)2016-03-31


while uploading a sketch you xan remove the old one and insert the new ic .

same case in burning burning bootloader


I was thinking about this too

About This Instructable




Bio: I like to make stuff in my free time. Especially programming, cooking, electronics etc. Lately I'm making tutorials about stuff I made the last ... More »
More by tomheylen:Long range, 1.8km,  Arduino to Arduino wireless communication with the HC-12.How to connect a FT232RL programmer to the Arduino ATMEGA328 for uploading sketches$2 Arduino. The ATMEGA328 as a stand-alone. Easy, cheap and very small. A complete guide.
Add instructable to: