0
\$\begingroup\$

I have teared down a radio controller of an RC car. I'm trying to control the car with a PC through Arduino Mega 2560 Rev 3.

The controller is very simple. It takes 9 V in. There is six wires to control the car. There is left, right, forward, backward and two ground wires. If you want to drive forward you have to connect ground and the wire that says forward.

I've wired the circuit as the following. Arduino outputs four times 5 V through pins 8-11. Then there are 1.2 kΩ resistors for each output (the resistors are wrong in the image). The resistors are connected to the base of PNP transistors (BC327). The emitter is getting the 4.5 V the radio controller outputs in the wires used to control the car. Finally the collector is connected to the ground of the radio controller.

enter image description here

The image isn't perfect but I think it might help a bit. The four collectors are connected together to the ground of the controller. I left the emitters open because there was so little space in the drawing. They are connected as I described above.

What I've understood PNP transistors let the current flow from emitter to collector when no voltage is applied to the base. When I set the pins on Arduino high (5 V), nothing happens. The car is still going.

How do I fix this?

\$\endgroup\$
1
  • \$\begingroup\$ Post a proper schematic! \$\endgroup\$ Mar 31, 2013 at 18:33

1 Answer 1

2
\$\begingroup\$

You need NPN transistors like this (1 channel)

enter image description here

PNP transistors will switch up to a positive supply and you have already stated that the controller inputs need to be grounded. 1k2 resistors are fine and virtually any NPN transistor will be fine.

A low output from the arduino does not trigger the NPN therefore it remains open circuit. A high from the arduino turns on the NPN transistor.

\$\endgroup\$
6
  • \$\begingroup\$ Thanks for the answer. I hoped I could have used PNP transistors... need to go and buy some NPN ones, lol! \$\endgroup\$
    – MikkoP
    Mar 31, 2013 at 19:08
  • \$\begingroup\$ By the way. The controller has different ground than Arduino. Will it work like that when there's not ground connection in Arduino? \$\endgroup\$
    – MikkoP
    Mar 31, 2013 at 19:10
  • \$\begingroup\$ The transistor emitters MUST be connected to both the Arduino ground and to the controller ground. \$\endgroup\$ Mar 31, 2013 at 19:57
  • \$\begingroup\$ Without making any other connection, connect both grounds together and see what happens. Then make a short from a controller input to the common ground. If that still works then no problem. If something strange(?) happens then you might need to use opto-couplers and have the two grounds isolated. \$\endgroup\$
    – Andy aka
    Mar 31, 2013 at 19:59
  • \$\begingroup\$ Okay, I changed PNPs to NPN transistors. But I have a problem. I have connected collector to 4,5 V (the controller) and emitter to the ground. Arduino is connected to the same ground. If I connect transistor base to Arduino pin, it will start the current flow from the collector to the emitter even I'm not applying any current to the base. What's wrong this time? \$\endgroup\$
    – MikkoP
    Apr 1, 2013 at 13:35

Your Answer

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

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