5 Replies Latest reply on Sep 2, 2013 2:34 PM by raspberryk

    How to control an RC car's remote with Raspberry Pi

    raspberryk

      I was wondering if anyone could help with direction on making my idea a reality. I would like to wire the remote control of an RC car to the GPIO pins of the Raspberry Pi. I just do not know how to "make the connection" between the GPIOs on the Raspberry Pi and the remote's switches that drive the car. Ultimately, I was thinking that I could easily drive the Raspberry Pi around on this RC car, if I could activate it's switches.

       

      small_IMG_1521.jpg

       

      To start, I only want to send one signal from one of the GPIO pins, and make one track go one direction (to make things easy). To help understand I've snapped some pictures and took a reading.  The remote, after taking it apart looks like this on the top:

       

      small_IMG_1498.jpg

       

      And this on the bottom:

       

      small_IMG_1501.jpg

       

       

      When I have it on, and place the voltmeter on it, I get a reading of 4.36 volts:

       

       

      small_IMG_1503.jpg

       

       

      So my thought is that I should have something between the GPIO pins on the Raspberry Pi, and the J1-J4 headers on the remote's board. The remote control itself uses a 9V battery. Should I use transistors to convert the 3.3V signals from the Raspberry Pi to try and match the 4.36V that is running across the remote's switches?

       

      For what it's worth, it seems like more fun to control the remote of the unit, rather than the RC car itself. Also could be done with items like wall outlet remote controls: http://www.newegg.com/Product/Product.aspx?Item=N82E16812820011.

       

      Thanks in advance for anyone's thoughts or help. You can see my previous work with the Raspberry Pi here to get an understanding of where I'm at with this type of stuff... its nothing ground breaking, but I've been enjoying it: http://karlherrick.com/dev/category/raspberry-pi/

        • Re: How to control an RC car's remote with Raspberry Pi
          John Beetem

          First, you might get more replies to this question if you post it in the Raspberry Pi group, or move it there: http://www.element14.com/community/groups/raspberry-pi.

           

          When I'm trying to do something like this, I generally try to extract a schematic of the circuit board I'm trying to adapt.  It looks to me like your remote has four switches, where pressing a switch connects J1-J4 to a common signal, which is probably ground or the negative terminal of the 9V battery.  If that's the case, RasPi can drive NPN or NMOS transistors which act as surrogates for the switches.  If the common signal is ground, you only need to pull down to ground and you don't need to worry about generating 4.36V.  Use the multimeter to measure the current between the common signal and J1-J4 to see how big a transistor you need.

           

          There's a good description of RasPi GPIOs at the RasPi Hardware Wiki: http://elinux.org/RPi_Low-level_peripherals.

            • Re: How to control an RC car's remote with Raspberry Pi
              raspberryk

              Thanks John, I appreciate the lead, and have also moved the question to the Raspberry Pi group.

               

              Use the multimeter to measure the current between the common signal and J1-J4 to see how big a transistor you need.


              Do you know the best way for me to figure out what the common signal is, whether it is ground or the negative terminal of the 9V battery?

               

              If the common signal is ground, you only need to pull down to ground and you don't need to worry about generating 4.36V.  Use the multimeter to measure the current between the common signal and J1-J4 to see how big a transistor you need.

               

              If the common signal is the negative terminal of the battery... based on what you  said previously then, I think I would need to generate 4.36V for it to work properly. Does that sound right? I'd like to complete the next step as you suggested. Maybe its easier than I am making it out to be? :-|

               

              Thanks again for your help.

                • Re: How to control an RC car's remote with Raspberry Pi
                  John Beetem

                  Looking at your photos, it looks like the blue wire is the common ground and goes to the negative battery terminal.  It looks like the red wire is +V (it's labeled "RED(+)" on the PC board) and probably goes to the positive battery terminal.  You can verify this by looking at how the 9V battery snaps in.  The battery's terminals are labeled + and -, so you can see which wire corresponds to + and -.

                   

                  To check how things are connected together on a PC board, put your multimeter on its most sensitive Ohmmeter setting (usually 200 Ohms) and make sure your PC board power is OFF -- take out the battery.  Then press the probes onto two points you think might be connected.  If there is a conduction path between them, the Ohmmeter shows the resistance.  For a wire or PCB trace, the resistance should be near 0 Ohms.  There is some resistance in the probe leads, so touch the probe tips to each other and see what that reads.  Usually it's between 0.3 Ohms and 0.5 Ohms.  You need to subtract that when you measure resistances on the PC board.  Also, you may need to scratch flux off a PCB location to make good contact.

                   

                  So put one probe at the blue wire terminal where it would connect to the battery.  See if it's really connected S-shape springs that are used as switches.  If they connect, you're in great shape because you can just use NPN or NMOS transistors to act as surrogate switches.

                   

                  I did a search at the front page of www.raspberrypi.org by entering "drive the base of NPN" in the Google search box.  Here are two useful forum threads that relate to your situation:

                   

                  http://www.raspberrypi.org/phpBB3/viewtopic.php?f=42&t=10105

                   

                  http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=14624

                   

                  One of these threads has a link to this page: http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/

                   

                  It shows how to use RasPi to drive a small relay.  There is a schematic diagram that shows using a 1K resistor R1 and an NPN transistor Q1 along with other components.  In your case, you should only need R1 and Q1 for each of your four switches.  The flyback diode D1 is only needed for an inductive load like a motor or speaker.  Also, you won't be using RasPi's 5V or 3.3V.  You only need the transistors to pull down -- the pull-up circuit is on the remote control's PC board.

                   

                  But first check that the common ground is indeed the negative battery terminal so you can use NPN transistors.  Then, with the power on, activate one of your switches by using your multimeter as an ammeter.  This will tell you how much current has to go through the transistor.  If it's less than 30 mA (and the ground is the battery negative terminal) you should be able to use the R1 + Q1 circuit.

                    • Re: How to control an RC car's remote with Raspberry Pi
                      John Beetem

                      Addendum -- one thing you need to check is RasPi's start-up behavior.  I suspect that all GPIOs except for UART are configured as inputs -- that's pretty standard since it's safest.  But I don't know if any of the GPIO internal pull-ups are enabled.  I've read that these are about 60K Ohms.  If they are enabled, you could get a small current into the NPN transistor's base which might be enough to switch it on if it's a sensitive transistor.  One way to prevent this is to add a 4.7K Ohm pull-down at the input of R1 so that the pull-up can't pull R1 high enough to switch on the NPN transistor.  Such a resistor is also a good idea if you're using an NMOS FET in place of NPN transistor Q1.

                • Re: How to control an RC car's remote with Raspberry Pi
                  raspberryk

                  While I haven't tried the relay idea (to have my Rasperry Pi control the remote of my RC car), I ran across Arduino Cookbook (by Michael Margolis) that seems to suggest that using optocouplers may be a suitable method for accomplishing such things.

                   

                  The section I read titled 10.5 Controlling AC Devices by Jacking a Remote-Controlled Switch appears to make it relatively straightforward. Has anyone tried one way or the other, or have any thoughts on optocouplers as an alternative to using relays?

                   

                  figure-10-4.png

                   

                  Thanks for everyone's thoughts.