I'm currently trying to hack up an IR remote for electric holiday candles so that I can use Amazon Alexa or Google Home to turn them on or off. To do so, I need to trigger the switches on the hand-held IR remote that comes with the candles.
I attempted to do this using NPN transistors controlled by a micro-controller.
I connected the remote to the micro-controller's VCC and ground pins to provide it with power. I then used two GPIO pins to supply voltage to a pair of NPN resistors (separately). When I pushed either pin HIGH, it would allow current to flow across the transistor associated with that pin, acting as a closed switch (I hoped).
I then placed each transistor in the remote control's circuits in place of the mechanical switches.
The problem I have is that I can get the remote to treat whichever transistor is across the ON circuit to work, but the one for OFF fails. It doesn't matter which transistor or which PIN is used. ON works, OFF fails.
I have tested all both orientations of emitter versus collector in the OFF switch location, as well, in case current flow direction was an issue. It has no impact. ON works OFF fails still.
So why can I get the one to work and not the other? I don't have a diagram of the actual IR remote circuit, I merely followed the traces to see how the switches are wired up. I know I have that much right because I can use a physical switch of my own in place of them (or just a wire shunt) and they fire exactly as if the remote's own buttons had been pressed.
What's going on here? Why can't I use NPN transistors for this job?
UPDATE: I measured the voltage across a few points for further insight.
ON PIN 1 to Ground = 3.3V ON PIN 2 to Ground = 0V ON PIN 2 to VCC = 3.3V ON PIN 1 to ON PIN 2 = 3.06V
These make sense. On pin #2 is basically ground. The switch allows the current from pin one to make it to ground, completing some internal circuit that causes it to fire the IR.
OFF PIN 1 to Ground = 3.13V OFF PIN 2 to Ground = 3.13V OFF PIN 1 to OFF PIN 2 = 0.01V OFF PIN 2 to OFF PIN 1 = -0.01V
Perhaps this will shed more light on the problem. It seems that the voltage potential is so low between the OFF pins that it would not be usable, but I confirmed that touching pins 1 and 2 of the OFF circuit together turned off the candle and the measurement of 0.01V is consistent.