Perfboard Hackduino (Arduino-compatible circuit)

 by jmsaavedra
Featured
4581970623_e45d53a13a.jpg
Hackduino3_schem4.jpg
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 1: Gather Components and Tools

4582596590_8031a34c6a.jpg
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

1-40 of 138Next »
jameskirk says: Mar 16, 2013. 8:01 PM
I'm a really really big newbie here...
How can I hookup female header pins on the board to hook my projects too???
Thank You
jasshopper in reply to jameskirkMay 18, 2013. 9:54 AM
search for the pin outs of atmega168 and connect the female headers to the digital and analog pins.
jameskirk in reply to jasshopperMay 18, 2013. 11:28 PM
There are 14 digital pins and 6 analog pins does that mean i should connect one to all of those???
here is a pic of one does that mean i should connect a header pin to all of them???
Thank You,
Mike
atmega168_pinout.png
jasshopper in reply to jameskirkMay 19, 2013. 10:27 AM
well, i'm not a pro in arduino, so i guess you should connect to all pins. but its best of you to search more.
tomtiki says: May 17, 2013. 11:04 AM
For a few more dollars ($12 instead of $7.39), check out the shield compatible Diavolino : http://evilmadscience.com/productsmenu/tinykitlist/180

If you don't need shield compatibility, use a ATMegaXX8 target board for $3. They also sell the Atmega chips with the bootloader installed for $5.

Just a happy customer.
jasshopper says: May 15, 2013. 3:59 AM
can you use this to make a led cube? if yes where are the point to connect it to this?
2cool4me4 says: Apr 3, 2013. 7:22 PM
Oh, no! It appears that I just deleted the 22pF capacitors (you had to order them in quantities of 2000 or more), and Mouser won't let me add them back! Is this a problem that just pertains to me, or did I just screw everybody up?
The nerdling says: Mar 4, 2013. 3:16 PM
i have the same ic puller :)
arduino-tester says: Feb 11, 2013. 5:23 AM
i made mine with help of http://www.jo3ri.be/tutorials and it is working greate. It just starts when i press tectile switch and stops after 1 min with blinking led example.... what could be one for continuous loop ?
100213-1630.jpg
theugleymonkey says: Nov 16, 2011. 6:44 AM
How would i add an FTDI chip to this so I could connect it via usb?
thegrendel in reply to theugleymonkeyDec 13, 2012. 10:49 AM
Too much hassle. The FTDI IC is a surface-mount chip
with *very* small leads. It's much easier to install a 6-pin
programming header, connected to Rx, Tx, +5v, Gnd,
and reset. That way you could use an FTDI breakout
board or cable.
delinquentme says: Apr 29, 2012. 12:00 PM
Hey there!

I'm wondering if you happen to have a way to upload sketches to these chips without having a duemilanove to pull and place chips in.
SpaceShipOne in reply to delinquentmeAug 2, 2012. 8:53 PM
If you look at the pinout diagram, notice that pins 2 and 3 are RX and TX , respectively. You can program the atmega while it is installed by hooking up a FTDI cable (ie. USB to serial) to those pins in this order:

FTDI TX to Atmega RX
FTDI RX to Atmega TX

The power and other lines can remain disconnected.
Gofilord says: Jan 4, 2012. 5:15 AM
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!!
gankoji in reply to GofilordJul 8, 2012. 11:29 AM
Sparkfun makes a really great, easy to use ISP programmer: http://www.sparkfun.com/products/9825. 14.95 is about as cheap as an FTDI combo gets these days. Of course, you will have to add a pinout on your hackduino board to get to the 6 pins necessary for ISP. You can find ISP standard pinouts, and which pins on the AVR correspond to those ISP pins, in your datasheet and/or Atmel's online resources for its programmers, like the AVR ISP mkII or the AVR Dragon.
Anianna says: Jun 27, 2012. 11:47 AM
I am a complete newb with Arduino and I would like to thank you for showing me how to reduce the cost point so that I can reasonably get myself and four kids actually working on projects. The Uno boards cost way too much to get a family all learning and building. That said, I have a question regarding the microcontroller chip:

The Sparkfun link you provided leads to an earlier model they are no longer producing and there is a link to a more recent product. I tried to find the more recent product on Mouser, but their ATMega chip listings do not mention the Arduino bootloader. How do I know which chips on Mouser will work to build an Arduino compatible board?

