Replacing the UNO with tiny boards like the Pro Mini 328

Hi all. I'm new to Arduino and am planning a number of projects where the main board will be used permanently. Obviously it's costly to buy a new Uno for each project. Can I use my Uno to prototype the code and wiring and then swap it out for a tiny board like SparkFun's Pro Mini 328, as long as I provide proper voltage supplies? It isn't clear to me whether the same sketches will run on both or if there are hardware differences that keep me from "hot swapping" (with additional soldering, of course).

Thanks!!

-Ben

Once you build your code and upload it to the Atmega you really don't need the arduino board. It is possible to create a minimal circuit to only perform the functions you have designed in your code. There are good tutorials on building the arduino circuitry on a breadboard in a "standalone" setup: http://arduino.cc/en/Main/Standalone http://arduino.cc/en/Tutorial/ArduinoToBreadboard

You can go even smaller and eliminate some of the components in the tutorials above such as the ftdi,usb,external clock, etc. Here is a minimal circuit example: http://www.gammon.com.au/forum/?id=11109 They even discuss a low-power "sleep mode" where the processor sleeps until it receives input to wake it up.

If you decide that your circuit is complete and works as desired, you could even make your own PCB for a permanent setup.

Can I use my Uno to prototype the code and wiring and then swap it out for a tiny board like SparkFun's Pro Mini 328, as long as I provide proper voltage supplies?

Yes. As long as the replacement uses the 328 chip, there will be no problems. If it uses a different chip, and the code uses any non-portable techniques, like direct port manipulation or timer diddling, then code changes will be needed.

It isn't clear to me whether the same sketches will run on both or if there are hardware differences that keep me from "hot swapping" (with additional soldering, of course).

Cold swapping is possible. Hot swapping means while the processor is still running, and obviously that is not possible.

Thanks for the quick replies! I few follow-ups.

Paul, you said they are cold swappable as long as they use the same chipset. My Uno R3 uses the ATMega16U2, while the Pro Mini uses the ATMega328 with a 16 MHz bootloader. Do these count as the same chipset? It's funny...I can follow a schematic and hack solid state circuitry but when it comes to ICs, I feel like a dunce.

Also, as for the programming of the chip on the Uno, I realize that once programmed I can pull out the ATMega chip and stick it into my own breadboard, but I'm guessing that I still need a bunch of resistors and caps between the chip and the digital/analog outputs/inputs, right?

-ben

My Uno R3 uses the ATMega16U2,

It uses that as the USB to serial converter. The processor is the other chip on the board - the ATMega328.

Also, as for the programming of the chip on the Uno, I realize that once programmed I can pull out the ATMega chip and stick it into my own breadboard, but I'm guessing that I still need a bunch of resistors and caps between the chip and the digital/analog outputs/inputs, right?

No. You'd need a voltage regulator, with caps and resistors, and a crystal, with caps. Google "standalone Arduino".

PaulS: You'd need a voltage regulator, with caps and resistors, and a crystal, with caps. Google "standalone Arduino".

Or Nick's article.

As a more convenient alternative to building your own standalone Arduino, there are lots of clones around using a wide variety of Arduino-compatible microcontrollers and with different pin configurations, additional hardware devices integrated onto the board, with/without onboard regulators and so on. Some of the smaller ones are hardly any bigger than the chip itself and hardly any more expensive than buying the components separately.

Further to what PeterH said, I was going to build an arduino on a breadboard/protoboard from scratch. Scouring ebay for the parts led me to the simple conclusion - unless making it is (a big) part of the fun, it's a complete waste of both time and money.

I then promptly bought a Pro Mini (5v 16Mhz) clone from ebay for ~$4.50 and an ftdi adapter for another $4.50 or so. Total cost was under AUD $10, including delivery. The ftdi is shared between several arduinos and is a one-off purchase. Not even worth the time and effort for me to build from scratch or dismantle old, surplus equipment.

PeterH: Some of the smaller ones are hardly any bigger than the chip itself and hardly any more expensive than buying the components separately.

Indeed, it usually is not possible to purchase the separate components for less than the assembled version. Pro Mini PCBs are available sort of cheap (if it were not for the postage) but all the other components add up.

enhzflep: Scouring ebay for the parts led me to the simple conclusion - unless making it is (a big) part of the fun, it's a complete waste of both time and money.

Yep.

enhzflep: I then promptly bought a Pro Mini (5v 16Mhz) clone from ebay for ~$4.50 and an ftdi adapter for another $4.50 or so. Total cost was under AUD $10, including delivery.

You paid up big! Pro Mini clone and ftdi adapter (No, CP2102, "fixed" version).