I am new to electrical engineering so I am not even sure that I approach this problem correctly, so I will first give some background information.
I have a RC car (LEGO dirt crusher 8369) that I want to control from a raspberry pi. In order to do that I disassembled the car's remote controller and found out that if you connect the green cable and the black cable the car starts to move forward. If you connect the black cable and the other cable the cars starts to move backward. This lead me to think that I can use a transistor as a switch that will either connect the two cables or disconnect them, depending on if I turn on or off a GPIO pin connected to the base on the transistor.
The problem is that this does not work. Regardless of what I set the GPIO pin to (on or off) the car still moves forward, which means that current is flowing through the cables and the transistor.
Here is an image of the remote controller:
The current is flowing from the green cable through the black cable. The current is 23~27 μA. The voltage between the cables and GND is 30 mV.
Below is an image of the remote controller connect to my raspberry pi via a transistor.
The transistor I use is a "C546B" transistor. The black cable is connected to the emitter and the green cable is connected to the collector. To the base I have connected a 4.66 K resistor and then a brown cable that goes to a GPIO pin on the raspberry pi.
I have tested with a multimeter that the GPIO pin work. When the GPIO pin is turned on it output 3.3 V and 0.678 mA as expected. When I turn it off, it outputs 0 mV and 0 μA.
If I remove the brown cable so nothing is connected to the base, the car stops moving forward as expected.
One interesting thing to note is that the car "lag" a bit when I have the transistor in the circuit. The car starts to move forward, then stops for around 100 ms and then starts to move forward, stops for a few milliseconds, and so on. If I connect the green and black cable directly to each other the car move forward uninterruptedly without any "lag".
I also have tested to swap the emitter and the collector cable but that makes no difference.
Why is the transistor always "on" regardless of setting the GPIO pin to on or off? Do I need some special transistor, if so, how do I know what to look for?
-
TL;DR:
Current is flowing through the transistor even though the GPIO pin is off. Why?
simulate this circuit – Schematic created using CircuitLab