This tutorial will go through the steps involved in fabricating your own Arduino-compatible circuit using just ~$8 of parts (this includes the ATMega chip!). This is perfect for installing and embedding in permanent pieces, as you don't need to waste a full $30 Arduino board in a project you will never need to reprogram or touch ever again. It is also great because you can solder any custom circuits (LEDs, other ICs, any external analog circuit) on the same board, and customize in terms of shape and size.
I assume you have a regular Arduino board already, so pulling out the chip to reprogram it shouldn't be a big deal, since we're going for minimal parts here. You could even go simpler by leaving out the reset button! To better illustrate the process, I did all the wiring on top of the board for tutorial purposes, but feel free to save yourself some space and make some of the connections on the copper-clad side of the board, as seen on hackduino.org or similar.
Remove these ads by
Signing UpStep 1Gather Components and Tools
• 28-pin DIP IC Socket - $0.30 - buy mouser
• 16MHz crystal - $0.55 - buy mouser
• momentary push-button switch - $0.15 - buy mouser
• 1k ohm resistor - $0.05 - buy mouser
• LM7805 5v voltage regulator - $0.35 - buy mouser
• 2 x 22pF capacitors - $0.12 - buy mouser
• 10nF capacitor (ceramic disc code '103') - $0.10 - buy mouser
• 22uF capacitor - $0.02 - buy mouser
• ATMega168 or 328 microcontroller chip w/Arduino bootloader (you can use the one on your Arduino for now!) - $4.00-$5.50 - buy unbootloaded mouser(cheaper) / buy bootloaded sparkfun(expensive)
• breadboard style perf board - $1.45 from electronix express (elexp), or $1.99 - from radioshack
Total cost of components: $7.39 (!!!) *22AWG wire is not included
I have created a Mouser project that includes everything you will need, except for the perfboard itself (Mouser doesn't carry a good one at a good price). Also, this is the blank ATMega328 - so you will need to bootload the chip yourself. Also keep in mind that ordering in multiples makes everything cheaper! Here is the Mouser project.
Tools:
• IC Extraction Tool (you can use a min-flat head screwdriver to pop out chips as well) - buy
• Wire strippers
• Snips
• Multimeter
• Soldering Iron + solder
| « Previous Step | Download PDFView All Steps | Next Step » |




















































Thanks!!
Am I reading correctly?
Thanks
I have built this Hackduino using the exact materials and wiring as described but on a protoboard. I burned my ATMEGA328, uploaded the SOS code and verified it worked with my original UNO. All fine. However when I plug the chip into the protoboard and power it up... nothing. So I checked and rechecked my wiring; all fine. It wasn't until I pulled both GNDs from the 22uF caps and crystal that the damn thing started blinking!
So without any GND to the caps and crystal it works absolutely fine. Weird?
So I have two questions: Do you think the crystal might have gone bad?
And
Do i even need the damned thing?
also, i believe you're using the wrong capacitors. it's 22pF (picofarad), not 22uF (microfarad).
hope it helps
With a resistor, if you need 50 ohms of resistance but didn't have a 50 ohm resistor, you could use two 25 ohm resistors in series (they'd pull the exact same amount of resistance - 25ohms x 2 = 50 ohms). Using two 10uf caps gives you 20uf of capacitance, and 2uf of difference between that and a 22uf cap isn't really anything to worry about.
C sum = (C1xC2) / (C1+C2)
if you have more than two capacitors, the formula is:
C sum = 1 / ( 1 / C1) + (1 / C2) + (1 / C3) ..................
C sum = The serial capacitance
C1 = one capacitor
C2 = another capacitor
C3 = the third capacitor
Just so i get this right if i have an arduino uno i can do all programming and bootloading on that one and then just build my projects using the Hackduino when im done with my codeing.
And for next project i just go buy a chip and plug into my arduino and then build another costum Hackduino?
And so on.
Or is there anyting more i need?
can anyone help a frist timer out with some more specifics about using the Parallel Programmer for the Atmel chip flashing?
Or is that ONLY for uploading the sketch portion to the chip? and NOT for flashing the bootloader portion?
Do you need more than this set-up and the parallel programmer? Such as any other breakout boards..?? or headers..? ISP FTDI any of that stuff I saw mentioned (which is bit over my head)??
I have this set-up as outlined above (in a breadboard though..not a proto board)
but still only have blank chips so I can not even attaempt to upload a sketch/program to the chip for testing.. PLEASE (anyone) throw me bone her and help a first timer out with the bootloader aspect of all this!)
I have made the parallel programmer witht he correct resistors as outlined in the Arduino page/diagram linked from here..
Thanks
So, how do I solve the bootloader "chicken and egg" problem? If you have a blank Atmel ATMega328P chip, you can use an existing arduino to install the bootloader on a blank chip. This means you can use a USB to FTDI serial cable to send the bootloader through an arduino to a target chip. The arduino site has more information: http://arduino.cc/en/Tutorial/ArduinoISP
SparkFun has a great series of tutorials under "Beginning Embedded Electronics" The first four are a great complement to this instrucable: http://www.sparkfun.com/tutorials
http://www.uchobby.com/index.php/2009/10/04/diy-serial-to-usb-for-3/
and
http://www.arduino.cc/cgi-bin/yabb2/Yabb.pl?num=1261313468/
And for your question on if the programmer has to be connected after the sketch is programmed, you don't need to connect it once the sketch is uploaded.
and got this:
avrdude: can't open device "giveio"
avrdude: failed to open parallel port "lpt1"
as my response from the Arduino IDE..
(geez if its this hard to get the bootloader on..I cant image what it going to be like to upload sketches all the time!.)
Trying to do this the most budget/economical way possible (household items..and hacks..etc)
thanks
Programming a sketch on to the chip will require an FTDI device whether it be a USB FTDI cable or an FTDI breakout board. Which is an additional purchase for you.
You can save the trouble of buying any of that stuff and just purchasing 1 (one) Arduino board and use it to both bootload and program sketches.
killing two birds with one stone.
both for bootloading & sketch uploading.
now would I just be 'popping' in/out new chips in this approach?
one last question I guess...since I have your ear (eye) for the moment..
on the link: http://arduino.cc/en/Tutorial/ArduinoISP
Im assuming I would be following the breadboard version/diagram..
does that set-up differ in any way to the set-up you displayed (we created) above? (reset switch and power added)
is the pinout the same for flashing the bootloader and uploading a sketch?
and I would just use those 4 pins (1, 17, 18, 19) to make a 'header' for quick programming?
In your step #4 (power) we add a capacitor to the the GND and ++ lines
Is this to protect in case the battery is plugged in the wrong way?
"I" appreciate this tutorial, this will be my first step into Arduino and Im excited!
Thanks for making it easier.
Those cables can be had for $2 on Amazon, I may have to use this.
thanks for the reply.. (thought this thread was dead for a bit)
I guess I dont understand what you mean by this:
USB to Serial FTDI programmer
I 'think' I need to have two separate 'programming' options here...correct?
1 to get the BOOTLOADER on the chip itself.. which is only done once.
and then 2 is have a way to program or upload the sketches/programs to the chips (over and over).. yes?
I currently have this instructable set-up in a breadboard instead of protoboard
and have built the parallel programmer as linked/mentioned to below.
that is where I am currently..
I now have my parallel programmer connected to my computer and the wires to
PP ATMEL (pinout)
1 - 19
2 - 17
11 - 18
16 - 1
18 - GND on breadboard
I have DL'd and 'installed' givieo? and am going to open the Arduino IDE for the first time..
Im hoping all of this is correct so far? this is my first time sorry to bother.
Thanks
if the bootloading goes good.. how can I upload my sketches?
thanks
I strongly recommend you just purchase 1 Arduino board. With just this one board you can bootload as many chips as you'd like, and then write sketches to the chips as well. I know it is a $30 investment, but it is well worth it - you can use it to bootload and program chips over and over again.
Here is how to bootload a chip using an Arduino. Writing a sketch to a chip is much simpler, you just write your sketch (I recommend using an example that comes with the IDE) and then after selecting the correct Board and Serial Port from the Tools menu, hit the "Upload" button.
What you are trying to do with the Parallel Programmer is absolutely possible, however I have no experience with it so I have no advice for you. It seems to me that as a beginner, you should stick to the simplest solutions, in this case dropping $30 just once and see how nice it is to prototype with. Using that programmer doesn't seem like a good place to learn for a beginner.
Im getting that giveio error
avrdude: can't open device "giveio"
avrdude: failed to open parallel port "lpt1"
thanks anyways... guess I'll wait for the real Arduino Due to come
and I agree 100% and I also do intend to purchase a 'real' Arduino board..
I just so happened by this Instructable.. and was already ordering from Mouser a few other small things.. (it just fit) =)
however I see (for now) it was just wasted or on hold until I get something to program these chips with.
Build_it_Bob
Oh, just a little tip ...I use both a red and black sharpie to trace the top of the board for power and ground traces . It make it easy to know what is VCC and what is Ground as you build your circuit.
http://evilmadscience.com/tinykitlist/74-atmegaxx8h
An additional cap and some quick rewiring will set you up with a power supply that is rock solid stable and has the downhill capacity to allow common accessory devices to be tied to the +5 rail with no reduced function or possible brown outs.
I have used up to a 470uf cap in place of the 100uf cap with no ill effects. As always with a 7805 you need 7 volts or greater input voltage.
Try this:
As far as your question, it is missing an important piece of data... What is the desired current at 2 Volts?
Assuming it was something like 100 mAh (.1A) then you would construct a voltage divider out of two resistors with R1 being 30 and R2 being 20.
Mostly when this question pops up it is someone seeking to connect an LED??? If that were the case then construct a voltage divider using the LED as R2 and something from 220 ohm (approx 25mAh current) - 1kohm (approx 3mAh current) as R1.
Voltage Divider math ~ Vout = Vin X R2 / R1+R2
I am a newbie to the arduino stuff it looks interesting and if I can get a handle on it I can get some projects done I have been thinking about for some time. I know this is an older subject and I ran across a YouTube project that addresses the very question you ask and bigjeff5 describes in his solution. I have constructed this project on a Radio Shack Electronics Learning Lab #28-280 which has a breadboard and a variety of other items i.e. push button switches, that make it easier to mock up a project. In the video I don't think the author mentions the need to "bootload the chip" before programing it with the initial "Blink" program for testing. After viewing the first part of this Instructable I now see "bootloader" must be done first, after that one can reprogram to suit one's project. I have included a link to the project: http://www.youtube.com/watch?v=VY0kiJNI5oE
Hope this helps. - Mike
The RS232 is easy, since it comes in a DIP package, but the FTDI only comes in an SMT package. These can be very tricky to solder and prototype with, but with care it can definitely be done. (I've never done it, but I hear using magnet wire makes this easier)
USB will add about $5 to the cost of your board, RS232 will add maybe $2-$3.
or you could just use 3 AAs in series, tht would work too
as for the caps, idk, i have the same question....