Moving Arduino project to stand alone chip

Hi all…

I’ve been tweaking my application on an Arduino and would like to build my own circuit using an ATMega328 or a ATMini85. The application is simple. It has two 0-5V analog inputs. Input 2 is set using a pot and input 1 comes from a sensor. If input 1 exceeds input 2, a relay is activated. I’ll be building quite a few copies of this so using an Arduino for each one would be cost prohibitive.

Can someone point me to the correct hardware to use for programming the above chips? I have the software for programming the Arduino. Will that work or do I need different programming software to program the chip directly?

Thanks

lots of “right” hardware.

Decide on the target hardware. One simple choice is

http://www.pjrc.com/store/teensy.html

Which may also be resold by SFE - not sure.

There’s Arduino support for these.

If you want to move on from Arduino’s programming environment…

Start by learning how to use C rather than C++ (to downsize).

Lots of examples on the AVRfreaks.net website/forum.

Download/learn Atmel’s free AVR Studio 4 (not Studio 5).

Or a good hobbyiest platform is ZBasic.com - great compiler/library.

Thanks. Development is done and what I’m wanting to do is incorporate the amtel chip in the final project, but not sure what I need to program the chip. I’m guessing I need a programmer of some sort like I used to use with PIC’s. I had seen Amtel’s AVR Studio. Why 4 and not 5? Is 5 not stable? I’m OK with C or C++.

You don’t want to use the serial bootloader?

If instead you want to program them using AVR studio 4, get an Atmel MK II ISP. Make sure your board has the ISP connector, a header of 6 or 8 pins. Beware the Chinese clones of the MK II which are problematic.

You don’t need a whole lot to be able to program a bare ATmega328p. You already have an Arduino, so you have an ICSP programmer. What you need is a breadboard, a 16MHz crystal and load capacitors (or a resonator), a pushbutton, a 10k resistor and some 0.1uF capacitors.

If you want a USB interface to your 328, you’ll need an FTDI breakout board.

Some links;

http://arduino.cc/en/Tutorial/ArduinoISP

http://arduino.cc/en/Tutorial/ArduinoToBreadboard

http://www.sparkfun.com/products/9115

If you buy a bare atmega328p, it’ll come with no bootloader and its fuses set to default, so you’ll need to use your ArduinoISP with avrdude to program the fuses correctly;

http://zencoding.blogspot.com/2011/07/a … s-for.html

From there, you can then just upload the default Optiboot bootloader onto the new ATmega328p, and then you can talk to it through the FTDI chip and treat it as a normal Arduino Uno.

If you want to use an ATtiny85, you can also set that up via the Arduino IDE as a target, but you can’t upload via a bootloader. The upload will go over your ICSP programmer.

Adapt this (this is intended for someone using a Bus Pirate as an ICSP programmer, you can do the same using your ArduinoISP which emulates an stk500v1);

http://zencoding.blogspot.com/2011/07/b … ammer.html

That’s got the pinout and info on the fuses for an ATtiny85. One important thing - do not disable the reset line! You’ll regret it.

Burning the program right from AVR Studio sounds a lot easier. The ISP programmer from Atmel is only $34 and connection to the chip looks straight forward. If I put a 6 pin header connected to the apporpriate pins on the production board, I can just plug in the Atmel programmer and burn the program directly. The Arduino was great, and stil is, for development, but I’d really like to go away from it as I move more towards production.

If all you want to do is compare two voltages, there should be lots of standalone chips that will do that which will be much less expensive than a uC. It might be tricky to find them, but learning to do analog circuitry is fun as well.

WizenedEE:
If all you want to do is compare two voltages, there should be lots of standalone chips that will do that which will be much less expensive than a uC. It might be tricky to find them, but learning to do analog circuitry is fun as well.

No kidding…comparing two voltages and activating an output is definitely build into a single chip already. It’s called a “comparator” and a common example is an LM339.

  • - If it's OK for the load to turn off after the input falls below the setpoint, then all you need is a transistor to activate the relay.
  • - If the input is a bit noisy, you might want to add some hysteresis by using some input resistance and running a high value resistor from the output to the input.
  • - If you need the output to latch on until manually turned off, there are plenty of simple latch circuits and ICs too.
  • An LM339 costs about 30 cents in quantity 100 pieces, and it has three extra comparators you could use. Another logic IC for some latching or timing behavior would add maybe another 30 cents, if needed. If production cost really is an important factor, it would be worth looking into the option that replaces a $2-$4 part with a 30 cent one that doesn't need to be programmed at all.