Go Down

Topic: voltage measurement using arduino (Read 1 time) previous topic - next topic

hudayanga

Hi all,
I'm new to arduino..i am doing a project to detect power outages in areas.so i need to get power outages using arduino.so what is the best way to do this arduino..please be kind enough to tel me how arduno analog input use to detect outages.for demo using 5v power pack hw can we do this??
thank you.
Undergraduate Student(SLIIT)

retrolefty


Hi all,
I'm new to arduino..i am doing a project to detect power outages in areas.so i need to get power outages using arduino.so what is the best way to do this arduino..please be kind enough to tel me how arduno analog input use to detect outages.for demo using 5v power pack hw can we do this??
thank you.



One easy and safe way to detect main AC power failures is to use a simple relay that uses a AC coil relay. Your AC main power would keep the relay energized unless there was a main power outage in which case the relay would deenergize. The arduino would be wired to the relay's contacts and read continuously as a digital input signal.

Lefty

James C4S

Another safe method would be to plug an AC to DC adapter into the wall, and monitor the DC voltage. 
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

hudayanga

thanks for your response..if i monitor DC voltage how can implement hardware connection with arduino??how do i input voltage to arduino..i'm using arduino uno
thank you
Undergraduate Student(SLIIT)

Arrch


if i monitor DC voltage how can implement hardware connection with arduino??


If the DC voltage doesn't exceed 5V, you can simply connect the VCC to a digital pin and the GND to the Arduino's GND and use a digitalRead(). If it exceeds 5V, then you will need to use a voltage division circuit to get it under 5V.

hudayanga

If i use analog read which pins in arduino should i connect??
Undergraduate Student(SLIIT)

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

hudayanga

you mean A0 to A5...??ok then my 5v comming from my power pack..then 5v vcc and gnd wire how can i input to arduino??
thank you
Undergraduate Student(SLIIT)

Arrch


you mean A0 to A5...??ok then my 5v comming from my power pack..then 5v vcc and gnd wire how can i input to arduino??
thank you


You plug the 5v into an input pin and the ground to the ground pin of the Arduino, as has already been explained.

retrolefty



you mean A0 to A5...??ok then my 5v comming from my power pack..then 5v vcc and gnd wire how can i input to arduino??
thank you


You plug the 5v into an input pin and the ground to the ground pin of the Arduino, as has already been explained.


Little point to trying to measure the board's 5 volt Vcc voltage via a analog input pin as it will always read 1023 counts as the same Vcc is used as the reference voltage. So even as the Vcc battery pack lowers in voltage the analogRead value will still report as 1023 counts.

Best to state what you are trying to accomplish rather then how you think it should be done.

Lefty

Arrch


Little point to trying to measure the board's 5 volt Vcc voltage via a analog input pin as it will always read 1023 counts as the same Vcc is used as the reference voltage. So even as the Vcc battery pack lowers in voltage the analogRead value will still report as 1023 counts.

Best to state what you are trying to accomplish rather then how you think it should be done.

Lefty


He's not trying to measure the the board's power supply, he's using a wall wart to determine if there is AC power to an outlet (at least, that's what I've gathered from the limited information he's given).

retrolefty



Little point to trying to measure the board's 5 volt Vcc voltage via a analog input pin as it will always read 1023 counts as the same Vcc is used as the reference voltage. So even as the Vcc battery pack lowers in voltage the analogRead value will still report as 1023 counts.

Best to state what you are trying to accomplish rather then how you think it should be done.

Lefty


He's not trying to measure the the board's power supply, he's using a wall wart to determine if there is AC power to an outlet (at least, that's what I've gathered from the limited information he's given).


OK, I missed that. However I would just wire the adapter's 5vdc output to a digital input pin rather then bothering to read it's value as it's a on or off type application alarm?

Lefty

LarryD

If you want to detect short interruptions in power, you may have better luck in monitoring a relay.
The way you have it in your schematic isn't the same as how you have it wired up!

Arrch


OK, I missed that. However I would just wire the adapter's 5vdc output to a digital input pin rather then bothering to read it's value as it's a on or off type application alarm?

Lefty


Yeah, that's what I recommended as well:

Quote
you can simply connect the VCC to a digital pin

arduinoadrian

You can use a simple voltage divider to get a fraction of 5V (2.5V for instance) at one of the Arduino analog inputs from the wall wart output, provided it has no regulated output and little filtration. That will allow you to check for the power outages and also monitor the line voltage which you will probably be tempted to do in the future. Just monitoring for power outages is so simple that you don't really need an Arduino for that. Lefty's relay hooked up to your alarm device is more than enough.
Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Go Up