Pages: [1] 2   Go Down
Author Topic: voltage measurement using arduino  (Read 1031 times)
0 Members and 1 Guest are viewing this topic.
Sri Lanka
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Undergraduate Student(SLIIT)

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Another safe method would be to plug an AC to DC adapter into the wall, and monitor the DC voltage. 
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Sri Lanka
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Undergraduate Student(SLIIT)

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Sri Lanka
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If i use analog read which pins in arduino should i connect??
Logged

Undergraduate Student(SLIIT)

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26526
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The analogue input ones.
Logged

"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.

Sri Lanka
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Undergraduate Student(SLIIT)

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2813
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you want to detect short interruptions in power, you may have better luck in monitoring a relay.
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

California
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3442
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 14
Posts: 350
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Pages: [1] 2   Go Up
Jump to: