Author Topic: From Arduino to something more permanent?  (Read 8891 times)

0 Members and 1 Guest are viewing this topic.

Offline dog80Topic starter

  • Regular Contributor
  • *
  • Posts: 64
From Arduino to something more permanent?
« on: December 07, 2013, 11:02:14 am »
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?
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
Re: From Arduino to something more permanent?
« Reply #1 on: December 07, 2013, 11:25:22 am »
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 the Metaboard.

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!

« Last Edit: December 07, 2013, 11:35:50 am by con-f-use »
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: From Arduino to something more permanent?
« Reply #2 on: December 07, 2013, 11:46:06 am »
Bare minimum (if you want it to be the same as your arduino)

ATMega 328P-PU
16Mhz Crystal
Two 22pF capacitors (biasing the crystal)
Two 0.1uF capacitors (reset line, vcc)
10k Resistor (reset pull up)

You can use your existing Arduino as an ISP programmer both 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.
« Last Edit: December 07, 2013, 11:48:26 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2045
  • Country: us
Re: From Arduino to something more permanent?
« Reply #3 on: December 07, 2013, 11:51:24 am »
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.
 

Offline dog80Topic starter

  • Regular Contributor
  • *
  • Posts: 64
Re: From Arduino to something more permanent?
« Reply #4 on: December 07, 2013, 11:56:30 am »
I am going to power it from a 9 Volt battery. Do I need voltage regulators?
 

Offline JoeO

  • Frequent Contributor
  • **
  • Posts: 527
  • Country: us
  • I admit to being deplorable
Re: From Arduino to something more permanent?
« Reply #5 on: December 07, 2013, 12:07:11 pm »
I am going to power it from a 9 Volt battery. Do I need voltage regulators?
Yes.  One regulator for each voltage you will be using.
The day Al Gore was born there were 7,000 polar bears on Earth.
Today, only 26,000 remain.
 

Offline con-f-use

  • Supporter
  • ****
  • Posts: 807
  • Country: at
Re: From Arduino to something more permanent?
« Reply #6 on: December 07, 2013, 12:16:13 pm »
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.
« Last Edit: December 07, 2013, 12:18:26 pm by con-f-use »
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6190
  • Country: us
Re: From Arduino to something more permanent?
« Reply #7 on: December 07, 2013, 05:20:12 pm »
You can use your existing Arduino as an ISP programmer both to load the bootloader onto the Atmega for later uploading via a USB-Serial adapter, or to just program it directly.

Is 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.
 

Offline mtdoc

  • Super Contributor
  • ***
  • Posts: 3575
  • Country: us
Re: From Arduino to something more permanent?
« Reply #8 on: December 07, 2013, 06:37:26 pm »
The easiest way IMO is to buy a Atmega328 with the Arduino bootloader preinstalled. They can be had for $5 on ebay and 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 per this 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.
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 3441
  • Country: us
Re: From Arduino to something more permanent?
« Reply #9 on: December 07, 2013, 06:50:09 pm »
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?

This 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) MCU
2. Follow the Arduino site's breadboarding the ATMEGA328 (skip the RS232 breakout for now) but make sure you connect an LED to digital line 13
3. 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.
 

Offline Electro Fan

  • Super Contributor
  • ***
  • Posts: 3199
Re: From Arduino to something more permanent?
« Reply #10 on: December 08, 2013, 08:04:49 pm »
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.
« Last Edit: December 08, 2013, 08:15:13 pm by Electro Fan »
 

Offline Len

  • Frequent Contributor
  • **
  • Posts: 547
  • Country: ca
Re: From Arduino to something more permanent?
« Reply #11 on: December 08, 2013, 08:55:35 pm »
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 (or FTDI Friend) for programming.

Arduino Pro Mini - Very small.

Diavolino - Same form factor as Arduino, so it fits in an Arduino-compatible enclosure.

USB Boarduino - Small. USB powered, which is convenient if you already need a USB connection for serial data.

DC Boarduino - Small. Has a 5V regulator with enough oomph to power a bunch of LEDs or whatever.
DIY Eurorack Synth: https://lenp.net/synth/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf