I'm trying to control the keyfob from arduino/esp32 with N-MOSFET by basically bypassing physical switch on the remote with an esp32 controlled MOSFET. It works, but I wanted to add a feature of reading key fob battery level too (so I can replace it on time) and this is where problems started :-)

When trying to share the ground with battery, the MOSFET switch stops working. When I connect those circuits separately everything works perfectly. Any chance to have both circuits working together?

enter image description here


1 Answer 1


The keyfob switch is usually connected from one terminal to its positive supply and from the other terminal to the input of its controller IC. If you connect the latter to the ground you are inhibiting the switch and maybe short circuiting the keyfob battery if you press the switch.

You can replace your mosfet by an optocoupler. From esp32 side you connect the output to the photodiode of the optocoupler through a resistor and the transistor of the optocoupler to the keyfob switch.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.