Instructables

UDuino: Very Low Cost Arduino Compatible Development Board

Featured
Picture of uDuino: Very Low Cost Arduino Compatible Development Board
Arduino boards are great for prototyping. However they get rather expensive when you have multiple concurrent projects or need lots of controller boards for a larger project. There are some great, cheaper alternatives (Boarduino, Freeduino) but the costs still add up when you need many of them.

This is a way, after about $25-$30 initial investment, to build sub-$10 Arduino-compatible boards with very little extra time investment on each.

Note that the basic idea here (Arduino on a breadboard) has been done for quite some time (e.g ITP Arduino Breadboard instructions); however the cable adapter build & usage instructions here help absolutely minimize the parts count for each core.

This project requires knowledge of soldering and basic electronics, and you should have at least some experience already with Arduino development. I don't suggest this as a first electronics project.

note: I pronounce uDuino "moo DWEE noh"

Added 02-05-08: (for pretty advanced folks) One of the tools I built with this is a logic capture tool -- kind of a basic logic analyzer. I developed this to troubleshoot communications links. Needs a gui interface, but doubt I'll get around to it any time soon. Still dang useful in the right hands.

Added 06-23-09: I'd like to point out the RBBB's from Modern Device for anyone who wants something with solder, but also super inexpensive -- especially if you get the bare boards and buy parts in bulk. Also their USB-BUB is a cheaper alternative to the FT232 cable.
 
Remove these adsRemove these ads by Signing Up

Step 1: Collect Parts for the Cable Adapter

Picture of Collect Parts for the Cable Adapter
I suggest getting parts from a mixture of Mouser, Radio Shack and Ada Fruit Industries; see the last step for parts sources. Feel free though to substitute parts from your junk box, and with the resistor/capacitors you can deviate a ways from the values and still have things work well (resistor I'd suggest between about 3.3k and 20k; capacitors I'd generally not go for smaller values but larger up to about .47uF should be fine).

For the cable adapter you will need:

- small bit of PC board (8 holes by 2 holes)
- a .1uf capacitor
- a 1x8 .1" spacing header, straight
- a 1x8 .1" spacing header, right angle
- some connecting wire

Step 2: Make the programming cable adapter

