I'm trying to simply detect the presence of a voltage, either AC or DC, across a wide range (5v through 240v).
I attached a picture of my current schematic. LTV817 opto-isolator gain should be around x10.
However I think I can simplify this design to fewer resistors and relays.
Range A: 1M Resistor
240v / 1M = 0.00024 * 10 = ~2mA
120v / 1M = 0.00012 * 10 = ~1mA
Range B: 100k Resistor
48v / 100k = 0.00048 * 10 = ~5mA
24v / 100k = 0.00024 * 10 = ~2mA
12v / 100k = 0.00012 * 10 = ~1mA
5v / 100k = 0.00005 * 10 = ~500uA
I suppose since the 5v case might only produce half a milliamp, I should increase the pull-down resistor to 100k and perhaps eliminate the 10uF capacitor altogether. In the case of AC, I can have microcontroller detect and ignore zero-crossings so the capacitor might not be needed anyway.
Does this seem reasonable, or my original schematic is best, or is there an even simpler approach I am not thinking about?
View attachment 41425
I attached a picture of my current schematic. LTV817 opto-isolator gain should be around x10.
However I think I can simplify this design to fewer resistors and relays.
Range A: 1M Resistor
240v / 1M = 0.00024 * 10 = ~2mA
120v / 1M = 0.00012 * 10 = ~1mA
Range B: 100k Resistor
48v / 100k = 0.00048 * 10 = ~5mA
24v / 100k = 0.00024 * 10 = ~2mA
12v / 100k = 0.00012 * 10 = ~1mA
5v / 100k = 0.00005 * 10 = ~500uA
I suppose since the 5v case might only produce half a milliamp, I should increase the pull-down resistor to 100k and perhaps eliminate the 10uF capacitor altogether. In the case of AC, I can have microcontroller detect and ignore zero-crossings so the capacitor might not be needed anyway.
Does this seem reasonable, or my original schematic is best, or is there an even simpler approach I am not thinking about?
View attachment 41425