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.

  • \$\begingroup\$ Fyi, there is a specialized Arduino stack. (They have a similar policy towards component recommendation questions, though.) \$\endgroup\$ – Nick Alexeev Dec 6 '17 at 20:19
  • 1
    \$\begingroup\$ Yeah, I understand the policy. The issue is that I don't know what to buy. The "problem" I'm trying to solve is how to control a switched circuit that has to be isolated from my main circuit. The answer is a relay of some sort. That I know already. But I don't know which relay to purchase. I'll reword the question generically, but if the answer I get is "Use a solid state relay", I will have gained nothing... \$\endgroup\$ – Michael Oryl Dec 6 '17 at 21:18
  • \$\begingroup\$ Measure voltage from each contact of the 'OFF' button to Ground and Vcc, with the button pressed and released. What do you get? \$\endgroup\$ – Bruce Abbott Dec 6 '17 at 21:55
  • \$\begingroup\$ @BruceAbbott Interestingly, OFF 1 and 2 both measure 3.13v to ground. ON 1 measures 3.13v to ground, as well, but ON 2 appears to be a ground. ON 2 is 0v to ground and 3.3v to the 3.3v power source. That explains why ON works, I suppose. \$\endgroup\$ – Michael Oryl Dec 6 '17 at 22:31
  • 1
    \$\begingroup\$ There appears absolutely no reason this question should be closed.... and certainly not for the 'hold' reason given. \$\endgroup\$ – Jack Creasey Dec 6 '17 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.