Recently trying to learn electronics (especially for playing with arduino). Hence, please bear with my non-sense (if any)
I want to check for AC power outages and buzzer me when one happens. I already have a 12v ac to dc adaptor. Hence, I thought if I introduce a 5v voltage regulator, the regulated voltage can be feed into arduino's digital input. When the digital input is high the buzzer beeps for a specified msec. Am I thinking right?
But since voltage dividers use resistors too much energy would be wasted as heat. Also, a ac-dc adaptor is already being used. Hence, I though my not use the existing resources
AlleSl3Icut:
But since voltage dividers use resistors too much energy would be wasted as heat. Also, a ac-dc adaptor is already being used. Hence, I though my not use the existing resources
Just how much voltage you waste as heat will be determined by the overall resistance of your divider. A 5v voltage regulator will waste a lot more energy than say a 1Meg resistance chain.
AlleSl3Icut:
But since voltage dividers use resistors too much energy would be wasted as heat.
That's a fascinating mis-application of an otherwise valid point.
Yes, resistors "waste" energy as heat, but a (linear) Voltage Regulator is nothing more than a very "smart" resistor which adjusts itself to the demand. And to varying degrees, it wastes some power to run its internal voltage reference.
Since the Arduino input is such a very high resistance in parallel with the lower resistor in the voltage divider, you can choose resistors (47k lower, 68k upper) to pass a current at 12V (100ยตA) which is less than that wasted in a regulator (LM1117: 5 mA). And resistors are cheaper!
Using a voltage regulator as an input voltage translator is a typical beginners mistake. It is caused by not understanding what the **** you are doing.
Do not do it. Do not get hung up with wasting electrical powe, it is not a problem.
my bad. thanks for correcting me up. Well, i misunderstood the voltage divider circuit after all. However, as mentioned although the power loss is not important to consider in the initial stages, I was trying to extend my battery's life when using with arduino.
Now, can the output from the voltage divider circuit be feed into arduino's digital pin and analog pin or is it restricted only to analog?
You have 12v. Put a voltage divider on that and you can get 5v signal that you can read with either as digital (when it's high you have power, when it's low the power has failed) alternatively, you can read it as an analog input to calculate the voltage on the 12v line.
The diode and pull-up will only discriminate between the 12V supply being lower or
higher than about 2.5V. A voltage divider can move that discrimination point higher
up, and there are ways to use zener diode to set the threshold more or less where you
want.
Be careful though, accidentally connecting 12V directly to an Arduino pin will destroy
the Arduino in a tiny fraction of a millisecond.
A resistor divider with highist value resistors is inherently safe since no damaging
current levels can flow. Really high values might make the input sensitive to noise
though, perhaps try 100k or so in the first instance