Track power mains

Discussion in 'Embedded Systems and Microcontrollers' started by axeman22, Jun 8, 2009.

  1. axeman22

    Thread Starter Active Member

    Jun 8, 2009
    along this line of thread..

    I want to make a PIC sensor circuit which detects the quality of the Mains power - so it would use the ADC input on the PIC to measuring between 220Vac and 250Vac. the measuring range would be 30Vac - the 30Vac above 220Vac of course.

    I'm planning to sample it every 0.5 seconds for 15 minutes and if the 240Vac mains remains within a continuous respectable healthy limit ± from 240Vac then I'll perform an action.

    thinking back to my theory.. if you take 240VAC and run it through a bridge diode rectifier and then smooth it right out with some caps would you measure 240VDC ?

    Also from my understanding the ADC sample input on the PICAXE cannot be greater than Vcc for the PICAXE - so somehow I need to make a range of 30Vdc equate to 0-5VDC as the input to the ADC pin on the PICAXE.

    Hope that makes sense.. this is something I'm just thinking about at the moment.. would appreciate any ideas anyone has on the few hurdles I need to jump.

  2. beenthere

    Retired Moderator

    Apr 20, 2004
    Welcome to AAC.

    We really insist on your starting a new thread with each question. The thread you posted into is two years old, and quite forgotten -

    You must use a transformer for galvanic isolation from the mains. Any circuit working driectly off the mains will present a lethal shock hazard.

    As you cannot measure that high a voltage, using a stepdown transformer to reduce the line voltage to a measurable level also makes sense.

    The resulting DC voltage from a rectified and filtered AC voltage will be 1.4 times as great. For instance, 240 VAC would give 336 VDC. Your application might work with a 6 volt stepdown transformer and a resistive divider to bring the resulting 8.4 VDC down to the range the A to D can handle. Using two equal value resistors brings the voltage down into the 4 volt range, which is probably good enough.