I am trying to find the max and min voltage and current limits for the Digital and Analog IO on the ATmega328. I'm particularly interested in how much current I can source with digitals (I need to operate some small relays) and how much I can push into an analog without damaging it (Can I put 13.5VDC into an ADC and just see it as 5? Or will I blow the chip?)
Thanks!
I looked through the datasheet to no avail. I'm hoping that somebody can direct me properly. A data sheet that has the info on it, (Or where to look if I'm just stupid) or a post containing this info would be great.
I believe it is 40ma per pin, 200ma maximum total for all pins (so at 40ma per pin, you could only drive 5 pins max; if you were only pulling 20ma per pin, you could do 10 pins at once).
Keep in mind that the 40mA/pin and and 200mA total are "Absolute Maximum" ratings. I.e., they mark the boundaries of "Here be Dragons" territory, and, if you exceed them, the risk of smoking the chip gets significant. A good rule of thumb is to stay below about half the absolute maximum limits until you acquire the experience that lets you advise people on how to avoid the mistakes you made
If you feed 13.5V into an analog input, the odds of chip survival are better than those of hitting the Powerball jackpot. But not by much. Don't do it.
What if I use the external (non-USB) power supply?
The 'solution' for driving loads that either need voltage higher then +5vdc or if their total current draw exceeds the 40ma pin/200 ma total rating is to:
Use an external voltage source whos current rating is equal or more then the total load current draw.
Utilize a switching device (transistor most common) between the load to be controlled and the Arduino digital output pin(s).
(Can I put 13.5VDC into an ADC and just see it as 5? Or will I blow the chip?)
You will blow the chips. You can't put more in a chip that you are giving it as a power supply and sometimes not even that, that is an almost universal rule of electronics.
I guess for a big total number of LEDs I have to use Arduino Vin instead of Arduino +5V, right?
If I'm correct, then another question: I'll be using TWO Megas. Can I externally power one of them and connect both Vin pins together? (my two Megas already have a shared ground)
EDIT: for those who wonder, the Mega has a global limit of 200 mA. So many pins and such limitations, WTF?
I guess for a big total number of LEDs I have to use Arduino Vin instead of Arduino +5V, right?
Wrong. The 200mA limit applies to current being drawn from the pin. If you power the LED with a transistor you can use the +5v. To get over the regulator dissipation problem, then switch to a transistor and using Vin.
Oh and I have a Seeeduino Mega which uses an atmega1280-16au which is smaller. In fact, everything is smaller on the Seeeduino. I suppose the power dissipation of the Seeeduino is even worse than for a normal Mega, right?
I suppose the power dissipation of the Seeeduino is even worse than for a normal Mega, right?
No the power dissipation should be the same. If that dissipation is good for the device is another matter. Often the surface mount packages have a lower thermal resistance to ambient so they keep cooler for any given power dissipation.
But remember that in total you can only switch about 650mA through the chip at any one time due to power dissipation constraints.
Grumpy Mike, are you talking about the power dissipation constraints of the ATMEGA chip? Or the Arduino voltage regulator? Or are you saying that a ULN2803A can only switch 650mA of current at a time because of its power dissipation constraints? The ULN2803A can dissipate 2W for the entire package, and 1W per darlington pair.
When I use an ULN2803A to drive higher loads, I don't use the 5V output of the Arduino voltage regulator, I use an external regulator.
Thanks, I'm just trying to understand if I'd be pushing the limits of the ULN2803A if each pair was sinking 500mA.
Ah, thanks. No I had not read your Darlington driver example (didn't see your reply with that link before i replied). Now I understand that the Vce voltage is a function of the input current, and that if I allow 500mA of current then the voltage approaches 2V. That's a lot of power to dissipate. Now I understand how to plan my usage of ULN2803A chips by allocating the current appropriately across the outputs.