From Arduino to something more permanent? - Page 1
Forum section: electronics / beginners

author: dog80
author_rank: Regular Contributor
timestamp: December 07, 2013, 11:02:14 am
content: I have done a small Arduino project on a breadboard. I want to enclose it in a project box to make it permanent but I do not want to sacrifice my Arduino.I am thinking to use a bare ATmega328 like the Arduino's with all the supporting circuitry.What am I going to need? I have a universal programmer from ebay, similar to the one Dave reviewed some time ago. Will this do, or do I need an Atmel specific programmer?What other materials am I going to need, eg voltage regulators, capacitors, crystal?

author: con-f-use
author_rank: Unknown
timestamp: December 07, 2013, 11:25:22 am
content: Depends very much on how much time you want to spend on writing the Software and what you want to achieve. In principle the ATmega328 can run with very little - it even has an internal resonator, which can be used instead of a crystal. The old ATmega168 is also supported by the IDE and slightly cheaper. If that is enough look at the schematic for theMetaboard.In any case you will need a small capacitor to guarantee accurate supply to the chip and some proto board to solder your project onto. I'd also recommend a little fuse and a MOV for protection. Wouldn't want to burn your house down if an elco in the power supply goes boom.I assume you want to use your existing Arduino sketch? If so, your programmer needs to be supported by the Arduino IDE or you'll have to manually upload the binaries created by the IDE. The latter can be a bit painful but is doable. The next question is, do you need the Arduino's USB/Serial-connection for your project? How do you plan on powering your project? I usually use 5V cellphone chargers. They're cheap (free really if you ask a fried for their old one), and I can go without a voltage regulator.Give some more details!

author: sleemanj
author_rank: Super Contributor
timestamp: December 07, 2013, 11:46:06 am
content: Bare minimum (if you want it to be the same as your arduino)ATMega 328P-PU16Mhz CrystalTwo 22pF capacitors (biasing the crystal)Two 0.1uF capacitors (reset line, vcc)10k Resistor (reset pull up)You canuse your existing Arduino as an ISP programmerboth to load the bootloader onto the Atmega for later uploading via a USB-Serial adapter, or to just program it directly.If you load a bootloader, then you should just incorporate headers to use a CP2102/FTDI USB-Serial adapter for programming so you don't have to always hook up your arduino.Or alternatively, just grab a cheap Pro-Mini off ebay and leave it in your design, they are dirt cheap, you'd need a USB adapter as above to program it.

author: ivan747
author_rank: Super Contributor
timestamp: December 07, 2013, 11:51:24 am
content: You could buy an Arduino Pro mini and place it on a socket for your project. When you become tired of it, remove the Arduino and do the same for the next project.

author: dog80
author_rank: Regular Contributor
timestamp: December 07, 2013, 11:56:30 am
content: I am going to power it from a 9 Volt battery. Do I need voltage regulators?

author: JoeO
author_rank: Frequent Contributor
timestamp: December 07, 2013, 12:07:11 pm
content: Quote from: dog80 on December 07, 2013, 11:56:30 amYes. One regulator for each voltage you will be using.

author: con-f-use
author_rank: Unknown
timestamp: December 07, 2013, 12:16:13 pm
content: The mini-pro and an ftdi board to program it is probably the solution that saves you most time. The voltage regulator is built into the mini pro.

author: zapta
author_rank: Super Contributor
timestamp: December 07, 2013, 05:20:12 pm
content: Quote from: sleemanj on December 07, 2013, 11:46:06 amIs it sufficient to program an .hex file generated by the Arduino IDE into a stock Atmega or does the .hex relies on some bootstrap/bootloader for proper chip initialization or other services?I guess I don't understand the memory model of Arduino and the relationship between the bootloader and the executed program.

