To detect an incandescent bulb, whether on or off, you can look at the voltage across the open switch .or. the current through the switch. Iow, for dc, a double comparator should work. One side measures the voltage across the switch and the other current by measuring a voltage across a shunt. So both of these are voltages and they are in parallel. So one measurement is enough: Measure the voltage across the switch, whether open or closed (assuming the switch voltage drop when conducting does not make this measurement difficult). So for AC, putting an optocoupler across a triac should do the job (with the additional caveat that the oc must sense 'on' with voltages from 1.3 to 300 V across it - this is not your average optocoupler but there are ways to fix that). The detection of the type of bulb installed by looking at the wires is nearly impossible. Incandescent can be distinguished from everything else by looking at the wires only (using two currents, even across a halogen transformer), but after that there is no way to tell arc lamps, electronic ballasts, leds direct driven, leds switcher driven. It's a jungle. Peter P. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist