0
\$\begingroup\$

I've got a 2N3904 hooked up to a pin on a NodeMCU Board (3.3V logic). I am trying to short the button contacts on a fan remote to trigger the speed and such, however, when I pull the base high (3.3V) or low, nothing happens. The only way I can get the remote to send a signal is if I "manually" short the collector and the emitter. I have attached a schematic below for reference. I'm thinking it's the incorrect resistor value....

schematic

\$\endgroup\$

closed as unclear what you're asking by Andy aka, Enric Blanco, PeterJ, Voltage Spike, Dmitry Grigoryev Jun 13 '17 at 15:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ More detail is needed of the connections to the remote control. Do you have the NodeMCU ground and the remote control ground tied together? \$\endgroup\$ – replete Jun 10 '17 at 23:31
  • 1
    \$\begingroup\$ You've got a low resistor value there anyway, pulling 3..4 mA out. I wouldn't go any lower for the moment. Are you sure its not a dud transistor? \$\endgroup\$ – TonyM Jun 10 '17 at 23:33
  • 1
    \$\begingroup\$ You need to do some reverse eng of the switch detection to see what is suitable, is it jus a pull-up that gets switched to ground or a keypad or something else \$\endgroup\$ – sstobbe Jun 10 '17 at 23:36
  • 1
    \$\begingroup\$ When trying to control an unknown circuit, it is often best to use a relay - the relay isolates the controlled circuit from the controller, and will appear as a simple switch contact to the controlled circuit. No worries about how the NodeMCU "Ground" is related to the voltages on the fan switch. \$\endgroup\$ – Peter Bennett Jun 11 '17 at 0:19
  • 1
    \$\begingroup\$ Ground connectins of uC and transistor and controlled equipment MUST be inter-connected . MUST. Resistor is smaller than needed and MAY load uC pin too much. 3k3 to 10k would be better. If you wish to maintain isolation an optocoupler can be used. \$\endgroup\$ – Russell McMahon Jun 11 '17 at 7:55
2
\$\begingroup\$

An NPN transistor can only take the switch connection to within 0.2 volts of ground. Substitute a logic level FET with low R DS and it should work for you.

\$\endgroup\$
  • \$\begingroup\$ I did have some logic level FETs on hand (specifically the FQP30N06L) but I couldn't get it to switch off. I connected it almost the same way as the transistor, just with a different pinout. \$\endgroup\$ – Owen Jun 11 '17 at 3:16
  • \$\begingroup\$ Add a 5-10k resistor from the gate to ground. That will help ensure the FET turns off. \$\endgroup\$ – Glenn W9IQ Jun 11 '17 at 4:36
  • \$\begingroup\$ FET may help, but I would think the BJT should work, too. I am thinking maybe the button doesn't work the way the OP thinks it does. Maybe the button is not just shorting a pullup to ground. Maybe there is something else going on here. \$\endgroup\$ – mkeith Jun 11 '17 at 6:13
  • 1
    \$\begingroup\$ It is possible that it is a scanned switch matrix. \$\endgroup\$ – Glenn W9IQ Jun 11 '17 at 6:15
0
\$\begingroup\$

I eventually got it working by connecting both grounds together (NodeMCU and fan controller) and sending the signal to the transistor through a 4k7 resistor.

\$\endgroup\$

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