modding an RC car

I am trying to mod an RC car to be controlled by the Ardunio. After much reading on the net for tutorials I am pretty confused. I only have basic ardunio skills (hooking up leds/sensors, basic serial communication).

The is a chip in the middle of the RC cicruits which after research appears to control the car. It has 12 pins and i figure some of them must make the car go foward back etc. However I am not sure how to hook it up to the ardunio. I tried just connecting it to a digitial out with a resistor in between and touching each of the pins but none of them seemed to do anything.

Could someone please help me at least get the arduino to start the motor or something? Currently I am just at a deadend and have no idea what to do next.

a chip in the middle of the RC cicruits which after research appears to control the car.

Care to publish your research for peer review? Otherwise, we're just playing guessing games.

okay maybe the easiest thing is to show a picture

Any comments about the steering geometry of the vehicle (skid, differential, servo, passive one-way in reverse...), size of motors, where and what the motors are connected to, power source, observed oscilloscope traces of control signals... would be welcomed. I'm guessing the "5W5RJ" marked components are also connected to the motors.

Steering appears to be a servo with left/straight/centre positions only on front. On back is a drive motor which appears to only have one speed and can go forward and back.

The motors are sealed up in the plastic and i was hopefull i wouldn’t need to break it open so I don’t know what size they are.

For the thing with the 5WR5J both of the motors wires go into that before going to the other board. Both the blue wires to the motors come from the main board. I think are connected to the points labeled “m”. The drive motor to the m in the bottom right and the servo motor for an “m” between the 2 metal plate things which is obsured a bit in the picture.

Power source is a 9.6v 750mAH battery.

“oscilloscope traces of control signals” - I don’t know how to do this and don’t have an oscilloscope.

Note the board also connected via a single black wire that had some headlights that flashed, but I cut it out because It was molded into the plastic top which I was getting rid of. The car still runs fine on remote control.

You talk about "motor" and "motors" - are you including the steering servo in "motors"? Is this a simple, encapsulated R/C type servo, or some sort of bare-bones device built into the toy?

I was including the steering servo motor.

There is one drive motor and one steering servo motor. I think it is a simple encapsulated R/C type servo but im not that experienced with this sort of thing as you can tell.

Destined - I'm willing to bet that the IC with the sticker on it marked "27" and "2345678901" is actually the RX2 half (16-pin DIP version) of the TX2/RX2 chipset pair. This is a very commonly used chipset in cheap R/C toys; a couple of things would help in making this a firm diagnosis:

1) A much more clear picture of the board (and peel that sticker off too - see what the writing is underneath) 2) A clear picture of the backside of the board, too (so we can see the circuit diagram).

As it is - I can't tell which end is "pin 1" (I can tell if that is a divot at the top of the chip in the pic or what - too much glare).

Likely the two heatsinks at the bottom are part of a 4 transistor or mosfet h-bridge, probably for the main driving motor; the four smaller transistors at the bottom right of the pic are likely for the steering "servo". All of this is just guesswork.

You do still have everything connected, right?

Anyhow - if it is the RX2 of the TX2/RX2 pair - you can find a good datasheet that will explain all about it here:

http://www.et.byu.edu/~bmazzeo/LTR/tech.phtml

But get us those pics, too!

BTW - based on your explanation of hookup - did you happen to connect the grounds (of the Arduino and the car) together? What you should be doing is following the diagram in the app-note on the datasheet (for reference implementation), and perhaps just using a jumper from the positive supply on the -car- to the -input- pins of the chip (follow the diagram on the datasheet - you do this wrong, and you could blow the chip, and who knows what else).

If none of this works out, you can always just rip out the board and hook up external driving circuitry (a couple of L298/L293 h-bridges would likely suffice - an L298 for the drive wheels, and an L293 for the steering would likely be best).

:)

Hi, A quick mod might want to try is to have a look at the 'turbo' channel, its seems to be an unused channel between the transmitter and receiver in most models using the TX2 (transmitter) RX2 (car) pair of chips. You could use it to operate lights, or a buzzer for a horn as a quick exercise to get familiar with the two chips - I haven't tried this myself, but if it is an unused channel its begging to be used for something.

Until you are familiar with the RX/TX2 I would suggest you don't connect the Arduino to them, I have no idea how much current would be drawn by the car and in the few cars I have opened most of the decoupling capacitors are labelled on the PCB but just not installed I suspect the same goes for flyback diodes. This is probably not a safe environment for to learn in.

One option that might be safer is to start at the transmitter, when I was trouble shooting my sons christmas present I used a jumper wire between the vin pin and the left,right,forwards and reverse pins of the transmitter chip to successfully operate the car. You could use transistors to replace the push buttons in the transmitter and operate them in software using the Arduino.

Have a look at my blog for some other ideas, its mostly Arduino for RC Race cars, but might be interesting to you http://rcarduino.blogspot.com/

Duane B

DuaneB: Until you are familiar with the RX/TX2 I would suggest you don't connect the Arduino to them, I have no idea how much current would be drawn by the car and in the few cars I have opened most of the decoupling capacitors are labelled on the PCB but just not installed I suspect the same goes for flyback diodes. This is probably not a safe environment for to learn in.

I don't think any of this would really be an issue; if the car works fine without those parts, it's probably going to work fine with the Arduino in place of the RX2 chip. If there is much concern, just wire in the flyback diodes yourself if they don't exist (you're already hacking the car, what's a few more parts?).

As for the decoupling caps - you don't care about those. Ultimately, the point of the datasheet and the RX2 chip is to identify the pins for ground and the outputs. Once you have these verified and things working, you cut out/desolder the RX2 chip - it's no longer needed (nor are any decoupling caps it might or might not be using). The RX2 chip has a minimum output current of 4.5 mA at 4.0 VDC; I doubt that the maximum goes over 20 mA - but again, if this is a concern, find out what voltage is being used on those outputs (whatever the voltage is powering the chip on the VDD - pin 13), and use that to control the outputs - place a meter in between in current measurement mode, and find out. This is basic stuff here.

The only reason to use the transmitter would be if you want wireless open-loop control (not much use for most robot configurations) - or, you're so paranoid that you strap the transmitter (and batteries) to the car as well (workable, if awkward, I suppose - but then you are still wiring into the "other half" of the pair - what about any concerns there? I'm sure if the car was made cheap, so was the transmitter).

I wouldn't worry about direct connections to the outputs used by the RX2 chip - others have done this successfully if you search this forum (and it is being used by the class I linked before as well); but if there really are concerns, there are ways to address them before even hooking up the Arduino (if you are still worried - drop a 4N25/4N26 optocoupler between the Arduino outputs and the pads on the board, or a hex buffer IC, or a darlington array IC - or any number of other possible TTL buffering schemes).

First I would like to thank everyone for the replies especially for a lost new poster like me.

To answer all the questions to the best of my ability -The chip appears to be an RX-20 lC1081 (shown in picture). -Everything is still connected except for the lights (i wanted them gone anyway). The car still runs fine by the radio control. -I haven't connected the grounds (in fact i am not actually sure where the ground is on the car!) -Yes the car is cheap as. I decieded to get something really cheap to hook up first. Then I could get a more expensive one which has multiple speeds and a servo which does more than just straight, full left, full right.

I am unsure what my next step should be. I just assumed (maybe somewhat stupidly) that I could just basically use the ardunio to switch on the forward/back/left/right/straight by connecting it to the right point on the board.

This page has a diagram of an RX2 http://www.jbprojects.net/projects/wifirobot/

Below are pictures of the front and back in the best quaility i can manage.

There's a ground on the chip. First - you need to read and understand the datasheet I linked; it has -all- of the information you need to get this working. Looking at the clearer photo of the chip you posted, pin 1 is on the left-hand side, bottom (notice the divot on the left hand side of the chip - that is IMPORTANT). Pins are counted on DIP ICs starting from pin 1, across the "bottom" (ref your pic), then back from the right-top pin to the left (so pin 16 is above pin 1, pin 15 is above pin 2, and so on - understand?).

Now - if you look at the datasheet, the table on page 4 - you will see that pin 2 is ground for the chip - that's your ground. Hook a black wire up to that (trace back from the pin on the underside - remember, pins are reversed! - and find a convenient solder point - or just solder to the black wire from the battery, it should be the same). Now, you want the power pin - that is pin 13 (reference the datasheet!); since pin 9 is on the top-right (again, referencing your picture), pin 13 will be above pin 4. That is the power pin for the chip (VDD). Again, find a convenient solder point nearby and solder a red wire to it.

