I'm currently designing a 'smart' light switch, controllable from Microcontroller and physical switch. I am looking for a low power solution to convert signal so that the Microcontroller can detect if there is mains voltage at the input of the lamp (or arbitrary device). The device will also be embedded in the walls so required small form factor, as well as low power loss / heat due to limited ventilation. Thank you in advance for the advice, I am quite new.
Goal: Detect (from microcontroller) if the output from the relay has AC mains / connected to live wire. Should detect regardless of the lamp being connected or not (no load/open circuit). This is to notify user if the device being powered is safe to handle / exchange or not. It doesn't need to know the exact voltage, just the presence. Delay of few 10s to 100s ms is acceptable.
Additional info: The Microcontroller may be powered from mains or a 24v dc supply line, currently deciding.
Size: aiming to fit 3 sets of relays and detection components (as well as a power supply for the Microcontroller and the Microcontroller) into 8x4 cm.
Power: aiming for the detection solution to take on order of 10s of mW.
Cost: aiming for the detection solution to take ~<$3
From what I've read there are a few approaches.
- Voltage Transformer into rectifier and capacitor (low pass filter)
Pros: Isolate high and low voltage
Cons: Voltage Transformer may be large and costly.
Unsure: Rectifier may dissipate a lot of power.
- Optocoupler
Pros: Isolate high and low voltage. Low space
Unsure: Optocoupler may require consume lots of power.
- Difference Op Amp
Pros: Low space
Cons: No isolation
Unsure: Op Amp power consumption
- Hall Sensor
Pros: Low space, low cost
Unsure: Hall sensor power consumption. Operation under no load (no current flow -> no magnetic field?)