How hard would it be to build an Arduino?

I recently assembled the Really Bare Bones Board, pictured below. It's an Arduino clone in a smaller and more affordable package.

The board is $12, which is a great deal. But I want to lower my costs as much as possible. During a 3-hour car trip today my mind was racing with ideas for potential robots, and I began realizing that for the projects I want to do I'm going to need multiple embedded microcontrollers. What's more, each microcontroller board will need different appendages ... some with their own voltage regulation, others with motor controllers, some won't need analog input, and some will need LED's while others won't. I like the idea of having each board with its own specific functions and abilities, rather than wasting money on an all-around package with some things I don't need and lacking something I might need.

Anyway ... the point is that it might make more sense for me to buy ATMega168's with the Arduino bootlegger and make my own microcontrollers. Problem is ... I'm not entirely sure how to do that ... so maybe you guys can help me out?

Ok so here's what I know I need: The ATMega168 needs a steady supply of 5 volts. That's easy enough to pull off with a voltage regulator and a couple of capacitors. Next up is the resonator ... which I have a fairly good understanding of. I know what pins to connect to, anyway, which I guess is all that matters. Next up is a test LED, which of course is super easy. And lastly the reset button, which I'm sure I can figure out.

Other than that, though, I don't know what the microcontroller needs to do its thing. Looking at the RBBB, I don't know what all that stuff does. What are the two capacitors for, for example? There are two 47uF capacitors and I don't know what they do. Does it allow for analog input via a resistor-capacitor circuit? What about that diode there? Is that for blowback voltage? How about those resistors? And lastly ... I'm very embarrassed to say I don't even know what the blue thingies are. I'm assuming they're capacitors, but I could be wrong.

Thanks for helping out a beginner! Sorry for the big blocks of text ... there's just so much I still don't know!!

Two more things …

I ran across this …

http://blog.makezine.com/archive/2007/07/barebones_arduino_on_a_br.html

So … this Arduino has no capacitors. If it can function without them, then what the heck are they for?

Also, this is the RBBB schematic. It kinda … sorta … helped me. Well really it just confused me further.

http://moderndevice.com/Images/RBBB_revB_800px.gif

Probably just smoothing

Probably just smoothing capacitors of some kind.

All you really need is the chip and bootloader, resonator or crystal, and a steady 5v. A reset switch and pullup resistor are good too.

Heres an arduino on a breadboard.

 

