CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Measuring AC - 220v

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
javi.ar



Joined: 17 Feb 2006
Posts: 59
Location: Argentina

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

Measuring AC - 220v
PostPosted: Tue Feb 03, 2009 10:39 am     Reply with quote

Hi, I have been diving around, this forum, microchip forum, google. But I cannot see any clear idea how to measure 220v from electricity main board. What I want is read voltage and ring a bell if below 200v or above 225v . How could I read that voltage variation?

would be enough to place a couple of serial (2M) resistors from 220v (mains) to RA0?

thanks for the tips in advance.
Ttelmah
Guest







PostPosted: Tue Feb 03, 2009 11:33 am     Reply with quote

Not really.
Direct connection to the mains, should be treated as something to only do if:
1) You really know what you are doing.
2) The processor itself is inside a properly double insulated case.
3) There is no external connectivity to the processor.
4) The resistors chosen for any potential divider, are properly rated for the worst case surges, and are 'fail safe'.
Realistically, if you have to ask, I doubt if '1' is satisfied.
This is potentially _lethal_.

Then, you have the separate data that you need to specify much more accurately, what you actually want to read. '220v', is an _RMS_ specification of the mains voltage. It is totally normal for the mains voltage to go outside the limits you are suggesting. It depends on country you are in, but instantaneously, expect spikes many times these levels. Your 'low' limit is probably reasonable, provided you read RMS over a few cycles of the supply, but expect to see up to at least 240v 'routinely', as kit is switched off locally. In the UK, for example, it is perfectly 'legal', for the supply to reach about 253v...

I'd suggest that the safest/best route, would be to use an instrumenttion transformer. Then if you want a really accurate reading, feed the output of this into a true RMS converter. Alternatively (cheaper), feed it to a peak detector, and use the /1.414 conversion from peak to RMS (only correct for a sine wave), to give a good estimate of the voltage.

As a further comment, if your unit is mains powered, then just use the voltage on the secondary of the transformer feeding it's power supply. While not as good as a proper instrumentation amplifier, this is what is done by many commercial units...

Best Wishes
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 03, 2009 11:44 am     Reply with quote

YES, Keep in mind #1 of ttelmah said.
consider the http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=AD736JNZ-ND for the rms reading.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Feb 03, 2009 12:30 pm     Reply with quote

Acceptable accuracy may be achieved by measuring at the secondary of the supplying transformer, if it's only light loaded. This would allow for an isolated processor circuit without additional effort. True RMS signal processing, if required at all, can also be done in software, if you have sufficient free processing time.
javi.ar



Joined: 17 Feb 2006
Posts: 59
Location: Argentina

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Tue Feb 03, 2009 1:11 pm     Reply with quote

Yes basically I want to track voltage variations and at a glance have the voltage, I am not really too worried for the accuaracy.
The idea behind this was to have at home 3 leds, green for 220v (and around +- 5%) red for 220v +10% & yellow for 220v -10% .
So accuaracy it is not a big problem for me. Even less now when I read Ttelmah's replay. I might consider to go wider with the percentage.
Good help guys
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group