author: mtdoc
author_rank: Super Contributor
timestamp: December 07, 2013, 06:37:26 pm
content: The easiest way IMO is to buy a Atmega328 with the Arduino bootloader preinstalled. They can be had for$5 on ebayand elsewhere. Assuming your current Arduino is not a smd version, you can plug this into your current Arduino for programming.Then just build your barebones Arduino with the programmed chip, 16Mhz crystal, etc perthis tutorial.Yes, it's less expensive to start with a blank chip and load the bootloader but that may not be worth the couple of bucks saved.

author: Rick Law
author_rank: Super Contributor
timestamp: December 07, 2013, 06:50:09 pm
content: Quote from: dog80 on December 07, 2013, 11:02:14 amThis is what I did in the first try and it worked:Step 1: Bare MCU (Needs two 22pf, one 16Mhz crystal, one LED, one 300 ohm-1K resistor for the LED)1. Load the blink program to the (from the examples) MCU2. Follow the Arduino site's breadboarding the ATMEGA328 (skip the RS232 breakout for now) but make sure you connect an LED to digital line 133. Optionally, connect a tac-switch to the RST pin (pin1) with a pull up resister.4. Power up and see if your MCU on the breadboard is blinking the LED. If so, you have an MCU with bare circuitry that you can transfer to PCB.Step 2: Optional (unless you need to download program direct)1. First modify the Arduino Site's serial example to write something (of your choice) to serial and make sure you can see it.2. Follow the Arduino site's breadboard on using an Arduino UNO's serial connectivity alone -- note that that is the one where you must remove the MCU from the socket. The UNO is just a "serial adaptor" to your bare MCU.3. Test.4. Now decide if you can use that to load programs to your bare MCU.Step 3: Decide if you want to get an RS323 breakout or use #2, decide if you want a reset button or not (pull up resistor and tac-switch)That is how I made a "home made" Arduino board.

author: Electro Fan
author_rank: Super Contributor
timestamp: December 08, 2013, 08:04:49 pm
content: Not sure if I fully understand your plan but it sounds like you want to do projects with the Arduino and then rather than take the project apart to start over you would like to retain at least the programmed Atmega and maybe the surrounding circuitry, and then move onto other projects.I have found that you can take the Atmega 328 out of the Arduino, put it in the MiniPro TL866 that Dave reviewed (available on eBay; Sunwenjun is a good seller), and then you can read the Atmega. With the TL866A version you can also write directly to the Atmega. It's pretty cool - you can search text strings and rewrite text (using the keyboard on your PC); you can see the ASCII text change and also the corresponding HEX. After you write to the Atmega you can put the Atemga back in the Arduino board and see the text change in the Arduino IDE software program. In this way you can easily (gently) move the Atmega from the Arduino Uno to other boards/projects. To be be square, you could do this without the TL866 but the TL866 gives you additional visibility into the chip level code. And of course with the TL866 you can also work on thousands of other chips beyond the Atmega - Rick Law's info and the other posts above provide additional ideas/paths that might better address your questions. Might depend on how much of your question is focused on software/firmware vs. hardware. The Arduino isn't super expensive but you can buy individual Atmega chips for a small fraction of a full Arduino Uno. In addition to saving $ you can develop the circuit building and programming skills that come from decomposing and recomposing off the shelf starting points for circuits and programs, or you can build from scratch.Hope something in here helps.

author: Len
author_rank: Frequent Contributor
timestamp: December 08, 2013, 08:55:35 pm
content: Here's a few tips in addition to all the above:If you put an ATmega 328 on your board, you can use a 16 MHz ceramic resonator instead of a crystal + 2 capacitors - it's a bit simpler.Alternatively, there are various cheaper Arduino clones that you can embed in your project, each with its own advantages. Here are some that I've used. Note that some of them require an FTDI USB-serial cable (orFTDI Friend) for programming.Arduino Pro Mini-Very small.Diavolino- Same form factor as Arduino, so it fitsin an Arduino-compatible enclosure.USB Boarduino- Small. USB powered, which is convenientif you already need a USB connection for serial data.DC Boarduino- Small. Has a 5V regulator with enough oomph to powera bunch of LEDsor whatever.