Forgive me if this has been asked or answered already. I glanced through the comments and did not see it.
eboily says: Oct 11, 2011. 10:16 AM
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
wrecks135 in reply to eboilyJun 24, 2012. 1:31 PM
The pictures look that way to me to...I'm also not sure why the 22uf cap is all the way on the far side of the board instead of right up next to the power supply section of the board. Does that make a difference?

From my research it looks like the electrolytic cap should go input to ground and the ceramic cap should go output to ground
ovan der beek in reply to eboilyJun 4, 2012. 3:24 PM
Thats what he did
wrecks135 says: Jun 24, 2012. 11:12 AM
Can you explain how your power supply setup is different than the one shown on this project:

http://www.instructables.com/id/DIY-Arduino-or-The-DIY-Duino/step18/Putting-it-Together/

The linked project seems to have a cap bridging the input and ground in front of the 7805 and then the ground and output after the 7805. Your schematic doesn't seem to follow the same pattern. Your cap (the 103) comes after the regulator and then there is another cap after the ATmega. I'm confused.

I'm a total noob at this so I'm just trying to learn the different options and understand how it works. Can you explain the difference and maybe the pros and cons of one way vs. the other?
Cloudhail says: Mar 25, 2012. 4:56 PM
There is a website www.fritzing.org you might like the free program for circuits. Very good instructable! Also thanks for the buy mouser for parts! I use eBay but I might start using them!
LeumasYrrep says: Feb 24, 2012. 5:24 PM
I love your Instructable and have found it to be very useful when finishing up my electronics projects. I just wanted to point out an improvement that save a lot of unnecessary wire and time.

I moved the voltage regulator to connect directly to the center voltage rails. This way I hook the power input to the left side of the regulator and place the negative power connection directly on the negative voltage rail. Saves me from placing those two extra wires looping around the regulator and frees up a large bit of real estate to add more components. I also connected pin 7 to the positive voltage rail on the underside to clean up the top a little bit. Power is distributed to the reset resistor from this connection.
DSC05972.JPGDSC05973.JPG
joshua.zajac says: Sep 28, 2011. 8:38 PM
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?
jmsaavedra (author) in reply to joshua.zajacSep 28, 2011. 9:45 PM
i know that ATMegas have an internal crystal. i believe that when no external crystal is used, the chip defaults to using that. the arduino and most compatible circuits use an external crystal with caps because it's far more reliable and accurate. this might become apparent if you use the millis() function and compare it to actual time passed... i'd predict the internal clock to be inaccurate over time.

also, i believe you're using the wrong capacitors. it's 22pF (picofarad), not 22uF (microfarad).

hope it helps
sbonkosk says: May 3, 2011. 6:36 PM
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?
SmokeGSU in reply to sbonkoskAug 19, 2011. 11:13 PM
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.
dumle29 in reply to SmokeGSUSep 18, 2011. 2:43 PM
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
SmokeGSU in reply to dumle29Sep 18, 2011. 8:43 PM
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!
Spyvingen says: Aug 29, 2011. 1:46 PM
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?
xl97 says: May 23, 2010. 8:42 AM
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
cybersean3000 in reply to xl97Mar 17, 2011. 8:49 PM
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

BlueLiner19 in reply to xl97Mar 10, 2011. 2:10 PM
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
Mr_Electric in reply to xl97May 23, 2010. 6:56 PM
 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.

xl97 in reply to Mr_ElectricMay 23, 2010. 8:00 PM
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
jmsaavedra (author) in reply to xl97May 23, 2010. 8:17 PM
So, that post you are looking at was written in 2006.  I actually think that it should still work with the current bootloader file (which has undoubtedly been updated since then) but I really think you are making things harder on yourself than they need to be.  A $30 ISP (In-System Programmer - aka a device that can bootload chips) is a freaking great deal.  If you REALLY don't like the idea of using an Arduino to do this, then I recommend Adafruit's USBtinyISP AVR programmer (it's a $22 kit).  There are tutorials that are up to date and super super super understandable.

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.
xl97 in reply to jmsaavedraMay 23, 2010. 8:43 PM
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.

bigjeff5 in reply to xl97Jul 11, 2010. 1:36 PM
"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.
xl97 in reply to bigjeff5Jul 11, 2010. 7:01 PM
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.
bigjeff5 in reply to xl97Jul 12, 2010. 3:33 PM
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.
xl97 in reply to bigjeff5Jul 13, 2010. 7:00 AM
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..
1-40 of 138Next »
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!