There is a website around where they show you how to use an arduino to write the bootloader to other atmega168s so you don`t even need a programmer.

Another standalone writeup

Here is another writeup about making a standalone Arduino.

 

http://art364.pbwiki.com/Standalone+Arduino

 

Ok so then the most

Ok so then the most affordable option is probably to just focus on the resonator and a steady +5v, and then program the Mega168 in a real Arduino.

A handy guide … I hope

Ok so voodoobot pretty much answered all my questions in the shoutbox, but I’ll leave this topic here in case anyone else has something to add.

Meanwhile, I (and voodoo) am seeking out a way to make an absolute bare minimum Arduino for under 5 dollars. Not sure if it can be done, but I’ve started researching ATMega168-20PU prices, since it’s the most expensive component. I’ll post my findings here as I continue to search.

$3.30 - http://www.onlinecomponents.com/product/3588566/ - A great deal. Free ground shipping, too. Unfortunately … $35 minimum, so only worth it if you order a bunch of other stuff from them (or 12 ATMega’s). Maybe worth a one-time investment to have a whole bunch of chips on hand?

$3.35 - http://www.sureelectronics.net/goods.php?id=717 - Shipping to California calculated at $4.18.

$3.68 - http://store.fundamentallogic.com/ecom/index.php?main_page=product_info&cPath=4_7&products_id=16&zenid=94c85636ee14e7f5cf827a12183e7458 - Calculated shipping to California was $2.27.

$3.90 - http://www.seeedstudio.com/depot/atmega16820pu-28pin-dip-w-arduino-bootloader-p-55.html - My shipping (to California) was calculated at $2.58 for one chip.

$4.11 - http://parts.digikey.com/1/parts/552130-ic-avr-mcu-16k-20mhz-28dip-atmega168-20pu.html - Couldn’t see shipping costs without entering my payment info.

$4.95 - http://www.sparkfun.com/commerce/product_info.php?products_id=8846 - If you’re already ordering from SparkFun, it’ll be more cost effective to throw this in your basket and pay a bit more for the product itself. Plus, you don’t have to worry about burning the Arduino bootlegger. Not to mention … who doesn’t love SparkFun?

$3.23 - https://emwcs.avnet.com/webapp/wcs/stores/servlet/Product_-1_500201_500201_part_0_3591975 - Don’t be fooled by the low price … shipping is $8.00.

Thanks … looks like that’s
Thanks … looks like that’s the most affordable option with shipping. Added to the list.

I’ve got another question
I’ve got another question (I’m full of 'em). If I use multiple Arduinos in a single project, can I use the same 5v battery supply (a 9v batter hooked up to a voltage regulator) for powering all the Arduino’s? This is assuming of course that I’ll have a separate power supply for high amperage functions like motors and such. So if it’s just powering the Arduinos and nothing else, does a 9v battery regulated at 5v have enough amperage to power, say, 3 Arduinos?

I would say check the

I would say check the battery mfgr to know how much A the battery puts out as they are most likely different for each.

I keep looking at the radioshack 9.6v rc race pack batttery(comes with charger). I think it’s 1400Mah nimh and would be perfect for powering several Ardys and other components.

As a side, I’m powering 3 picaxes and motor driver from a 9v(6AAA)battery pack. This pack is for servos, motor, sensors and uprocs.

I’m wondering if the

I’m wondering if the resonator would work more easily than the crystal. I tried buildng the setup mentioned, though with caps instead of without, and wasn’t able to get things to work when usng a crystal. once soldered though, the crystal worked fine. I tried this on two different breadboards with two different ardys and 2 different crystals…(plus the 22pf caps).

 

Those AAA’s have a lot more

Those AAA’s have a lot more current than a 9v, though. I just like the convenience and size of a single 9v battery.

Any idea how much current an arduino draws on average? I’d test it but like I said I’m out of town right now.

I just tested this out
I used 2X RBBB’s and one normal Arduino powered off a single 9V. They were just running a simple blinking LED sketch but they all were running.

Solderless breadboards as caps
Because the conductors are relatively close on a solderless breadboard, they tend to act a little like capacitors. Higher frequency (MHz) stuff tends to stop working on these, but can do better on a soldered breadboard.

Datasheets

The 374 page manual on the Mega168 says on page 304 tha they burn about 12 mA with an 8 MHz clock, running active. This wouldn’t include any pins being driven, as in switching and PWMing something. The resonator is negligable, probably under a mA. The real power hog would be a linear LM7805 regulator, pulling 5 to 8 mA while also burning off the excess 4 volts from the 9 to get 5 volts. An Energizer 9v shows to be able to deliver up to 500 mA for a little bit, though I’ve never heard of such a thing. I had believed they were typically good to about a 150 mA, but I guess a lesser internal resistance could allow more.

The Arduino has a few other bits and pieces, RS232, LEDs that also would pull some more mA, depending on what they were.

ya know, I saw that table,

ya know, I saw that table, but it seemed low for a uproc. Of course looking at the other tables, it shows the current consumption for the proc in “active mode” at 16 mhz to be around 10ma(p317).

Anyway, this link has some data on running off of a battery and doing some simple tasks.

I know this isn’t scientific
I know this isn’t scientific in the remotest, but I’m going to test a 9v battery by hooking up 1 arduino, running the blink app on 2 pins, a bs2 stamp(with temp sensor) doing serial com via a bluetoooth adapter, my current picaxe project(3 procs communicating via serial link) and 2 more picaxes communicating via serial IR. It’s mostly hooked up, but I have to go to work now…so in a few hours I’ll try it.

So this worked. as I said,

So this worked. as I said, just for the heck of it I’d try the above.

To clarify a couple things. the ir transmitter sends 9 sequential bytes every 500ms. an ir led is set up to picup the serial data and blink when sent. the receiver just sends debug data when receiving the bytes of data.

The bluetooth transciever is a bluesmirf rn41(from sparkfun) and uses about 40-50ma to send receive data.

it sends data(current ambient temp from a ds1620) every 1.5 seconds. It is also set up to recieve and respond based on data sent.

multiproc.jpg

 

so a 9v battery can do a decent job of keeping a bunch of procs running and doing varios tasks...but for how long, I don't know...

 

Pretty cool info

That guy on the link did some very extensive testing.

One micro I’d been told was very easy on power was the Texas Instruments MSP430 series, had some demo running forever off a coin cell, something about using microamps rather than milliamps. Thay have a USB try tool for $20. And Atmel has their AVR Butterfly (a very fun toy) that is also powered by a coin cell, runs a Mega169 I think, and has a lot of cute apps running on it for about $20 too.

Hi. I hooked up an uA meter

Hi. I hooked up an uA meter and measured it for you. My arduino With one power LED, and 13pin led blinking consumes 25 mA. My SuperHiperMegaPowerMadeinChina V 6F22 NiMH accu is rated at 250 mAh (that of course isn’t true - I guess it’s really about 125 mAh - I guess I once checked it on my RC plane uC charger). Since batteries tend to have slightly larger capacities than rechargeable batteries, let’s assume that a 9V 6F22 duracell will be 250 mAh indedd. This means you can draw 250 mA for one hour or 25 mA for 10 hours. Of course the actual time may significantly differ as the 25 mA current draw measurement was very inaccurate. Also other factors such as temperature have some influence here. Anyway according to these calculations you should expect a couple of hours from your battery. You may also power your Arduino of 4xAA pack, omitting the 5V voltage regulator (which wastes plenty energy) on the board. You may connect the 4x1.2 rechargeable battery pack 4.8V directly to 0V and 5V pins on the board (but 4x1.5=6V from non-rechargeable AAs through a diode which will give you 0,7v step-down) . There are many brands of AA rechrgble batteries with capacities of up to 2500 mAh. And that’s of course 10 times more than you can get of a 9V batt. Such thigs as RF equipment, motors and servos dain quite a lot. So 9V batt would not be the best solution in this case.

 

Well, as long as a 9v can
Well, as long as a 9v can handle it, that’s my main concern. Thanks for the info, voodoo!