More isolation

A project log for Raspberry Pi Garage Door interface

Control and monitor a garage door opener with HomeBridge

nick-sayerNick Sayer 05/30/2023 at 13:550 Comments

While there is an optoisolator for the sensor input, the LED inside it is powered by the Pi's 5 volt supply. One could make the argument that that is not full isolation. The purpose of such isolation is to protect the Pi's GPIO pins from any potential abuse due to any stray current (from whatever source) showing up on the wiring of the sensor.

If, say, someone connected line voltage inadvertently to one of the sensor lines, the result would either be blowing out the optoisolator LED or energizing the Pi's ground. Given that the Pi's power supply itself is very likely an isolated flyback topology, the latter scenario, while dangerous to personnel, is less likely to be damaging to the Pi itself, unless perhaps the entire thing becomes a high current path from the HV source to ground.

The solution to this would be an isolated DC-DC converter module to create an independent and isolated 5 volt supply just for the opto. This is certainly doable, I am just not convinced that it's worth the extra cost (though you could make similar arguments about the opto itself).

Another potential argument in favor of doing that sort of thing would be if 5 volts wasn't enough voltage for a potential long length of sensor wiring. There's no reason the DC-DC converter couldn't have a different output voltage - say 12 volts. You could then replace the series resistor with a 20 mA current regulator instead. In that universe, you could imagine the sensor having 500 Ω of impedance in the closed state and the circuit would still work (instead of, perhaps, a maximum of 100 Ω or so). But in the context of a garage door controller, it's hard to imagine this being an issue.