uDuino

Date December 20, 2007

Picture of uDuino Mk 1

So I’m the kind of person who likes to start lots and lots of projects at once, get some prototypes going, leave them sit for a little bit and come back to them. Arduinos are great in a lot of ways, but they tend to be kind of expensive resources for this kind of thing.

I looked at the Boarduino (and actually just picked up a few PCB’s); they seem great but still a little more than I want to spend for tons of these things.

With the internal oscillator it’s possible to cut down on parts (with the internal oscillator there are 2 main drawbacks: one, you get half the speed… this means you can’t do as much stuff in the same period of time. second drawback: the timing isn’t as accurate; especially serial communications might not be reliable across all ranges of temperature & voltage).

And breadboards from All Electronics are cheaper than about any other Arduino prototyping setup…

A programming adapter was easy to build with a small piece of proto board, a capacitor, a straight header and a right-angle header to connect an FTDI usb-to-ttl serial cable

With this setup, you just need 2 wires, a resistor and a decoupling capacitor to do Arduino development (at 8 mHz).

The basic instructions (if there’s interest I’ll break this down farther to make it easy):

Pre-setup:

- Compile the Diecimila bootloader for 8 mHz operation
- Burn the bootloader to the atmega168 chips you plan to use (fuse settings: H 0xdd L 0xf2 E 0×00)

Settling in the atmega168:

- Plug the atmega168 into a breadboard.
- Connect a wire from pin 7 to pin 20 (VCC to AVCC).
- Connect a wire from pin 8 to pin 22 (GND to AGND).
- Connect a .1uf decoupling capacitor from pin 7 to pin 8.
- Connect a 10k resistor from pin 1 to pin 7 (RES to VCC).

Building the Programming board:

- Cut 2 rows x 8 holes of pre-drilled PCB with pads
- Solder straight 1×8 header into 1 row
- solder right angle 1×8 header into other row
- orient the board with the right angle pins pointed towards you.

For following instructions we will consider pin 1 of each header to be the pin farthest to the left.

- solder a .1uf capacitor from pin 1 of the straight header to pin 1 of the right angle header.
- solder a short length of wire from pin 2 of the straight header to pin 3 of the right angle header.
- solder a short length of wire from pin 3 of the right angle header to pin 2 of the straight header (crosses right over the last wire).
- solder pins 5 & 6 of the right angle header together (or connect with short length of wire). Also connect a short length of wire from these two pins to pin 8 of the straight header.
- solder pin 7 of the right angle header to pin 7 of the straight header.
- solder pin 4 of the right angle header to pin 8 of the right angle header.

To use the programming board, plug it in to the breadboard with pins 1-8 of the straight header connected to the respective pins of the atmega168. Plug the usb-to-serial cable into pins 1-6 of the right angle header on the programming adapter, with the green wire connected to pin 1. Pins 7 and 8 of the right angle header can be jumpered to supply +5v from the programming cable to the uDuino (or disconnected if the uDuino is powered from another source).

To upload sketches to the board:

- Select “LilyPad Arduino” from “boards” in the “tools” menu. Then upload sketches to the board like you normally would.

Pin mapping:

note: if holding chip with notch facing left, pin numbers go counter
clockwise from the notch, starting with 1 right below the notch.

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

(other side, 15 is farthest from notch, at top)
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

So after an initial investment of under $25, you can put together cores for breadboard-based Arduino prototypes for $8-10… the Diecimila auto-reset works… and you actually get 2 I/O pins out of the deal (though currently you have to know how to use them without digitalRead/digitalWrite/etc)…

If you want to add another dollar or so to the cost you can also use a ceramic oscillator, which will give fine serial port usage into much wider temperature ranges. You will have to adjust the fuse settings accordingly, however. This also requires a few more wires added to the board, something I was trying to avoid with this setup.

Another nice thing about the programming cable is, since it just connects to pins 1-8 of the atmega168, you can just add a 1×8 socket to pcb designs, right next to the ’168 to have a quick way to hook up and do in-system bootloader-based programming.

p.s. uDuino design (if there’s even enough to call it a design, or license it) is under the Creative Commons Share-alike license.

12-21: Adding (so far untested) Eagle schematic & board for the programming cable adapter. Just solder a straight header into the atmega168 side & right angle header into the cable side, and a .1uF capacitor in for C1.

