I'm running a 12 volt system managing reversible motors, sensors, receivers, and relays for higher current action. The Mega 2560 works great at 12 VDC..
The question here is whether to use a pair of resistors to reduce HIGH and LOW inputs for the 12 volt system to ~+5 volts or ground to a Pin...
Or,
Simply send a 12 VDC or Ground signal to a digital Pin port through a resistor limiting current and voltage to the Pin. This would use the Pin current In/Out to achieve the HIGH and LOW results.
Thanks,
Ted
The input is only high-impedance within the normal voltage range of 0...Vcc. If you exceed this limit, the parasitic substrate diodes turn on and the current increases extremely. With a current limiting resistor, this diode may not burn out and limit the voltage, but it is best not to do so. These diodes are not designed to become conductive.
It is a similar problem if you put a HIGH signal on a pin but the chip is without supply voltage.
It will because the current will flow into the protection diodes. However, it would be foolish to rely on them as a means to reduce the voltage. As others have said, 2 resistors configured as a potential divider.
As others have said a schematic of the two solutions described will help, because your words are ambiguous and words are not the language of electronics schematics are.
Note a series resistor only cuts down voltage when there is current flowing. As there will be so little current flowing through the resistor there will be a very little (the technical term is sod all) voltage drop.
They do. However it is not a beginners project and will probably prove fatal for any beginner who doesn't understand the implications of what is being done.
Think of it as an application note that is supportive to the Darwin Awards.
OK, divider it is. As there are a number of requests or reports coming from the 12 volt system in my project, it might be a good idea to have a regulated 5 or 6 volt supply.
As an aside, the Mega2560 does not respond quickly at 5.8 volts on a HIGH read. Apparently offset some amount by running at 12 VDC. More testing to come.
ATMEL is confident injecting 0.24mA into a 5V pin, so how about lowering this way down to 70μA. Therefore, you could safely use a 100K series resistor to create a 12V to 5V digital level converter.
However, you are saying that this provides a bench mark for what is acceptable to shunt through the static protection diodes.
As this rating does not appear in the processor's data sheet you can't take the quote from this application note of:-
The series resistor can also be modified somewhat to make the detection closer but note that the maximum current through the AVR’s clamping diode should not be higher than 1 mA.
as setting a parameter that has not the legal force of the actual processor's data sheet.
Also note that this application note specifies the processor ATmega163 and these days the Uno uses an ATmega328. Given that the disclaimer at the end of this application note says:-
The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein.
I would suspect that there has been a die revision between the two processors that involved a change in the chip's geometry, that would give the ESD clamp diodes a smaller physical area, and thus reducing their current handling capacity. Making this application note not applicable to a Uno.
Anyway using the ESD clamp diodes for, a purpose they are not designed for, is bad engineering practice.
Also note that the OP appears to misunderstand the use of a resistor in this context.
Yes ... I think an actual benchmark (using the ZCD module in newer AVR families) is expressed here (300μA) Scroll down to "Selecting the Current Limiting Resistor".
I wouldn't consider using the internal diodes to within 100μA bad engineering practice, but I would consider it bad practice to use an output pin greater than 20mA (up to 40mA).
Anyways, I usually recommend using optos in a noisy environment (it depends on the specific application).
If you must clamp (actually it's not a bad idea even if you have a voltage divider in place), back to back Schottky diodes to ground and VCC on the input pin, will shunt the internal diodes, while having exactly the same effect.
If this 12V is from an automotive system, none of the really simple circuits presented here are completely sufficient. For that, it's worth doing some research.
The ATmega48A/PA/88A/PA/168A/PA/328/P datasheet indeed doesn't contain "injection". It does mention the protection diodes, but they neglect giving any specifications.
The ATmega328P datasheet does mention "injection" and gives the specifications.