Perfboard Hackduino (Arduino-compatible circuit)

Perfboard Hackduino (Arduino-compatible circuit)
Never again will you have to dismantle a finished project just to reuse an Arduino board!

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.
Hackduino3_schem.pdf(595x842) 219 KB
 
Remove these adsRemove these ads by Signing Up
 

Step 1Gather Components and Tools

Gather Components and Tools
Parts list and buy links:

• 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 StepDownload PDFView All StepsNext Step »
119 comments
1-40 of 119next »
Jan 4, 2012. 5:15 AMGofilord says:
Hey ummm... I have an arduino nano so I can't really preform this step.. is there any OTHER WAY for uploading a sketch do my hackduino? Like, maybe, using jumpers from an existing arduino or buying a cheap FTDI chip that I can use for all of my hackduinos?
Thanks!!
Nov 16, 2011. 6:44 AMtheugleymonkey says:
How would i add an FTDI chip to this so I could connect it via usb?
Oct 11, 2011. 10:16 AMeboily says:
If I properly read your pictures, both capacitors are between GND and OUTPUT. I thought that 7805 also needed a capacitor between INPUT and GND...

Am I reading correctly?

Thanks
Sep 28, 2011. 8:38 PMjoshua.zajac says:
Ok maybe someone can help me understand my problem here.
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?
May 3, 2011. 6:36 PMsbonkosk says:
I've seen 2 ways of making this hackduino, this way with a 22uF capacitor on the 7805, and another with 2 10uF capacitors. Whats the difference? Is there any real difference at all?
Aug 19, 2011. 11:13 PMSmokeGSU says:
I believe caps will operate in series in the same fashion as a resistor. Without seeing the diagrams you've mentioned, I'm assuming the two 10uf caps are in series beside each other where the 22uf cap would otherwise go. I imagine the person who used two 10uf caps didn't have a 22uf cap to use, so opted to use those instead.

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.
Sep 18, 2011. 2:43 PMdumle29 says:
Capactiors dont work like that, here is a formula, to get the serial capacitance:

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
Sep 18, 2011. 8:43 PMSmokeGSU says:
Yep, you're absolutely right. Been a while since I took electronics and I'd forgotten there was a formula involved. Thanks for the correction!
Aug 29, 2011. 1:46 PMSpyvingen says:
Ok stupid me here :)

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?
May 23, 2010. 8:42 AMxl97 says:
BUMP....

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
Mar 17, 2011. 8:49 PMcybersean3000 says:
I am not sure about using your parallel programmer for sketches, but I do know it is usually used for uploading the bootloader. I got the Adafruit AVRTinyISP kit from SparkFun to install bootloaders. There is a problem using it with it Vista, but it works fine with XP.

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

Mar 10, 2011. 2:10 PMBlueLiner19 says:
I just used my NKC freeduino clone board and used the parallel cable to program the blank atmel with the bootloader. At first it did not work and I was not able to program until i stumbled across someone who had the same issue. Rather than run 9VDC into my Freeduino, I dropped it it lower and lower until it would program. I do not recall how low I went. I think my 9VDC adapter switch was set to 4.5 VDC, but I again my memory is foggy as it was quite some time ago. - BlueLiner
May 23, 2010. 6:56 PMMr.Electric says:
 If your looking for a cheap USB to Serial FTDI programmer you can try the Nokia DKU-5 or CA-42 datacables. Personally, I have not tried it yet but it may work. Here is the URL for the sites that have it in projects.


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.

May 23, 2010. 8:00 PMxl97 says:
Well I gave it the old college try..lol

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
May 23, 2010. 8:43 PMxl97 says:
understood. =)

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.

Jul 11, 2010. 1:36 PMbigjeff5 says:
"now would I just be 'popping' in/out new chips in this approach? " Yep :). The Arduino IDE has all you need to both flash a fresh chip with the bootloader and upload the "sketch", and contrary to what you might think, loading the bootloader is the hard part - it's actually what allows the chip to be configured over serial rather than via an ISP. Loading a program is a snap once the chip is configured (it's just compile > upload from the IDE). Getting USB onto a protoboard is going to be either difficult or expensive. You can get FTDI modules that connect to DIP switches, and they are super simple to use, but they tend to cost $20+ each, in which case you might as well buy a branded Arduino board for all the money it's saving you. "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?" The pinouts are the same, but unfortunately you can't use a serial connection to install the bootloader. If you have a parallel port on your computer you can use the ultra-simple Parallel-programmer connector to install the bootloader on a blank chip on the Arduino board itself, and from there you can do the rest of the programming on the chip via serial. If you don't have a parallel port, though, you'll need an already bootloaded ATMega 328 in the Arduino board, which you then use the breadboard diagram to connect a blank ATMega and load the bootloader. If you're going to be doing a lot of ATMega bootloading (or really, even just a little) it would be worth building yourself a proto-shield that plugs directly into and sits on top of the arduino, with either a solderless breadboard or a dedicated DIP socket attached (I'd go solderless, since it's more flexible). There are several instructables on here on how to do that, it's a little tricker than it aught to be because there is a non-standard gap on the Arduino board, but it isn't hard or expensive by any means.
Jul 11, 2010. 7:01 PMxl97 says:
Thanks for the reply.. although its been over a month now.. this is still good info for those new who come here searching. I did in fact get a 'true/real' Arduino.. (Duemilinove) and just used that to: a.) bootload the blank chip..and pop them in/out of other projects. and b.) just use the Arduino directly as an ISP programmer..to flash the bootlader to my breadboard/Atmel set-up.. both work fine of course.. as for uploading sketches.. well of course the IDE works for the real Arduino board.. but for the breadboard set-up you need an FTDI cable as you said.. I just grabbed two generic mobile phone data cables (CA-42? and DKU-5?).. and used the PCB inside to solder my leads to..and put on a quick break away header to jumper wire to my Atmel on breadboard.. works fine.. except there is no REST pad (that I can find so far from metering it) but if I can just use the rest button on the breadboard just as well..(flawless for me). so while auto-reset would be nice..its not a show/project stopper for me.
Jul 12, 2010. 3:33 PMbigjeff5 says:
Now that's a good idea! The older arduinos didn't have auto-reset anyway, so that's no biggie.