Mostly the programming cable adapter only needs to route signals from the FTDI USB cable to the right pins on the ATmega168 chips; however the capacitor is added on one set of pins to allow the Arduino software to reset the chips (the capacitor allows a short pulse to pass over to the chip's reset when the Arduino software flips the RTS pin).

To start, cut a piece of PC board with 9 holes by 2 holes. Then break off a set of 8 pins from the straight pin header strip, and a set of 8 pins from the right angle header strip (assuming you purchased the longer strips). See the parts picture to see what these should end up looking like.

Through the following steps please see both the attached photographs and diagrams for connecting up pins. The diagrams show much better where the connections need to go, but the photographs help to clarify board orientation, etc. If you have questions please mail me and I'll try to clarify anything that doesn't make sense.

Flip the PC board upside down so you can see the copper around the holes, with one of the long sides towards you. If, like I did here, you used a piece of PC board from the edge of the original, I suggest placing the side with the extra board material towards you.

Poke the bottom (short side) of the straight header through the holes farthest from you, leaving one hole empty on your left and solder the pins in place (see picture). Then poke the bottom (side with the bend) of the right-angle header through the holes closest to you, again leaving the hole on the left empty, and solder the pins in place.

Poke the .1uf capacitor's leads through the empty holes on the left and solder the capacitor in place. Trim the leads. Then solder each of the 2 leads to the header pin closest to it; one will connect to the leftmost pin of the straight header, the other to the leftmost pin of the right angle header. The easiest is probably to just create a solder bridge (melt enough solder to flow between the capacitor pin and the pin next to it, like in the picture). If you need to you can use a short length of wire and solder it to each of the contacts.

Create another solder bridge or connection between the 6th and 7th pins closest to you (third and fourth from the right). This is to connect the "CTS" pin of the cable to ground.

And create another solder bridge/connection between the two headers at the second pin to the right (connect the pin closest to you to the one farther away, just one pin over from the right). This connects what will be the VCC USB power jumper to the chip's VCC pin. This power connection will only be active when a jumper is installed.

Use a short length of wire to connect the rightmost closest-to-you pin to the fifth closest-to-you pin (it's fifth whether counting from the right or the left). This will connect +5 volts from the USB cable to the other pin of the jumper connector.

Now connect another short length of wire between the rightmost pin in the row farthest from you to the 3rd from the right pin in the row closest to you. This connects the cable's ground to the chip's ground.

Two more short wires to add: one from the second-from-the-left pin on the right angle header to the third-from-the-left pin on the straight header (note: since the leftmost holes have the capacitor installed in them, it will be the third-from-the-left hole closest to you to the fourth-from-the-left hole in the row farthest from you).

Second short wire will cross right over the first: from the third-from-the-left pin on the right angle header to the second-from-the-left pin on the straight header (fourth-from-the-left hole to third-from-the-left hole).

These wires connect the TX and RX pins of the cable to those of the chip. Unfortunately the ordering is opposite on the cable from the chip, which is why we need to have the crossed over wires.

Now you just need to plug the FTDI FT232RL cable in, with the green wire connected to the pin to the farthest left (the black wire will connect to the third pin from the right). The remaining two pins on the right are for a jumper; if the jumper is installed, the board will be powered from the USB cable, eliminating the need for batteries or a power supply. This jumper MUST NOT be connected when other power is connected to the board or damage to something (board, cable, computer) is possible.

That's it! You're ready to make some uDuino cores to program with the cable. (When using the programming adapter, the pin next to the capacitor connects to pin 1 of the chip)

Step 3: Decide whether to make absolutely minimal boards, or external-oscillator based boards

Picture of Decide whether to make absolutely minimal boards, or external-oscillator based boards
The decision of whether to build an oscillator based board is based around a few things. One, do you have access to an AVR programmer and the time to program a special bootloader onto your ATmega168 chips? two, can you do without accurate serial communication with the chip? three, is your application low enough impact that the board can run half as fast and everything will still work fine?

ATmega168 chips have an internal oscillator which can be enabled; it runs at about 8mHz, which is half the speed of most Arduino boards (with the exception of Lilypads). The internal oscillator is guaranteed to be calibrated to within 10% (which is not tight enough tolerance for guaranteed good serial communications). In my experience, the factory calibration at 5v has always been fine for uploading programs, but YMMV. I wouldn't use the internal oscillator for Important Things Which Need To Speak Serial, however. For blinkylights it should be just fine though.

Arduino chips with the bootloader pre-loaded that I've found always run at 16mHz, and these will require an external oscillator. If you don't have access to an AVR programmer, you will probably want to buy a pre-loaded Arduino chip. I highly suggest Ada Fruit Industries as a source.

Note that the oscillators really aren't all that expensive (generally $.50-$.75 at Mouser); they're just another part which is often not necessary, and the pin layout sucks for really clean breadboarded Arduino layouts.

Step 4: External oscillator-based board build

Picture of External oscillator-based board build
Collect the parts you'll need:

- Breadboard (you can of course build this straight on a predrilled PC board as well)
- ATmega168 chip with bootloader pre-loaded
- .1uf capacitor (ceramic, polyester, etc. doesn't matter so much; value .047uf-.47uf should be fine)
- 10K resistor (values ~3.3k-20k should work fine)
- 16mHz 3-pin ceramic oscillator (preferably with longish, e.g. 1/2 inch, leads)
- Short lengths of wire

Put the ATmega168 in the breadboard, straddling the center.

For each of the following connections, use the hole at each ATmega168 pin that is the closest to the chip that is open; this will leave the last hole in each of the rows 1-8 open for the programming cable to plug into.

Connect pin 7 and 20 with a length of wire (VCC to AVCC)
Connect pin 8 and 22 with a length of wire (GND to AGND)
Connect the 10K resistor from pin 1 to pin 7 (RES to VCC)
Connect the .1uf capacitor from pin 7 to pin 8

Connect the outer pins of the oscillator to pins 9 (XTAL1) and 10 (XTAL2) of the ATmega168. It doesn't matter which of the pins connects to which ATmega pin.
Connect the center pin of the oscillator to pin 8 (GND)

If you have power bus lines on your breadboard, I suggest connecting the + rail (red) to pin 20 and the - rail (blue) to pin 22. This is somewhat bad form (connecting to the analog side for power connections for other stuff), but if your breadboard is the same size as mine you've already filled all of the holes available for pin 7.


If you're planning to use USB power, you can now just plug in the programming cable and upload sketches to the board (make sure to connect the power selection pins on the cable adapter with a jumper to power the chip from USB).

Otherwise you'll need to use a battery/voltage regulator/etc. to supply power.

Step 5: OR internal-oscillator board build

Picture of OR internal-oscillator board build
Collect the parts you'll need:

- Breadboard
- ATmega168 chip
- .1uf capacitor (ceramic, polyester, etc. doesn't matter so much; value .047uf-.47uf should be fine)
- 10K resistor (values ~3.3k-20k should work fine)
- Short lengths of wire

Program the Bootloader with your AVR programmer:

You will want to use the lilypad bootloader (included in with release Arduino-0010, in the hardware/bootloaders/lilypad). Using your AVR programmer, flash the bootloader. For example, on my OSX system:

cd /Applications/Arduino-0010/hardware/bootloaders/lilypad
PATH=${PATH}:/Applications/Arduino-0010/hardware/tools/avr/bin
avrdude -C /Applications/Arduino-0010/hardware/tools/avr/etc/avrdude.conf -cusbtiny -pm168 -Pusb -e -u -Ulock:w:0x3f:m
avrdude -C /Applications/Arduino-0010/hardware/tools/avr/etc/avrdude.conf -c usbtiny -pm168 -Pusb -Uflash:w:LilyPadBOOT_168.hex -Ulock:w:0x0f:m
avrdude -C /Applications/Arduino-0010/hardware/tools/avr/etc/avrdude.conf -cusbtiny -pm168 -Pusb -e -u -Uefuse:w:0x00:m -Uhfuse:w:0xdd:m -Ulfuse:w:0xf2:m

Set up the breadboard:

Put the ATmega168 in the breadboard, straddling the center.

For each of the following connections, use the hole at each ATmega168 pin that is the closest to the chip that is open; this will leave the last hole in each of the rows 1-8 open for the programming cable to plug into.

Connect pin 7 and 20 with a length of wire (VCC to AVCC)
Connect pin 8 and 22 with a length of wire (GND to AGND)
Connect the 10K resistor from pin 1 to pin 7 (RES to VCC) *
Connect the .1uf capacitor from pin 7 to pin 8

If you have power bus lines on your breadboard, I suggest connecting the + rail (red) to pin 20 and the - rail (blue) to pin 22. This is somewhat bad form (connecting to the analog side for power connections for other stuff), but if your breadboard is the same size as mine you've already filled all of the holes available for pin 7.

If you're planning to use USB power, you can now just plug in the programming cable and upload sketches to the board (make sure to connect the power selection pins on the cable adapter with a jumper to power the chip from USB).

Otherwise you'll need to use a battery/voltage regulator/etc. to supply power. Note that you will want to always use 5v for programming via Arduino software; other voltages will cause the clock speed to vary significantly and will likely cause communication (and thus programming) to fail.

When you go to upload sketches to this style of board that uses the internal oscillator, select "Lilypad Arduino" from the Tools/Board menu.

  • 2008 10-02 FIXED -- was incorrectly put as pin 1 to pin 10 in original

Step 6: Connections for Arduino development

Note that the pins on an ATmega168 don't map obviously to the Arduino names.

atmega168 Arduino
2 Digital 0
3 Digital 1
4 Digital 2
5 Digital 3
6 Digital 4
11 Digital 5
12 Digital 6
13 Digital 7
14 Digital 8
15 Digital 9
16 Digital 10
17 Digital 11
18 Digital 12
19 Digital 13

23 Analog 0
24 Analog 1
25 Analog 2
26 Analog 3
27 Analog 4
28 Analog 5

Step 7: Some part sources

Note that I didn't use the specific capacitors & headers listed below in this instructable, so their appearance may vary slightly from the directions here. If you have any problems, please let me know.

- FT232RL USB cable
- Mouser: .1" spacing headers, 36 pin, straight -- break off 8 pins for cable adapter & use rest for other projects
- Mouser: .1" spacing headers, 36 pin, right angle -- break off 8 pins for cable adapter
- PC board for cable adapter
- Mouser:10K Resistors
- Mouser:.1uF Capacitors
- breadboards Pololu or Ada Fruit
- ATmega168 chips Mouser:unprogrammed or Ada Fruit:preprogrammed
- Mouser:16Mhz Oscillators

1-40 of 47Next »
daviidv3 years ago
Can i make this with ATMega 328 with Arduino bootloader? Can i connect it same way like this? And then can i use it like normal Arduino?
12150w4 years ago
If you already have an arduino and wish to use an ATMEGA 328 or 168 on a breadboard by itself, go to http://arduino.cc/en/Tutorial/ArduinoToBreadboard. You can use an arduino to not only load the bootloader, but also program the chip. If you already have an arduino this would be cheaper than buying or making an FTDI to usb device.
shaadmahmud4 years ago
here is how u can make an usbasp.. http://must-info.blogspot.com/ i tried a lot to use usbasp and make it in easy way
bigjeff54 years ago
If you're concerned about your oscillator tolerances, you should be using crystal instead of ceramic. 0.5% tolerance is much better than the internal oscillator, but crystal has 0.001% tolerance, and the cost is about the same (70c'ish). Plus, the crystal kind are only two pins, which are way, way easier to install on solderless breadboard. You can run 20mhz as well if you want, the ATmega can handle it (that's it's peak rated speed). Your timing functions will need to be adjusted to compensate if you do run it that fast, though.
tymm (author)  bigjeff54 years ago
Main reason I picked a 3-pin ceramic resonator is because it won't need extra capacitors (in a breadboard there will probably be enough capacitance for it to work anyhow -- though if moved to prototyping board the circuit may well stop working). Ceramic resonators give less accuracy, it's true... though for solid serial communications they're absolutely fine across standard temperature ranges, which the internal oscillator isn't guaranteed to be. And they actually are a bit cheaper, though it's true the difference isn't a big deal for 1-offs. But totally agree if higher precision is needed that a crystal is a better choice.
bigjeff5 tymm4 years ago
That's a good point. Excellent Instructible tymm.
12150w4 years ago
Can you use the FTDI basic breakout instead of the FTDI cable. The breakout brings out the DTR pin as instead of the RTS pin. It does have the same pinout.
tymm (author)  12150w4 years ago
You certainly can use an FTDI basic breakout -- from my understanding though, the DTR will work under Windows but not under OSX... in which case you'd have to just add a switch on the reset line (to ground) and manually reset when loading code, just like in the old days. It has been a while since I've tested DTR vs. RTS on Windows vs. OSX though. (And never played much with Arduino under Linux, so if that's your development platform... not sure).
celguero5 years ago
hi there:

thank you for the response. I am trying to build a Lilypad with theATMega 168.
I am drawn to make one because it involves a minimum number ofparts and can be quite small. I make toys, so the smaller theelectronics the better. I was wondering if you could give me some clueson wire it and also how to bootload it. Since all the surface mountATMega 168 do not seam to come bootloaded already.

THanks so much!!!

tymm (author)  celguero5 years ago
 i would actually start with the arduino pro mini schematic:

arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf

(note that you can find schematics & eagle pcb files for thestandard arduino boards on the arduino site).

For bootloading you'll need a programmer -- e.g. the USBtinyISP (fromAdaFruit) or the AVRISPmk II which you can get from e.g. mouser.com) --I prefer the mk II just because i've had reliability issues with thetinyUSB in certain situations.  with current arduino software,loading the bootloader is easy, pretty much just hooking the programmerto the ICSP connector, powering the board and clicking the "burnbootloader" selection from the arduino software (under"Tools").  You'll have to select the board type beforeyou do so to make sure it gets the right bootloader.
celguero5 years ago
hi there:

Is this the same chip as the one in the mini arduino. Would I be able to get the surface mount parts and wire the ATMega168 (square one)the same way? please let me know.

thanks!

tymm (author)  celguero5 years ago
  yep. just match up with the pinout in the datasheet for that package...

generally a good idea when laying out a board with an AVR to also add an in-circuit programming header. seewww.atmel.com/dyn/resources/prod_documents/DOC0943.PDF for the pinout on the standard connector. you can pretty much jump ahead and look at figure 2
clark5 years ago
I already have an arduino duemilanove, and i know you can pull the chip from the board and use it as is, so are the parts in step 4 the barebones stuff to simply run the board? I plan on programming my chips in my arduino and then placing them into a circuit.
tymm (author)  clark5 years ago
Yep; that's the very basics. If you're doing pro-level stuff (art installations, etc) it's a good idea to do some more decoupling (.1 uf capacitors between RESET & GND, AVCC & GND and the second VCC line and GND) but for this kind of a minimal setup things will generally run fine without.
clark tymm5 years ago
I'm having trouble finding an oscillator, if you could point me in the right direction, with a link to a mouser or digikey part, even a manufacturer part number that would help so much, thanks!
tymm (author)  clark5 years ago
Try FCR16.0M6 for cheap & easy... Actually "resonator" is the more precise name for these guys; i'm a bit loose with the terms (and apologize for that) but "oscillator" is more specifically used for the parts that have a circuit for creating an output wave in addition to the crystal/resonator/etc... so you hook up power and they directly spit out clock pulses (or sine waves, etc). the AVR processors have most of this circuitry built in so you only need a crystal or a resonator (and in some cases -- though not with the part mentioned above, since it has them built in -- a few capacitors), rather than a whole external oscillator for your CPU clock.
clark tymm5 years ago
fyi, on step 4, your 10k resistor is still going from pin 1 - 10
clark tymm5 years ago
Okay, thanks! btw, great instructable!
TechMidden5 years ago
Good work.
Do you know if this could be used to programme ATtiny MCUs? There's a fellow who has modified the Arduino IDE to support these devices. (See http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236434254).
Thanks,

TM

mubot5 years ago
i cannot get mine to work.... and i dunno why ... it's soldered up nice and clean...checked all pin connections with my meter .... i just cant seem to get it to upload a sketch.

im told the error im getting is a "generic" error, basically stating there is no connection between the chip and the computer

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

im using XP (tried on 2 machines same outcome)
i also tested on a mac using osx ...also didnt work...

im using a 2 pin 16mhz xtal with the pins going to the chip as well as being tied to ground via a 22pf cap on each. (couldnt find the 3 pin you used)

i was able to program the chip via ponyprog with my parallel programmer and the chip and parts seem to work just fine....

just cant get the darn thing to be seen with the ftdi cable/programming adaptor

thoughts??

=Rik
tymm (author)  mubot5 years ago
Which bootloader did you put on the chip? (with 16mhz osc you need the diecimila or similar, not lilypad)... did you make sure to set the fuses correctly when you programmed the bootloader (making sure to use an external oscillator)? generally for 16mhz arduino hfuse should be 0xdd, lfuse 0xff, efuse 0x00. if you hook up an LED between pin 19 and ground (long lead to pin 19, short lead to ground) does it flash when you apply power / hook up the cable?
mubot tymm5 years ago
i got the chip from sparkfun already bootloaded for the external OSC. yes, i do get the blinking when i hook up the cable...and when i remove the jumper i dont ... so it seems as if things are working at least that far.
tymm (author)  mubot5 years ago
Can you verify that you've got the Diecimila selected in the "boards" selection under "tools"? Under windows, also see the next comment -- that apparently the auto-reset doesn't work by default -- you shouldn't have this problem under OSX though.
mubot tymm5 years ago
Duemilanove is selected as my board.....and since i have other arduino chips that i use... my "Set RTS On Close" is enabled. i have tested on a mac..no luck there either... i really appreciate your assistance!
mubot mubot5 years ago
got it working.... tried again after ordering another pre bootloaded chip and it worked great!!!! turns out there was an issue with the bootloader that was burned to the original chip i was testing.....
tymm (author)  mubot5 years ago
Great; thanks for the update!
joetronica5 years ago
my uDuino works, but i missed the AUTO-RESET feature. when i will upload sketches: first time it works fine - later nothing is happen. the arduino IDE give me some error messages. i think the solution is: the FT232RL USB-TTL cable not provides the DTR-line (used by standard arduino for autoreset) but provides the RTS-line (green wire). for use the FT232RL USB-TTL programmingadapter with the uDuino set on the Device-Manager (for example WinXP) the following modification: / USB Serial Port (COM...) / Port Settings / Advanced Settings / ENABLE: Set RTS On Close that makes a short low impulse on the RESET-pin by starting upload sketches. AUTO-RESET works!!! uploading sketches works anytime!!! YAAAH Johannes
tymm (author)  joetronica5 years ago
cool! i've been using OSX and it seems to work fine with the RTS line as reset without any changes, but it makes sense that Windows might do things differently; thanks for the workaround info.
mubot5 years ago
would any changes need to be made if i was using a FTDI model TTL-232R-5V cable instead?
tymm (author)  mubot5 years ago
nope; the 5v is the same one. the 3.3 v cable also works fine from my experience
dnhoshor5 years ago
Your project has inspired me try my hand at this interface. I'm waiting on the headers. Thanks for the idea!
Maniacy6 years ago
Oh c'mon! This is like THE tutorial I was looking for, plug'n'program... and then you give me this photo? Seems as if would have to figure it out by myself after all... Good tutorial anyway, thx!
gib0r Maniacy5 years ago
Read a datasheet.
Bongmaster6 years ago
i just noticed a bit where u say to connect the resistor between pins 1 and 10 wen it should be 1 and 7? a typo methinks? ;) altho it does still work if ure not using an external osc or crystal., but its prolly not good :P
tymm (author)  Bongmaster6 years ago
You are absolutely right -- sorry about that. Correcting it now.
Bongmaster tymm6 years ago
no probs :3 it just occurred to me after making a circuit including it :P i will correct the circuit (that has been working as lilipad for months) too :D
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
cr0ybot6 years ago
Added to Arduino Group! ;D
tymm (author)  cr0ybot6 years ago
cool -- btw i would really like to get feedback from anyone who's built one to make sure that it all makes sense. and if anyone runs into any difficulty, i'd be happy to try to explain any hard parts and help get it working.
Bongmaster tymm6 years ago
works ok with me. i got one running now with a 22 MHz crystal to see how it would run (just blinking as its an old chip that went wrong and i managed to upload a new bootloader to it. but it wouldn't take any sketches, will try burning one via the programmer cable next time) it's running from usb power direct to chip and its cold (had it on 16 MHz all night and its still stone cold) Seems happy with 23MHz but i want to try it with another sketch if i can get one on there :)
1-40 of 47Next »