Now - you should be able to use that red wire (from VDD), and -carefully- apply it, with the car turned on, to pins 10 and 11 (backward and forward respectively), and pins 6 and 7 (right and left respectively) - reference the diagram on page 7 of the datasheet, notice how those are connected in the example circuit. Be careful -not- to short that wire against any other pin, or any other part, or you may damage something! If you must, find solder points from those pins to the rest of the circuit, and bring out wires from those points, then short the wire ends together (this is safer).

Also note pin 12 - that is the "turbo" pin. Setting this pin "high" may enable some mode (typically "fast high speed" when the "forward" pin is brought high).

Note also that sometimes, these pins and such are "reversed" - so that forward is backwards, and right is left, etc. Not sure why, but the manufacturers do this.

Let us know how that goes. That should work. Note that this is all without using an Arduino. You may need to prop up the car to keep it from running away from you. If you get this working, then we can move on to the next step.

Again thank you for the help :) I am starting to see where this is going.

I have attached an image to make sure I understand the pins before soldering.

It wouldn't be a good idea to solder on the top would it? just looks to be more space there than trying to solder exactly over the dot

Hi, I have a quick question for cr0sh or anyone else who may know.

I understand that the Hex buffer will take a TTL input and sink or source a larger current and voltage on the output side, is there a common IC that does the reverse i.e. takes a 6,7,8 or more volt input and converts it to TTL on the output side, with some protection in between ? If switching speed is a priority is an opto isolator my best option ?

Thanks Duane.

Destined: Again thank you for the help :) I am starting to see where this is going.

I have attached an image to make sure I understand the pins before soldering.

It wouldn't be a good idea to solder on the top would it? just looks to be more space there than trying to solder exactly over the dot

NO - This is wrong!

Look at your picture above. Pin 1 is at the BOTTOM-LEFT corner. Pin 8 is at the BOTTOM-RIGHT corner. Pin 9 is at the TOP-RIGHT corner. Pin 16 is at the TOP-LEFT corner.

Please re-draw your image - and post it again, so we can make sure you understand.

You do -not- want to solder onto the pins next to the chip -ever- because you may damage it from heat (especially if you are inexperienced - an experienced solderer can do this, but it is still risky).

