I am completely new to arduino. I have been searching for hours to the answer to this question, but haven't been able to get a straight answer.
I'm basically wondering what is the cheapest way to make multiple arduino devices? Like say you make a really simple device, but you want to make like 5 of them. Well, at about $35 a piece for a arduino, or like $20 or whatever it costs for a solder it yourself kit, that can add up.
I heard that there is some way to once you make a device, to take the chip out and use it by itself, and only need to attach some sort of crystal. But other places said you need more than a crystal, and other places said you need a dorkboard or barebones kit. Found so many answers that I don't know what to believe.
Say your project is simple, one sensor, that controls one device. Is it possible to order a bunch of chips at $4 a piece or whatever, do all the programming with the duemilanove, but once you got all your code working right, simply use the duemilanove to put the programming onto all the chips? That way you can take them out and use them by themselves on your projects, simply soldering or connecting the right sensors/device to the right pins on the chip? Making the brains of each project only cost about $5 rather than about $30?
Yes, it is as simple as that. Just search this forum using the word standalone and you should find tons of stuff from users doing just that. Here is one e-bay seller that has a minimum type kit that makes gathering all the parts much easier and at a fair price:
Yes the solabotics Ardweeny is a cool little Arduino clone.
I bought 3 of them. You can solder one up in about a half hour.
If you replace the bulky 5mm LED they supplyu with a small 3mm LED the Ardweeny takes up very little space.
I also replaced the straight pin header for programming it with a 90 degree angeled header to make it fit inside a very little place where i needed it.
Even cheaper is yo get the processor,16MHz crystal two 22pF capacitors, two 0.1uF capacitors, 10K resistor and a push button and build it all on strip board along with the rest of your circuit. There is an example here if you down load the schematics. http://www.thebox.myzen.co.uk/Hardware/Pendulum.html
So those Ardweeny and RBBB kits look cool, and cheap for $10, but what is the point of using those rather than just the chip alone? Is it just so you don't have to solder your own crystal, and regulator, or is there more to it than that?
Also 2 more questions.
In my readings, I've gotten mixed answers whether the crystal is actually necessary or not. One thing I read said that it is not required for the 8mhz one, but is for the 16mhz one. Another place said its not required for the 16mhz one but your timings will be a little off. But as long as your not working with stuff that requires time, and rather using circuits like one sensor affects one sensor, does timing actually matter?
Also, is the voltage regulator completely necessary, or only when you are using higher than 5v? Would it be possible to power the chip directly with 4 rechargeable AA's, which would add up to about 4.8v of power. Would that be enough to make everything work fine, and be safe for the arduino? And what if you used 4 regular AA batteries, adding up to 6 volts, would that extra 1 volt fry something?
Yes, no need to have the built up arduino if you are building the chip directly into a circuit.
Sure does make it convenient to be able to disconnect it from everything else tho when you run into programming difficulty.
Will leave to others to answer, I have only used crystal equipped devices for solid comm's with other devices.
Not 4 alkaline battery AAs - that would be 6V. The chip has absolute max operating voltage of 6v, but will probably be running pretty warm there and will likely shorten device life.
4 NiCds maybe, ~4.8V. I have used 3 AAs just fine, was still going strong as voltage dropped down from 4.5 to 4.25, bypassing the regulator.
I have a 8MHz Promini running off a 3.7v Li battery now, also bypassing the regulator.
See section 28 of the ATMega datasheet.
In my readings, I've gotten mixed answers whether the crystal is actually necessary or not
Only you, based on your application, can answer that.
One thing I read said that it is not required for the 8mhz one
There is an internal oscillator that will run at 8 MHz.
but is for the 16mhz one
16 MHz requires an external clock. This can be a crystal, resonantor, or something else.
Another place said its not required for the 16mhz
See above.
one but your timings will be a little off
Most accurate is the crystal. Second is the resonator. Third is the internal oscillator.
But as long as your not working with stuff that requires time, and rather using circuits like one sensor affects one sensor, does timing actually matter?
Possibly. The clock also effects things like Serial, Servo, and PING.
So to be clear regarding the standalone usage, you can just put an ATMega328 loaded with the "blink" sketch,a resistor, a LED and a battery on a board and it just works?
To use the internal oscillator I think you need to change the fuse bits, which are preset to external xtal oscillator in standard Arduino bootloader configuration. I believe this requires an ICSP programmer to achieve. A ceramic resonator is pretty cheap though and you get better time keeping (using a xtal means needing the two capacitors too).
Strictly speaking I think running from a ceramic resonator you should change the fuse bits too to tune the oscillator to best behaviour, but it seems to just work in my experience. I've also had success with an external oscillator driving Xtal1 pin via a 1k resistor in the standard config.
Checkout the ATmega328 datasheet for the full story 8)
So to be clear regarding the standalone usage, you can just put an ATMega328 loaded with the "blink" sketch,a resistor, a LED and a battery on a board and it just works?
Still there is something I don't understand. If you take a look at this: Arduino Playground - Standalone it doesn't say anything about the 10k resistor connected to the RESET pin and to 5V(in order to not reset the micro), which is mentioned in other tutorials. So how is it, do I need the resistor or not? If I connect the RESET pin directly to 5V what happens?
So how is it, do I need the resistor or not? If I connect the RESET pin directly to 5V what happens?
Most of your questions can be answered by reading the datasheet for the ATMega8/168/328 from Atmel:
If you are unfamiliar with reading a datasheet, I suggest you get familiar, as the datasheet -is- the documentation for the electrical characteristics and usage of the chip (among a ton of other things). Atmel also has a line of documents called "app notes" which can also help in development with their microcontrollers.
I'm not saying "don't ask questions here", just recommending that you read and understand the resources that Atmel provides for their microcontrollers, so as to help you better understand the chip(s) and make informed decisions and questions about them (now, if you have questions about what the datasheet says or reads - if you don't understand it - then we can help there, too).
The resister from +5v to Reset ensures the pin is high and allows you to ground the reset pin via some external means (manual grounding it with a wire, or a momentary switch, or electrically with a signal from another chip) to reset the chip without shorting the +5v to ground.
If you wire to +5, then your reset option is limited to cycling power.
To the best of my knowledge, the AVR processors used for Arduino boards have an internal pull-up resistor on the reset line. I have recently purchased ATmega168 and ATmega328 processors that have the resistor. I also have ATtiny84, ATtiny2313, and ATtiny85 processors that all have an internal pull-up resistor on reset.
While playing around with an '85 processor on a breadboard, I needed to be able to perform a reset. I stuck a loose jumper wire on the reset line. To reset the processor, I touched the jumper wire to ground. Simple enough. I noticed that occasionally the processor would reset if I touched just my FINGER to the jumper wire. If your application requires a RELIABLE / SAFE RESET, USE AN EXTERNAL PULL-UP. I believe the datasheet has a recommended circuit for the reset line.
I've built several battery powered handheld gadgets. None of them have an external pull-up resistor on the reset line. None of them has had a sporadic reset. If sporadic resets are not a concern then an external pull-up is optional.
You are correct Coding - Figure 10.1 in Para. 10.2 shows internal pullup resistor and discusses the various ways a reset can be created, from external taking to gnd, low Vcc, brownout. I don't immediately see the pullup resistor value.