Ok, I finished an Arduino project. How to make it permanent?

Hey everyone,

I've been messing with Arduino since the Duemilanove version came out (the one I still use today), but I always faced the same "problem". Every time I finish a project, I document everything and later disconnect it so I can use the board into another project. I see the Arduino as a development plataform, so despite being cheap, I don't intend to buy one board and make it definitive for each project I work on.

That said, I was looking for an alternative to make my projects permanent after I prototype it on the Arduino. I've ran into some options:

  1. Buying a standalone ATmega328, burn the bootloader, upload the sketch using my current Arduino, remove it from the socket and put it into a perfboard or something, connecting the other components (oscillator, capacitors etc).
  2. I've seen a lot of material about uploading sketches to ATtiny45/85, using the Arduino as an ISP. I think this is incredible, specially because the ATtiny's are very cheap.
  3. Using an Arduino Nano.

Number 1 seems to be the best one, but I'm not sure about one thing: most of my projects uses serial communication to the PC through USB. Does the ATmega328 provide this functionality or I'll also have to add some FTDI chip or something? I'm looking for the most simple alternative.
Number 2 I like a lot, but because I use USB/serial communication most of the time, I don't think it's possible (but for PC-independent applications, it's awesome).
Number 3 seems like I'm wasting a lot of resources too (feels like "throwing an Arduino away").
Is there any other alternative?

To sum up, I'd like to hear opinions on the best alternative to make a permanent hardware after I prototype my project with the Arduino, keeping the serial-over-USB functionality.
What are you guys opinion on this? How do you manage your finished projects?

Kind regards,
Fergo

Fergo:
3) Using an Arduino Nano.

Number 3 seems like I'm wasting a lot of resources too (feels like "throwing an Arduino away").
Is there any other alternative?

Sounds like you need the ATmega processor, crystal, and USB-to-Serial hardware, which comes to about 90% of an Arduino (Nano or UNO).

If your sketch can run on an 8 MHz Arduino you could use the internal RC oscillator. That would save the cost of the crystal and caps (about $3). I have seen articles about using cheap ($3) cellphone data cable for USB interface so that might work with an ATmega328P to give you most of an Arduino UNO for about $10.

The ATtiny85 only has 8 pins. You have to keep Vcc and Ground. You probably also want to keep Reset so you can re-program the chip without a High-Voltage Rescue Shield. I think they left out the serial port, too. Might make that USB-to_Serial cable useless. :slight_smile:

Thanks for the answer John. So, If I understood correctly, the USB/Serial functionality is not native into 328?

Fergo:
Thanks for the answer John. So, If I understood correctly, the USB/Serial functionality is not native into 328?

That is correct.

There is a newer Arduino design called the Leonardo that uses an ATmega chip that does include native USB. Unfortunately those chips only come in surface-mount packages so they are not nearly as easy for a hobbyist to work with. You might want to look into a Leonardo clone (the official board announced last September is not shipping yet as far as I can tell).

The USB-to-Serial chip on the UNO and MEGA is actually a small ATmega processor with native USB.

You could learn how to use ArduinoISP and then load your Arduino board with ArduinoISP (from 022 or 023) and then get some blank 328P chips (328 chips work, but the signature is different). Then you could load your sketch into a chip and save the chip to run just that code.

I have made a couple dedicated cable sets - one goes to a board with 2 sockets - 1 for an ATtiny2313 and the 328(P)(has 2 sockets) and the other ends in a 6 pin header that will connect to the ICSP connector.

I just load the ArduinoISP sketch, and use my Arduino to program the other chips. Either load just the sketch, or load a bootloader so I can put the 328 in my Arduino board and use it there.

I think haveinf a few spare 328 chips with the bootloader already loaded is just a good practice.

Hey @Fergo,

Fergo:
2) I've seen a lot of material about uploading sketches to ATtiny45/85, using the Arduino as an ISP. I think this is incredible, specially because the ATtiny's are very cheap.

...is my favourite however it does not easily provide this...

keeping the serial-over-USB functionality.

...which is when I turn to these...
http://www.pjrc.com/teensy/

Let me second Coding Badly's suggestion of the Teensy. They cost $16 but they work really well if you need the serial over USB function. The other option I have used to buy a cheap USB programmer off of eBay and use it with an RBBB (Really Bare Bones Board) Arduino. That ended up costing about the same.

Adafruit sells a board for $20 that is similar to the Teensy. Atmega32u4 Breakout Board : ID 296 : $19.90 : Adafruit Industries, Unique & fun DIY electronics and kits But I could not get that board to work with serial over USB. (Plus I had a real tough time programming that board. The Teensy was much better.)