The cable plugs into the first pins on the cable side; the green wire should be all the way at the end, towards the side pointed to by the “green” arrow. The cable does not plug into the 2 last pins on the side of the black wire.

Add a jumper on these (“USB Pwr”) pins if you want to power the uDuino from USB.

Note that when in use, you should be seeing the bottom of the board (and able to read the text); the pins stick out the other (blank) side of the board.

Also note that this board won’t pass DRC with the standard rules. At least for me though it prints out fine. I could move the text to the silkscreen layer & reorient to make things happier, but I figure it’s actually nice for home etchers to have the text in copper.

You really only need a single layer PCB for this.

17 Responses to “uDuino”

  1. TikiRobot!, Mai Tais and Blinky Lights, Ahoy! » uDuino: low-cost Arduino said:

    [...] has developed a low-cost, breadboard-based Arduino. His Diecimila-compatible design separates the programming adapter (which you only need one of) [...]

  2. rajbot said:

    This guys have elcheapo breadboards: http://www.pololu.com/products/misc/0350/

    Have you done any DMX512 stuff? I remember you were working on RGB home lighting at one point.. What control protocol did you use?

    Also, were you doing PWM or analog dimming of the leds? Were you able to dim the leds enough with just analog dimming?

    -raj

  3. tymm said:

    wow, I thought All had all the cheapest breadboards… nice find!

    i didn’t really get into DMX512 — was trying to do something with an even lower per-drop cost, though dmx would likely have been a better choice — the project unfortunately got bogged down & never was completed. the pwm vs analog thing was one of the big issues (since at the time most of the pwm chips i was working with were too slow & i hated the rainbow-in-peripheral effect); i set up controls w/ad5206′s with transistors set up as current sources on the outputs. it did work relatively well as i recall, but never made it past prototyping.

  4. rajbot said:

    Ah yes, the ad5206. I was thinking of using the same. Being able to daisy chain SPI devices is a big plus. I wonder if doing analog control will mean I won’t be able to get the leds as dim as I would like. I was thinking of making daisy-chainable SPI pwm devices around a AVR tiny15 (I have a bunch of them).

    Check this out: LED candles that you can blow out.
    http://www.thinkgeek.com/gadgets/lights/94ce/?cpg=cj

  5. tymm said:

    when i get home from break i’ll try to re-breadboard my old setup… daisy chainable spi pwm devices would be really nice though — i probably should have done something similar for the lighting job. or 1-wire…

  6. George said:

    Well, you have convinced me to jump in and start playing in the pool. I remember looking longingly at basicstamp years ago, but couldn’t justify 100+ bucks to start playing with micros, and Arduino has been looking good, but knowing my track record with burning up components on first revs, I had been holding back on that too, but UDuino seems just about right, I can get a half dozen and start playing around with code and sensors in a very basic and economic setup. Please take a look at what you have written up so far and make sure that a newbie can get there from what you’ve posted.( I guess this is my way of asking if you have any more to add as you stated above “if there is any interest, I will break this down and make it easy”) I am new to micro processors, but a veteran electronics hobbyist with discretes.
    Thanks for posting your work,
    George

  7. tymm said:

    Thanks for the comment — I spent a bit of time cleaning things up for the Instructable I posted http://www.instructables.com/id/uDuino-Very-Low-Cost-Arduino-Compatible-Developme/ — for which I spent more time on some of the basics. The most difficult part, I think, is if you decide to program your own bootloader — though going the pre-loaded chip route (at least for the first few builds) should make it a lot easier to start. Normally I’d suggest getting a regular Arduino and playing with it for a bit before going for a DIY build (or at least a Boarduino); just so you get something you can be pretty confident works & so you’re not both troubleshooting & learning at the same time… but if you’re comfortable working with electronics, it shouldn’t be too bad to jump into. I’d start with say an LED blinking project first though, to make sure you get everything up & working right, before going on to more difficult setups. Good luck & let me know if you run into any issues.

  8. simon said:

    Hi,
    Ive followed your Instructable, spend a day checking and measuring if everything is well connected, but when I try to upload i keep getting:
    avrdude: stk500_recv(): programmer is not responding
    I’m using osx 10.5, an atmega168 and arduino0013 alpha, and am trying to upload Blink example.
    I’ve tried all the serialports and boards, also tried the change of boards.txt at
    http://www.creatrope.com/blog/make/uduino-arduino-board-support/
    But keep getting the same error. Would you have an idea what I’m doing wrong?

  9. tymm said:

    Just to be sure —
    1) do you have a chip with a bootloader programmed on it?
    2) if you have a standard bootloader on the chip, do you have an oscillator connected? otherwise did you make sure to upload a bootloader that doesn’t need one?

    It could certainly be a couple of different things, but that’s first bit to verify.

    i’d then take a meter and make sure that you’re getting power to the chip (should be 5v between pins 6 & 7). also assuming your LED is hooked up to pin 19 (Digital Pin 13), it should blink when you first connect the USB cable, when the bootloader starts. (of course long pin of the LED should go to the m168′s pin, short pin to ground).

    if this doesn’t help, maybe if i saw a picture of how you have things wired up it would help. you can email me at tymm with an othy attached to the end at gmail. (no spaces, underscores, etc, in the address).

  10. simon said:

    Hi,
    Thanks for your quick reply! The led didnt blink on plugin it in, so I realized that something might have gone wrong with the bootloader step.
    From the Instuctable, I reckoned that the three avrdude commands you describe would put the bootloader on the atmega168. But, I had to get the booloader on myself (which I did through finding the lilypad bootloader folder, then compiling the file by changing Makefile to my avr-isp settings, and using make install. Now it works: BRILLIANT!

    I’m not sure why I thought the bootloader would already be on, but is it necessary to do both steps (the three avrdude commands from your instructables, and the Makefile?

    One thing I want to ask: I bought two cables for this, the USB TTL cable, and an AVR ISP cable. First I’ve uploaded the bootloader with the AVR cable, and uploaded the Arduino sketch with the USB TTL cable. Is it really necessary to use both, or can one of these tasks also be done by the other cable?

    Thanks so much again!

  11. simon said:

    This is by the way a useful diagram for the Pin Mapping table above:
    http://arduino.cc/en/uploads/Hacking/Arduino-To-Atmega8-Pins.png

  12. tymm said:

    With newer versions of the Arduino software I believe skip the bootloader & use an AVR programmer instead of the serial cable. Honestly I haven’t really played with that though, so you’d have to look around for the instructions on how to do it.

    On the bright side, though, the bootloader step is a lot easier now — from the newer Arduino software, there’s a menu item under tools to burn a bootloader using an ISP programmer, so you don’t need to deal with the command line bits.

    I’ll also check out my bootloader burning bits & verify all the steps are there.

  13. Doug said:

    Hi – This barebones stuff looks really great. You seem like the kind og guy to ask: would it be problematic to built a duino clone using an ATmega32? I have about 20 of this chips salvaged from some damaged brushless DC motor controllers for borehole pumps. I have an STK 500 kit, so have been able to check that they aren’t fried – some were. Anyway – I thought since the ATmega32 has a superset of the ATmega168 functionality, I might be able to substitute it, but then I guess the firmware won’t work, will it?

    Nice blog – thanks.

    Doug

  14. tymm said:

    It would likely be possible, but probably a bit of work — i suspect it would have to be a merging between the atmega168 and atmega8 code, since the atmega32 has older revisions of many of the peripherals (more similar to the atmega8)… though it’s been a while since i’ve really been through the datasheets to do in-depth comparisons. You would need to do work on both the bootloaders and the Arduino core code.

    It does seem like the Arduino IDE software is more amenable now to being tweaked to support more chips than it used to be though, especially since the atmega328 support has been included.

  15. MyArduino » Arduino Variants said:

    [...] uDuino [...]

  16. S said:

    Hi Tymm,
    I was trying a few things with Arduino’s built in capacitance sensing (arduino.cc/playground/Main/CapSense), but couldnt get it to work on uduino – is that because there are components on the Arduino that miss on the uduino?
    Many thanks

  17. tymm said:

    That’s not really too surprising — breadboards have a lot of stray capacitance. it’s generally best to do cap sensing with real PCB’s instead; they don’t have all the extra metal and plastic that will cause problems. even having the chip plugged into a breadboard and having all the circuitry off the board would likely be problematic.

    you could probably hand-build an arduino clone on a Radio Shack, etc. PCB and have it work though.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>