I have a garage door opener with two leads that will activate the motor if the leads are shorted. I hooked my multimeter into the leads and measured ~24VDC and triggered the motor ~50mA.
Using an Arduino Nano v3 as a power supply, I wired a simple push button to short the 3v3 output through a 100 Ohm resistor (R1) to the emitter side of the an H11AA1M optoisolator. The Arduino's ground goes to the other input of the emitter side of the optoisolator.
On the detector side of the optoisolator, I hooked the leads from the garage door opener through another 100 Ohm resistor (R2), and when I press the button, I can successfully control the garage door opener. I could be remembering things incorrectly, but I'm fairly certain I measured between 20-30mA across R2 when the door activates.
When I swap the Arduino for an implementation of the ESP8266 and swap the button for one of the ESP8266's GPIO, I cannot activate the garage door opener when I push gpio.HIGH
across the connect GPIO. I also measured 20-30mA across R2.
If I toggle R1 or R2, I see different current values across R2, but if I'm fairly confident that I'm within tolerance for the necessary current to trigger the garage door opener. I ultimately want to drive my custom controller using the GPIO, and as far as I'm aware, I just need to activate the optoisolator's emitter to drive the transistor on the optoisolator's detector side into saturation.
What's going wrong? I'd love to know how to best diagnose my problem. I have a feeling that I'm not calculating something correctly based on the optoisolator's specs, but Googling hasn't led me to tutorial that hasn't made my head swim. I'm love some more insight into how to best read the optoisolator's specs and how they apply to my current and future projects.
(Please don't suggest I swap out the optoisolator for a relay. I realize that relays will probably be less finicky, but at this point, I'm more interested in the why than how.)
EDIT: I removed R2 and confirmed with the multimeter that >30mA run across garage door opener's leads, and now, the garage door opener is properly triggered!