I will throw one more point in here. Sparkfun sells the 328p with the bootloader already on it for $5.50 which saves a little bit of headache and it is still really cheap for option one but you will need to add the FTDI chip and peripherals. I have seen cables with the FTDI built in which might also be an option.

FTDI Cable 5V - DEV-09718 - SparkFun Electronics FTDI Cable

ATmega328 with Arduino Optiboot (Uno) - DEV-10524 - SparkFun Electronics 328p with bootloader.

Hi, with the low cost of Arduino-compatibles at $19 to $20 , it seems to make sense to stick with the standard form factor with regular USB, and no compromises or programming issues.

DISCLAIMER: Mentioned stuff from my own shop...: like these: http://goo.gl/uAFvA Comes with a regular USB cable..

WhatIf you could buy a package of 5 at, um, $18 or $19 each? Would that be useful / interesting?

with regular USB

What is "regular USB"?

it seems to make sense to stick with the standard form factor ... and no compromises or programming issues

Comparing a "standard form factor" board to the Teensy, what are the compromises? What are the programming issues?

I always seem to end up with my projects on bits of perf-board. That way you can add as much or as little as you need in terms of components.

A '328 in a socket might set you back about £4, add £1 for crystal (unless you are running at 8MHz internal which is fine for many projects), caps, reset switch and a pull-up resistor and you are good for most projects. Occasionally you might want power and/or pin 13 LEDs with 1Ks. Cost of those likely to be trivial. If you are not using a smoothed 5V supply or power from USB then you will want a votage regulator.

If you want to keep USB communication then a CP2102 based USB to TTL converter will add another £2 but might save you needing to add a voltage regulator.

Likely max cost of the controller part of the project, even allowing for a few headers etc is likely to be £7-8. Not much less than £12ish for a nano but you can still make 3 projects for the price of 2.

If most of your projects need the Serial to USB functionality, how many of these devices do you have connected to the computer?

If you don't need USB functionality in your finished project, then it's quite simple to build your circuit on stripboard. Buy a blank atmega328p chip (no need for a bootloader) and include an 6-pin ICSP header in your design. Then you can program (and re-program) the chip in it using your Arduino as an ICSP. See Prototyping small embedded projects with Arduino | David Crocker's Solutions blog. You can cut the component count by using a 3-pin ceramic resonator instead of the crystal and two capacitors.

looking for an alternative to make my projects permanent after I prototype it on the Arduino.

That's where we started... My point was that if you have everything worked out on a standard Arduino 328 board, then if a board costs $19 or so, maybe you don't need to change form factors, change pin connections, worry about USB or not etc etc.

If you want to miniaturize it, or want to go to very low battery power etc, that's a different set of considerations. Then Teensy or ProMini are attractive.

There's also options like this
http://store.nkcelectronics.com/arduino-pro-328--5328516.html
Connect up your power, ground, IO as needed.

Or build up what tou need
http://store.nkcelectronics.com/arduino-runtime-board-rev-b.html

Thanks for the answer everyone. Didn't expect that much replies in such short time.

That Teensy board looks very nice! It's native USB functionality seems like a big +1. Nice that it has some sort of compatibility with Arduino code either. I'll definitely check it out.

For things that don't need Serial communication I'll probably stick with the ATtiny solution, due to it's price.
For projects with USB/Serial comm, looks like a have tons of options, thanks to all the replies. Buying an spare 328+FTDI (or CP2102)+Crystal+sockets etc seems to raise the price to a few dollars below an Arduino clone, so might not be worth the effort, specially because I don't have specialized tools.

The FTDI cable idea seems good. I can use a MCU with UART support (ATmega8 maybe? they are cheap) and leave an gnd/vcc/rx/tx pin header ready for the the FTDI cable. Would be cool to do that with ATtiny, but they don't seem to have UART (at least in hardware).

Aarrch asked how much devices I have connected to the PC and the answer is: usually only one. I have a bunch of projects that uses USB/Serial communication, but I don't need all of them at the same time. For those cases, I can also use a protoboard shield where I can solder everything and easily "switch between projects" by changing the shield, although it requires uploading the right sketch every time.

I did a search into the Arduino Leonardo, and when it comes out, it will rock. Looks like an overhauled Teensy (uses the same MCU actually), and with it's open source nature, might spawn a lot of "nano" native USB hardware, even cheaper than Teensy.

Again, thank you for the answers. A lot of good alternatives here.

If you're up self-assembly, there are Leonardo variants out already.
The Vinciduino developed by fm and company in Spain is one version,
https://bitbucket.org/fmalpartida/vinciduino/wiki/Home

and my Leonardino (Little Leonardino) uses the ATMega32U4 in a smaller board footprint and adds a uSD card to the mix.