This high-voltage optoisolated interface board was initially designed for use with 24VAC solenoid valves used in irrigation, but can be applied to any circuit where a microcontroller needs to detect a high-voltage signal. By current-limiting, voltage dividing, Zener clamping and then optically isolating the input, a huge range of voltages can safely be detected by 3.3 or 5V microcontrollers. There is also a second Low-Voltage input that bypasses some of the protection circuitry.
Adjusting resistors R1 and R2 is needed to accommodate higher or lower voltages. The Zener diode D2 clamps any surges or spikes, and R4 limits the current flowing into the LED side of the optocoupler so as not to fry it. By tweaking R6, you can change the overall sensitivity of the optocoupler and require more or less current flowing through the internal LED to trigger the output.
Any time you are working with voltages above the Vcc of your microcontroller, it’s handy to have modules like these to simplify development and ensure you don’t fry your control electronics. I’m sure I’m not the only one who has accidentally connected the black wire to the yellow wire and then suddenly all the magic smoke escapes from your Arduino! So protect your project, and check out Concise Technology’s products!