Those cables can be had for $2 on Amazon, I may have to use this.
Jul 13, 2010. 7:00 AMxl97 says:
Yeah....very handy.. and very cheap. Definitely a 'win'.. Although I would be curious if anyone knows of a 'specific' (cheap) alternative that 'does' in fact have a DTR/RESET via/pad on it? Would be nice to be able to eliminate even more components for a final version/project. I personally got mine on Ebay from any of the China sellers..
May 23, 2010. 7:32 PMxl97 says:
hi..

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
May 23, 2010. 8:47 PMxl97 says:
can you (or anyone) even tell me if I had the pin out to the chip correct?  

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
May 23, 2010. 8:26 PMxl97 says:
Thanks for the reply..

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.
Mar 13, 2011. 7:16 PMBuild_it_Bob says:
Very helpfull tutorial . I like the way you took time to show the routing of the wires for clarity. I hope they get the optiboot figured out for the Arduino Uno so I can us it to program some of the atmega 328 (with bootloader) that I have for some permanent circuits. At least I will have the knowledge of what to do when it is ready to go ... Many Thanks!
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.
Mar 12, 2011. 12:03 PMcybersean3000 says:
EvilMadScience has pre-made target boards for $3US each or a 5 pack for $11.50US.

http://evilmadscience.com/tinykitlist/74-atmegaxx8h
May 24, 2010. 1:12 PMBIGBUG says:
Great 'ible but how about reworking the power supply to something a bit more robust...

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:
PwrSupp.jpg
Feb 7, 2011. 11:45 AMrobbe47 says:
pas gekochte arduinio heb ook al deze voeding gemaakt en werkt uitsteken gebreuk deze met een dikke stekker ook voor andere microcontrollers goede reakties op deze blog schapoo voor de inzet daaag van robert
Oct 4, 2010. 7:33 AMzgr95 says:
If you want to be really safe you could always put a reverse current diode in there but of course you would have a voltage drop
May 24, 2010. 5:30 PMMr.Electric says:
If I add a cigarette lighter plug, will it be a "Carduino". Great Instructable! How many  ohms (Ω) will I need to change 5 volts to  2 volts?
May 24, 2010. 7:09 PMBIGBUG says:
If I add pedals to it will it be a Biduino?

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
Dec 3, 2010. 8:49 AMvectorges says:
If it liked both boy arduinos and girl arduinos, THEN it would be a biduoino
Jun 23, 2010. 11:02 AMMr.Electric says:
I actually found out that I could use a 330Ω resistor to run the component (a Radioshack Rectangular Led). But thanks anyway!
Jul 10, 2010. 7:12 AMlavert31 says:
Hey, it's very nice idea. but if i want it to be completely independent i need to be able to reprogram it without Arduino board, is it possible? thanks, Etay
Feb 6, 2011. 2:43 PMFoxtrot70 says:
Etay
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
Aug 16, 2010. 8:31 AMbigjeff5 says:
You can always add an FTDI chip to add USB and make it 100% functionally identical to the 2009 Arduino, or you can add a serial chip (like MAX232) to add RS232 (standard serial connection) and make it functionally identical to the older Arduinos.

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.
Jan 11, 2011. 10:52 AMdaviidv says:
I am going to make this without 7805 (I am using 3V batteries), do I need 10nF and 22uF capacitors? Or just connect battery straight to pin 7 and other pins, without 7805? Thank you, nice instructable.
Jan 21, 2011. 8:25 PMastroboy907 says:
i think the chip might have a 5v maximum input. im not sure tho... an easy hack would be adding a couple diodes (N4001? im not that good at diodes) before it goes into the pin.. should add a voltage drop of about 1.4 volts (with 2 diodes), so if you use 2 3v batt in series it will drop to 4.6ish volts :)
or you could just use 3 AAs in series, tht would work too
as for the caps, idk, i have the same question....
1-40 of 119next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
41
Followers
4
Author:jmsaavedra(http://jos.ph)