www.circuitcellar.com did an article (i think last year) that measured the amps on lines. it used a coil with a number wire wound a number of times around the coil and one leg of the main passed through the coil. this created a small ac signal proportional to the amps being drawn. they feed this signal into an ADC but if all you need is on/off you could use a comparitor. michael -----Original Message----- From: Luis Fernandez To: PICLIST@MITVMA.MIT.EDU Date: Thursday, April 23, 1998 2:01 PM Subject: Detecting AC power line on/off Hi list, Would like to know your opinion in how to detect activity (power on) of devices connected to mains power supply (220V 50Hz here) in order to provide a clear input into a PIC I/O pin. Goals are: Isolation from power line, Reliability, Low cost and low size Relays with 240V AC coil are usually big because they are made to switch heavy loads, so expensive and the coil can fail. The samallest I could find was a 24V AC relay + resistor, but still not very reliable. What about using a neon lamp and some kind of optical detector (fototransistor) and may be an RC network to integrate the pulsing light of the neon. What kind of optodetector can be used with this arrangement ?. Any other idea ? Luis Fernandez Cormenzana RadioBit Sistemas, S.L. Sistemas de control de rondas Patrol presence controllers Control de patrullas y vehmculos Patrol vehicle fleet control http://www.dragonet.es/users/radiobit Tel/Fax: +34-96-5856457