Instead, look at the bottom of the board (and keep in mind that the pins are reversed when looking from the bottom - this is very important, and it is easy to make mistakes (even experts get confused!). Mark pin one or something with a marker if you have to. Ok - so looking at the bottom, where the chip is connected, you should be able to follow the trace out and away toward another pad (which may have a part in it) - solder to that pad; likely (especially for the pins that control functions of the car), that pad will be the leg of a resistor; the other leg of the resistor will be close by, and connected (likely) to the base of a transistor, as shown on page 7 of datasheet example. You want to solder to that resistor anyway to limit current to the transistor's base - whatever you do, don't solder to the base of the transistor, as you may end up drawing too much current and burn out either the resistor (or the Arduino's port).

That point should give you more room. If it still seems cramped - well, you gotta learn to solder somehow; if you don't want to risk it, then find some other "donor practice PCB" - and practice desoldering and soldering parts on until you are comfortable and make good solder joints. Also - here's a link (and the entire site is an excellent tutorial - especially if you are in the UK or Europe - if you are in the US, they use a slightly different method of denoting resistor values than we do here in the States - so keep that in mind if you decide to try any of the example circuits):

http://www.kpsec.freeuk.com/solder.htm

:)

DuaneB: I understand that the Hex buffer will take a TTL input and sink or source a larger current and voltage on the output side, is there a common IC that does the reverse i.e. takes a 6,7,8 or more volt input and converts it to TTL on the output side, with some protection in between ? If switching speed is a priority is an opto isolator my best option ?

Not voltage typically, just current - for buffers and opto-isolators; sometimes you may find parts that will allow for switching slightly higher voltages (it depends on the transistor or mosfet outputs). Also note that many buffers are inverted - that is, you put a logic HIGH on the input, and get a logic LOW on the output. Something else to keep in mind (read the datasheets of the parts in question - always try to read the datasheet for any "active" part if you can - and passives in the cases of diodes or similar) is that a part may require that pins are pulled either high or low, and not left floating; leaving pins floating on certain parts can damage them (or cause the outputs to be wonky).

There are voltage level conversion chips that can take (most commonly) a TTL level (5 volts) and drop it down to TTL 3.3 volts; if you are just needed to drop the voltage to supply power to a part (say you have a 12 volt battery, and need to run a 5 volt motor), then using a voltage regulator (and if needing the current - a bypass transistor; or an adjustable switching regulator) to drop the voltage to run the motor (or circuit - or whatever) can be used. But these aren't typically used to switch voltage to the motor or circuit - you would typically do that -after- the regulator or whatever.

Opto-isolators are most useful for, well, isolating a circuit; say on one side of the circuit you have a beefy motor, with transistors switching a lot of current, and with possibly voltage spikes being introduced by switching. You don't want this getting to the logic side of things, because doing so might cause the logic to behave wonky, reset your microcontroller, or burn something out. So you use an opto-isolator.

Basically, all an opto-isolator is, is an LED sitting next to a photo-transistor. When the LED is lit, the photo-transistor is turned on (note - check the datasheet for the opto-isolator; some have current limit resistors already for the LED, some don't - if it doesn't then you need to check the current and voltage needed for the input/LED in the opto-isolator, then calculate using ohm's law the size of resistor needed to pass that current, so you don't burn out the LED); this photo-transistor then controls the load, or more generally switches a beefier transistor controlling the rest of the circuit.

The key, though, is that with the photo-transistor, you can have -completely- separate grounds and power inputs for the isolated circuit - so that no noise or voltage spikes will travel back into the logic control. Your logic remains safe from the other side (unless you don't pay attention to how you route wires or traces on the board, in which case induced voltages/currents can be set up and cause problems - typically very difficult to diagnose problems, as well).

Now - for this R/C car, you may or may not want the isolation; it seems like (at least in the datasheet on page 7) they already use a transistor for some amount of buffering on the circuit (parts Q4 and Q9 for the forward/reverse, and parts Q10 and Q15 for left/right); if something goes wonky, these would probably burn out first before anything happened to the Arduino. But - a buffer or similar might be a good part to add if you are paranoid. You should also check and make sure that the manufacturer of your car actually put in those transistors (do this by following the traces - a good way to do this is to make a nice scan of the bottom - which you have - then using a paint program to flood fill the traces from part to part, while looking at the top-side and comparing things; make a rough schematic while you're at it if you want - it could be helpful!).

Something else to notice on that example circuit in the datasheet (check out your car to see if it is used): Remember the turbo function (pin 12)? Notice how it is wired in the example circuit: it goes to a transistor (Q3), that then turns on the "forward" function (Q4 - which turns on the h-bridge transistors Q6 and Q7 - making the motor spin in the "forward" direction); this flow also turns on transistor Q2, which switches the full 12 volts (or whatever the upper voltage is) into the motor circuit (instead of the normal 9 volts which is tapped from the battery at the right) - giving you the "turbo boost" function; pretty neat, huh?

Also something else; check out how your car steers - based on what I can see on the circuit board, page 7 is your likely example circuit - but notice that the datasheet lists a very different circuit on page 8 (I am not sure how this is supposed to work, unless "left" and "right" go to pins 6 and 7 or something.

Another thing (always something with me - I should write a book!) - ultimately - once you get this thing working with "probing", and you start to hook in the Arduino, you are going to want to desolder the chip from the board (another reason not to solder to the chip) - this is so the chip doesn't use up any current (you want that to power the robot and the Arduino!), and also so no power is supplied to the radio receiver portion of the circuit (consuming more current, as well as possibly getting interference into the circuit - making your robot do strange things).

Finally - I want to point out that the page 7 example circuit shows the view of the IC from the top down (exactly as I described the pin numbering in my last post) - just look at that to verify things, ok?

I have a board I ripped out of a very old phone to practice on :slight_smile:

Here is the new diagram

Also on the solder points are spots B and C acceptable or do I need to be going over the previous solder point like A?

You said “You want to solder to that resistor anyway to limit current to the transistor’s base - whatever you do, don’t solder to the base of the transistor, as you may end up drawing too much current and burn out either the resistor (or the Arduino’s port).”

Where am i meant to put resistors and what value? or do you mean I should trace it out to the resister and solder to the resistor rather than one of the points off the chip?

Destined: I have a board I ripped out of a very old phone to practice on :)

That's good - practice on it; learn to desolder parts, solder them back in, and solder wires to points (hint: tin the end of the wire first, then solder the tinned wire to the point on the board - if the wire is stranded, after stripping the insulation, twist the strands up tight, then tin the wire end - it will soak it up fairly easily. Once it is cooled, snip off the very tip if there is any excess or extra strands sticking out).

You might also practice making solder bridges between close pads and cleaning them up - this is just something you need to learn, because you -will- make them, and understanding how to clean up a bridge (or make one!) is important. Bridges are made best when the pads are close together, but if the pads are too far apart, you may need to use a piece of thin wire (solid core works best). Surface tension is the key to all soldering; you heat the solder on the pad up (until it is shiny), and if the pad is close to another, the idea is to heat both together and "shove" them together so they form a joint bridge. Then let them cool (don't leave the heat on too long, or blow on the hot solder to cool it too quick, just let it naturally cool - otherwise you run a risk of a "cold joint", which is weak and may be electrically unsound. If you have to use a piece of wire, tin it first, then heat up the pads (you have to be quick - though sometimes you might just need to do one, then do the other, and let the heat flow thru the wire to keep the other end fluid), and shove the wire around until it fits and the solder flows over it, then let it cool. It will take some practice, but you'll get it.

Your first thing though is to learn to desolder parts and solder wires - because that is what you'll need to do on this PCB. You'll solder the wires first, probe around, then once you have everything situated (and label the wires!), you can desolder the IC; desoldering DIP ICs is tricky, though. You'll quickly run out of hands (if you have a vice or can improvise something, it will help). The best way is to use a combination of a solder sucker and desoldering braid to remove most of the solder off the pads (you won't be able to get it all). Then with a small screwdriver under one end, you carefully pry on the IC (not too much force!) while reheating the pins, and "pop" the pins off. Don't spend too much time on any one pad; if it ain't working, move on to the next, and let it cool down; you don't want to lift the pads if you can help it (but it will happen occasionally). If it really isn't working, the move of last resort is to use wire dikes to cut the pins from the IC body (this renders the IC useless, btw), then desolder the pins one-by-one from the board.

Destined: Here is the new diagram

That looks perfect!

Destined: Also on the solder points are spots B and C acceptable or do I need to be going over the previous solder point like A?

You want to solder on pads away from the main pads holding the IC on - because later you will desolder the IC, and you don't want your wires falling off, right? That means the one underneath "B" is most acceptable, and the one on the other end of "C" would be better. Only solder on to the IC pad if you have no other choice (like for instance, you are using a function that the pad represents that -wasn't- brought out on the board), or if you aren't desoldering the IC. You'll know when you need to do what.

Destined: You said "You want to solder to that resistor anyway to limit current to the transistor's base - whatever you do, don't solder to the base of the transistor, as you may end up drawing too much current and burn out either the resistor (or the Arduino's port)."

Where am i meant to put resistors and what value? or do you mean I should trace it out to the resister and solder to the resistor rather than one of the points off the chip?

Well - first try to locate the resistors; if you follow the traces from the pads for pins 6 & 7 (right/left) and 10 & 11 (backward/forward), you should end up at a resistor pin (if the manufacturer followed the reference diagram in the datasheet - or something like it). If you end up at a transistor pin, then the manufacturer was flying fast and loose, and you should add a resistor; use the values as given on the datasheet, which is 690 ohms (or something close if you don't have this value). Either way, you want to solder your wire to that pin, and not the IC pin (and remember, the further you can get away from the IC and closer to the h-bridge driver circuit, the better).

Also - once you have your wires in place, and you know their function (and you know they are soldered on good), put a dab of hot glue on and around the joint to provide some "strain relief" so they don't pull off as you experiment. Hot glue is non-conductive, so it won't be a problem.

Finally - may I use your photographs and such that you have posted here for use in an article I want to write up on my website? They are fairly clear, and would save me some time and effort. I think all of this that I have written could be useful to others in the future...

Go for it on the photos and if you need any others for your story let me know. I am very appreciative of the help and if that can help you back in some small way I am happy to help!

So now I have the wires in the next step is take the IC out? Why am I taking the IC out? Because the arduino is going to replace it?

Once I have done that what next?

Destined: Go for it on the photos and if you need any others for your story let me know. I am very appreciative of the help and if that can help you back in some small way I am happy to help!

I'll be sure to attribute the photos (and anything else necessary) to you, of course - thank you for your permission!

Destined: So now I have the wires in the next step is take the IC out? Why am I taking the IC out? Because the arduino is going to replace it?

Once I have done that what next?

No, the next step is the probing - but first we need to do some sanity checks - read thru all of the following, so you know what is coming up, then start:

1: Verify your soldering connections - make sure you didn't make any bridges, and that the soldering job looks good; if not - fix it first (if you are worried about your soldering job, post a clear sample picture of your work here first, and I'll let you know what I think). 2: You did label your wires? If not, label them! 3: Make sure all the wires are separated from each other (none touching!) and that none are touching anything else on the board. 4: Take your meter (you do have a meter? if not - GET ONE) - set it to voltage measurement (you want a range of 0-10 volts at least) - if your meter auto-ranges, that's ok. 5: Hook your ground probe to the GND wire (pin 2) - use alligator clips or something secure. 6: Hook your positive probe (make sure it is in the voltage measurement plug on the meter!) to the VDD wire (pin 13), again with alligator clips. 7: Turn on the car carefully - put on a stand so all four wheels are off your work surface, but can still turn freely (and steering still works). 8: What does your voltage read? Make note of the voltage! 9: While on the stand, try using the remote to verify everything is still working OK - and that your "stand" isn't interfering with anything. 10: Turn off the remote. 11: Remove the positive probe of your meter from the VDD wire; hook it up to the RIGHT wire (pin 6). 12: Turn on the remote. While watching the meter, send the signal to turn the wheels right - read the voltage, and note it (also note: sometimes manufacturers reverse the order of the wires - so left is right and right is left - if you don't get a reading, try turning the wheels with the remote the opposite way, and see if you get a reading then). 13: Move the positive probe of your meter to the LEFT wire (pin 7) and repeat your testing and notes. 14: Do the same for BACKWARD (pin 10), FORWARD (pin 11), and TURBO (pin 12 - if your car has this option) wires - note the voltages you read. 15: Hopefully - the voltages you read on each of these tests match the read you got from the VDD wire.

If it doesn't - STOP HERE - and let me know what readings you got. Do not proceed. Proceed only if your readings are within 5-10 percent of VDD (there will always be some internal losses in an IC). If the voltages are the same - it means you can use the VDD wire (pin 13) as a probe wire. When probing, only touch it to the wires I have indicated, and not to any others (or any parts on the PCB).

16: Disconnect all the wires from your meter, and from the alligator clips (or whatever you used). 17: Again, make sure all the wires are separated from each other (none touching!) and that none are touching anything else on the board. 18: A good sanity check is in order - try your remote again, then turn it off if everything looks normal. 19: Now - take the VDD wire (from pin 13) - this is your probe wire. 20: Briefly touch it to the RIGHT wire (from pin 6) - did the front wheels angle right? Did they move at all? If not - do they still move with the remote? Do they return to center when you disconnect it? 21: Briefly touch it to the LEFT wire (from pin 7) - how about that? 22: Briefly touch it to the BACKWARD wire (from pin 10) - do the rear wheels spin in reverse? 23: Briefly touch it to the FORWARD wire (from pin 11) - do the rear wheels spin forward? 24: Briefly touch it to the TURBO wire (from pin 12) - do the rear wheels spin forward faster (note: if your car doesn't have a turbo mode, this may do nothing, or do the same as step 23)?

That should be it - if at steps 20-23 (and possibly 24) you don't get an action, try the remote (remember to switch it off afterward). If at any of the steps, you get the "opposite" action of what the wire is marked, it just means the manufacturer has reversed the pins (they also did the same on the transmitter - so no big deal) - just swap your labels around. If you don't get an action from your probe testing - but still do from the remote - that will be odd, and I am not sure what to tell you. If you don't get any action from the remote or the probe, that will be double odd (I don't make any guarantees on any of this - welcome to the joys of hacking).

Once you have performed the above steps, and know this is working OK - you can then proceed to the next step. But let's take this a bit at a time, ok? In these kinds of hack jobs, it is best to take it slow and easy - no rush - otherwise you make a mistake, and POOF - the magic smoke is let out of something.

Good luck!

:)