Tim, you can do that when the light is off by connecting 10 meg resistor + diode after your light bulb where it gets connected to triac to one of pic pin. make sure your light bulb is connected to HOT wire software function: 1. turn off the light thru pic 2. check thru resistor logic 1 ? 3. if it is 1 then the bulb is there 0 means open 4. if 1 turn the light on 5. check thru resistor again if 0 it means it is working if 1 your triac is open now you can check if your traic is working too Andre Abelian Tim ODriscoll wrote: >Hi Everyone, > >I'm making a little PIC-controlled floodlight interface for my house, >and I'd like the PIC to be able to detect if the lamp filament is >working. > >The PIC is running off a 7805 from a wall-adapter, and is happily >controlling the floodlight via a triac. The floodlight is running off a >240vAC fused spur and is rated for 500W. I have another floodlight I'd >like to use for a second interface that is 250W, so I'd like to be able >to create a 'generic' broken-filament detector that doesn't rely on >there being a specific wattage of bulb. > >I've seen the X-10 Microchip app note where they just use a mega Ohm >resistor to connect a PIC pin up to the mains for the zero-crossing >detect, but I'm not sure on the safety issues of that one. > >My other idea was a transistor with it's base connected via a suitably >sized resistor to the 240v live just before the floodlight. The >transistor would drive an optoisolator. I've seen something similar on >piclist.com describing a stalled motor detector, but I've no idea if it >would work with a lamp of variable wattage at 240vAC. > >Any thoughts/ideas appreciated. > >Cheers, > >Tim > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist