Miguel Reznicek wrote: > Friends: > > Does someone know of a PIC chip circuit that will monitor the 220 VAC mains > and use them to run, but that can automatically switch to a battery power > when the mains fails? I need to make an alarm for when the power fails. > > Thanks in advance, > > Miguel Reznicek > mreznicek@pretensa.com > > > Monitoring of 220VAC mains is best done with an optocoupler in series with several high-ohmage resistors. Normally 1M ohm is enough, but in actual operation, the 220VAC will jump over the resistive material, so several at 470K in series will then work properly. A simple diode can allow a battery to take over when power fails. Don't make this more complicated than it needs to be. --Bob A -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist