Got a RC car project I have a few questions about

So for this electrical engineering class we need to do computer interfacing. My plan is to make an RC car controlled by an Arduino (i know its been done a million times) but, specifically, here’s what I wanna do:

  • I have a “competition style” kit RC car called the Frog, which has a electric motor, a speed control, radio input, and servo for steering. The speed control is controlled by a servo as well.

My part of the project is to do the wireless interfacing and I was thinking of using the Xbee type wireless. Using the RC car controller (the box with the transmitter and the joysticks), I want to yank out the radio and convert the signals that the joysticks makes to go to an arduino, then to an Xbee. The Xbee will transmit to the Xbee on the arduino inside the car that is controlling the servos/motor.

My question is: Is there any interfacing required to set the signals from the joysticks up to be used by the arduino on the controller side? Like converting the analog signals to digital or vice verse?

Also, how difficult is the Xbee wireless interface?

On the car side, the Ard will use PWM to control the servo for steering and PWM for driving the motor. Am I right in assuming this?

Basically, my design is similar to the design where people figured out how to use the iphone connected to the computer over USB to send signals over Xbee to the car, but I will be eliminating the computer and iphone and gutting the stock controller and popping in an Ard+Xbee. I basically need to do hardware interfacing for the class, as my prof rejected the idea of interfacing a PS3 controller since it just entailed off the shelf parts. Would I have to modify the stock controller enough for it to be considered “computer interfacing?”

Another idea I was thinking of was adding a speed/distance display on the controller if the above isnt sufficient. I would sent a byte to the RC and it would send one back. Depending on the time it takes for it to travel, I can get a distance or speed.

Thanks guys!

I would go to the arduino website and look up the servo library.

I would go to the Xbee website and look up the details on the built in ADC’s.

I would go to google and look up “arduino driven RC car” as you said this project has been done a million times one or two of those folks probably have pretty nice DIY guides.

Make sure you cite your sources.

makasin:
So for this electrical engineering class we need to do computer interfacing. My plan is to make an RC car controlled by an Arduino (i know its been done a million times) but, specifically, here’s what I wanna do:

  • I have a “competition style” kit RC car called the Frog, which has a electric motor, a speed control, radio input, and servo for steering. The speed control is controlled by a servo as well.

Although it is certainly possible to have the speed controlled by a servo (See, for example, the Dreadmill.), that is not the customary practice in RC cars. Usually, RC cars have an electronic speed controller (ESC) which converts a signal that is of the same protocol as the signal for servos to a voltage output to the motor. If you have an ESC and your professor permits, you can send it that signal from the Arduino.

makasin:
My part of the project is to do the wireless interfacing and I was thinking of using the Xbee type wireless. Using the RC car controller (the box with the transmitter and the joysticks), I want to yank out the radio and convert the signals that the joysticks makes to go to an arduino, then to an Xbee. The Xbee will transmit to the Xbee on the arduino inside the car that is controlling the servos/motor.

IIRC, there are XBee units that have analog inputs, so you may not need to use the Arduino to process the joystick input. It may be possible to use the XBee, alone, in the controller, have it transmit the joystick positions to the car, then have the on-board Arduino compute and generate the servo signals.

makasin:
My question is: Is there any interfacing required to set the signals from the joysticks up to be used by the arduino on the controller side? Like converting the analog signals to digital or vice verse?

The Arduinos, AFAIK, all have analog to digital converters (ADCs) built into them. (Different Arduinos have different numbers of ADCs, but I doubt there’s any with fewer than two.)

makasin:
On the car side, the Ard will use PWM to control the servo for steering and PWM for driving the motor. Am I right in assuming this?

Keep in mind that, although the convention for servo control in RC cars is a PWM signal, it is not the PWM signal the Arduino’s PWM function produces. There is, however, a library function that will produce such signals for you.

makasin:
Basically, my design is similar to the design where people figured out how to use the iphone connected to the computer over USB to send signals over Xbee to the car, but I will be eliminating the computer and iphone and gutting the stock controller and popping in an Ard+Xbee. I basically need to do hardware interfacing for the class, as my prof rejected the idea of interfacing a PS3 controller since it just entailed off the shelf parts. Would I have to modify the stock controller enough for it to be considered “computer interfacing?”

By definition, yes. However, “enough” is, in your case, whatever you professor says it is.

makasin:
Another idea I was thinking of was adding a speed/distance display on the controller if the above isnt sufficient. I would sent a byte to the RC and it would send one back. Depending on the time it takes for it to travel, I can get a distance or speed.

As [Grace Hopper would have told you, that’s not a practical approach for the sorts of distances you have in mind. OTOH, if you’re looking to do range and speed (either by doppler shift or by sequential time-of-flight measurements), ultrasound is worth a look. You could also measure speed the way a “real” car does, measuring the rotational speed of the wheels.

Have Fun,

Eric ](http://gracehopper.org/2011/about/about-grace-hopper/)

So I decided im going to use a 3-axis accelerometer to measure the speed, since measuring rotation of the wheels is not really predictable (losing traction, calibration) plus I dont really wanna do anything mechanical as its an electrical class. So I will use Runga-Kutta integration technique to do this. Basically just integrate the acceleration measurement. Since the ideal sampling frequency for my accelerometer is 200Hz, would putting an RC low pass filter of maybe 250Hz be wise before entering the ADC of the Arduino? Im trying to get rid of the noise of the accelerometer and of the servos/motors (which im guessing is high frequency).

EDIT: Has anybody used the 4x7segment display LCD (sku:COM-09481) from this site with an Arduino? What kind of circuitry would I use to interface the serial digital outputs to the 16-pin display?

Also, what types of serial digital outputs does the Arduino use? Is it RS232, I2C, or?

EDIT2: So I just received my parts.

I got:

-1x Arduino Pro Mini 5V (on the car)

-1xArduino Pro Mini 3.3V (is 3V3=3.3V?) for the remote control

-2x Xbee 1mW Wire Antenna

-1x 3 axis accelerometer MMA7361

-1x 4 digit 7-segment display- Blue

So Im assuming to get the two arduinos to talk over the Xbee I just connect the Ards to the Xbee with Vcc, GND, DIN-> TX , DOUT-> RX. I dont need to connect all the 20 pins of the Xbee right? Obviously for the 5V Arduino I will step the voltage down to 3.3V for the Xbee using probably a LM317 voltage reg.

My official part of the project is taking in analog inputs from 2 potentiometers (for controlling the car), and connecting the accelerometer on the car’s Ard. “My” Arduino will send 2 serial commands (throttle, turning) to the car’s arduino. It will receive data from the accelerometer to be processed and sent to the 7-segment display. How tricky is getting the two arduino’s to talk to one another?

I only have 1 USB-to-FTDI board for the 5V Arduino, Im thinking of using voltage dividers (5V----10k-.-15k—|>> ) the period would be the output to the 3.3V arduino.

Thanks for reading, sorry for the lengthy post. Just getting my feet wet finally and it’s crunch time. Need to finish this in 4 weeks. EEEK

if you have an original frog, you may want to look at its value to collectors if it is in good shape before you start hacking it up. being that you talk about the servo activated speed control makes me think this is an original (1983) and not the re-release.

it is an original frog. got it on craigslist for 80 bucks. Dont know really what its worth but its already been hacked up :(.

Does anyone know how I can get a steady power output of 3.3VDC out of a 3.7V lipo battery. I have one lying around and was thinking of using it for my remote controller. Its a 17670 ultrafire battery btw. 1800mAh so plenty of current capability. Due to it’s nature though, the voltage fluctuates anywhere from 4.2 when its freshly charged down to 3.2 when it’s dying. Does the arduino have some kind of power regulation and is it strong enough to run an Xbee, 2 potentiometers (reading the voltage value to determine throttle and turning), and a 4x7segment LCD panel. Can I just use the arduino pro mini’s Vcc supply for everything? I tried making a power supply using the LM317 linear regulator but the voltage drop from the reg is more substantial than the max voltage I can output with it. AKA the highest voltage I get out of it regardless of resistor value is around 3.1V with a battery outputting 3.9V at the moment.

So I decided im going to use a 3-axis accelerometer to measure the speed, since measuring rotation of the wheels is not really predictable (losing traction, calibration) plus I dont really wanna do anything mechanical as its an electrical class. So I will use Runga-Kutta integration technique to do this. Basically just integrate the acceleration measurement. Since the ideal sampling frequency for my accelerometer is 200Hz, would putting an RC low pass filter of maybe 250Hz be wise before entering the ADC of the Arduino? Im trying to get rid of the noise of the accelerometer and of the servos/motors (which im guessing is high frequency).

Unless you want to spend large $K using the kind of accelerometers that NASA uses, within a few minutes (possibly seconds) your error will accumulate into the tens of feet or more. You will need more ADC bits than the Arduino has. You will have to also do some fancy math to handle the car’s X, Y, Z axis are not orthogonal to the Earth’s if you are on any sort of hill at all.

Far better to put a little counter on the input to the differential and count shaft rotations. Unless you are “drifting” your slip will be far, far less than the integrated position error you will get using the method you hope to use.

what do u mean by the differential? Like the actual mechanical diff in the car? How do I do that? It’s not electrical. How would I be able to count rotations? Is there a way of sensing if the current is being pulled? I imagine there would be a spike or a dip in the voltage of the battery whenever it is being loaded by the motor, right? Could I sense this? The reading doesnt have to be accurate, it just has to “work” as in it needs to display SOMETHING to the LCD.

makasin:
what do u mean by the differential? Like the actual mechanical diff in the car? How do I do that? It’s not electrical. How would I be able to count rotations? Is there a way of sensing if the current is being pulled? I imagine there would be a spike or a dip in the voltage of the battery whenever it is being loaded by the motor, right? Could I sense this? The reading doesnt have to be accurate, it just has to “work” as in it needs to display SOMETHING to the LCD.

I think he means basically any part that rotates with the wheels. Sense it’s rotation and calculate rotation rate and you’ve got estimates for distance travelled and speed. There are lot’s way you could measure rotation but you might want to look at [one of these. Put a reflective patch on the rotating part and you should (with a little work) be able to get pulses to feed into your Arduino. I believe the comments have a link where someone did just that. Also read the [bildr tutorial. You’ll have to calibrate how many pulses correspond to how much distance but that shouldn’t be too hard.](http://bildr.org/2011/03/various-proximity-sensors-arduino/)](Optical Detector / Phototransistor - QRD1114 - SEN-00246 - SparkFun Electronics)

I think he means basically any part that

I’m actually a she but that is hard to tell from the nick. I promise there is no ambiguity whatsoever upon even cursory visual inspection.

Yes, that is pretty much what I am talking about.