That's what I do on my standby generator's PLC, but should work on a PIC. A wallwart with 12 VAC out, rectifier bridge, and resistor voltage divider with a pot for for calibration adjustment. All I need is voltage within a few volts accuracy, to verify the generator is actually putting out current, or the power line is down. Michael Rigby-Jones wrote: > >> -----Original Message----- >> From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On >> > Behalf > >> Of Dario Greggio >> Sent: 08 March 2010 10:18 >> To: Microcontroller discussion list - Public. >> Subject: [PIC] measuring 220V mains >> >> I am to use a 24FJxxGA106 to (along other things) measure 220V mains >> voltage with some coarse accuracy, say 1-2% >> >> I have a small 220->6V transformer, whose inputs goes via a partitor >> (still have to decide, but let's assume it 4K7 - 2K2) to AN2 of the >> > PIC. > >> So, more or less 2Vrms or 3Vpp circa when mains is nominal 220V. >> > > Sorry if this is being obvious, but you will either need to rectify the > output of the transformer or apply a suitable voltage offset in order to > prevent any negative voltages on the PIC pin. > > Mike > > ======================================================================= > This e-mail is intended for the person it is addressed to only. The > information contained in it may be confidential and/or protected by > law. If you are not the intended recipient of this message, you must > not make any use of this information, or copy or show it to any > person. Please contact us immediately to tell us that you have > received this e-mail, and return the original to us. Any use, > forwarding, printing or copying of this message is strictly prohibited. > No part of this message can be considered a request for goods or > services. > ======================================================================= > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist