# Substituting Arduino for ESP8266 in a (Yet Another!) Garage Door Controller

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!

• A schematic might help, you can add one using the editor, by pressing Ctrl-M. – Tyler Mar 28 '16 at 15:01
• Please provide a schematic, you probably don't have your grounds connected correctly and you actually have an open circuit now that you've gone wireless – Voltage Spike Mar 28 '16 at 19:53
• Your mention of measuring currents "across" components is a bit unsettling. Voltage is measured across components, while current is measured through them - so hopefully you broke the circuit and inserted the ammeter inline to reconnect it, rather than shorting the circuit with the meter. – Chris Stratton Apr 2 '16 at 17:11
• @ChrisStratton, I'm sorry for the poor choice of my words. I inserted the ammeter inline. – sl33nyc Apr 3 '16 at 17:22