RC Car with proximity sensor

Hi guys! I'm a college student who is doing a project on making a car that can slows down automatically when it senses an obstacle in front. Basically I will fit a proximity sensor at the front of a small/mid sized RC car. The power of the RC car will be cut off to simulate braking in real life when the sensor detects an object in certain distance.

Since I'm new to Arduino, is it possible for me to do this project using Arduino?

Suggestions are welcome :slight_smile:

yes, it is realy easy. take a look at some tutorial using a sonar sensor (PING).

Have a look at http://www.instructables.com/id/Getting-started-with-the-Maxbotix-sonar-sensor-q/

even if I connect the arduino to the circuit board found in an electric-driven RC car?

I think you'll find it easier to use an RC car with an RC system made up of discrete receiver, servos and speed control rather than the all-in-one thing that cheap toys tend to use.

You can either feed the PWM signal for the speed controller through the Arduino (have it measure the pulse width and then generate its own output) so that you have full control over the speed, or just put a relay in the line to the motor so that the Arduino can cut it off when it wants to. Full control seems more elegant but would need more code. Nothing especially difficult either way.

Hi,

that car has a simple chip that provides on off control of the motor only. You could build your project as simply as connecting an op amp acting as a comparator on the sensor output. Basically you could use the comparator to keep the car running as long as the sensor reads above or below a threshold value.

If you want to go the route of a full blown proportional rc car, check out my blog for some ideas of how this can be interfaced with arduino.

rcarduino.blogspot.com

Duane B

Hi DuaneB,

pardon me for my lack of knowledge in electronic area, but what you meant was the comparator can cut off the power supply if the sensor's reading is below a threshold value (a critical distance where the car has to decelerate when its distance from the obstacle is lesser than the threshold) ?

Hi,

Yes, thats basically the idea.

Here is a link I found that is close to my understanding of what you are looking for -

http://www.technologystudent.com/elec1/opamp3.htm

Duane B

rcarduino.blogspot.com

simon_h:
even if I connect the arduino to the circuit board found in an electric-driven RC car?

That chip in the lower-left corner of the receiver board is the RX2 half of the TX2/RX2 chipset pair; a very commonly used and documented chipset for low cost (non-hobby grade) R/C toy cars.

You can do your project fairly easily with this chip; really you only have to take a few voltage measurements, and refer to the documentation of the chipset, to interface with it (well, actually, you don't interface -with- it, you actually bypass it - in fact, the chip can be completely removed, and actually should be, from the circuit). See the following lengthy thread on how to do this:

http://arduino.cc/forum/index.php/topic,86883.0.html

As DuaneB has noted, though, you can go the route of using a fully proportionally controlled R/C car (hobby-grade); this route has advantages to the "hack a cheap R/C car method"; namely, interfacing is much simpler (you just need to interface using the Servo library). The disadvantage to the method, though, is the fact that such a car tends to be much more expensive (and complex, mechanically - depending on if you have to completely assemble it from a kit) than a cheap R/C car. The cost difference is even greater, of course, if you already have the cheap R/C car (which you apparently do) or if you purchase one from a resale/thrift store (where many of these kinds of cars can be found for very little money).

So, this route you would gain ease of interfacing (Servo library) and proportional control of steering, in exchange for a higher up-front cost. While with the former method, you have to do more work on the interfacing end (write your own control routines, and do some soldering, etc), and no proportional steering (because most of those cars only have left/right/center control of steering), in exchange for a lower up-front cost.

Since your project doesn't -seem- to need Arduino control of proportional steering, and you can effect proportional control (ie, speed) of the h-bridge you would interface to on the cheap R/C car via PWM control, then the only benefit with going with the higher-cost option is ease of interfacing. Also note that if you absolutely had to have proportional steering of the cheap R/C car, you might find it cheaper to do a "hybrid" approach, and simply replace the simple actuator of the cheap car with an R/C servo, while continuing to use the R/C receiver board's on-board h-bridge to control the speed of the drive motor; versus buying an entire hobby-grade R/C car.

Finally - DuaneB: Help me out here in these discussions; you were a part of the TX2/RX2 chipset discussion that I linked (and provided a ton of assistance in) above - in the future on discussions about this kind of interfacing, especially if it is easily apparent that the poster has such a vehicle, provide a link to the discussion. I understand that you have a bias toward hobby-grade R/C cars for Arduino interfacing, but many people don't have the experience or budget to afford such vehicles, depending on the project at hand. Let us both continue to give these people unbiased information about both systems, so they can decide which would be best for their application.

right now I have to decide on which method to use to build my prototype. Preferably the simplest method (coz I have close-to-zero knowledge in electronic stuff) with lowest cost.
anyway, u guys really helped a lot! Thanks! keep the comments/suggestions/opinions coming in!

simon_h:
right now I have to decide on which method to use to build my prototype. Preferably the simplest method (coz I have close-to-zero knowledge in electronic stuff) with lowest cost.
anyway, u guys really helped a lot! Thanks! keep the comments/suggestions/opinions coming in!

The simplest method will be a hobby-grade R/C car; it won't be the most inexpensive, but you might be able to get something together for under $200.00, possibly less.

You'll need, of course, an R/C car kit - DuaneB could probably talk to this better; I would imagine that today, you can probably purchase anything from a "build from the ground up" kit to a "ready-to-run" kit - and anything in between. The difference will be in the amount of work you need to do to put it together (from "lots" to "none") and what kind of accessories/parts come with the kit.

Some kits will just be a bare-basic chassis - all the mechanicals, but no electrical or R/C components, which means you have to purchase the motor, the speed controller (ESC), the steering servo, the battery, a battery eliminator (BEC or SBEC), transmitter/receiver kit, etc. Others will have pretty much everything included, including (perhaps) a rudimentary battery charger.

Prices will also vary based on all of this - think of it kinda like buying a computer; you can buy all the components seperately (and get exactly what you want, spec'd out how you want), you can get a "bare-bones" kit (with a case, power supply, motherboard, and maybe memory/cpu - and add the extra parts, for a semi-customized solution), or you can go out and buy a Dell or a Mac, or some other pre-built machine (which may or may not have the spec you want, and may cost a bit more).

Regardless of which way you go, in order to do things with the Arduino, you are going to probably want use a battery eliminator to power the Arduino (if one isn't already included with your kit to power the receiver). It should provide a 5 volt regulated output so you can bypass the regulator on the Arduino. Some BECs output 6 volts to allow the powering of the servos at their max voltage ratings. If you don't know the voltage output of the BEC, or it is too high (beyond 5 volts), you can either add an extra BEC for 5 volts, or you can use a y-splice adapter to the battery (if it is a 7.2 - 9.6 volt pack) and solder on a barrel connector to plug into the Arduino's barrel jack (and the Arduino's on-board regulator will be used - to use this regulator, the input voltage must be 7 volts or more, but not beyond 12 volts).

Control of the speed control of the R/C car, as well as the steering servo (if needed/desired) can be done using the Servo library.

Hi,

There are basically Three basic approaches as follows -

  1. Pure electronics - a budget rc car with additional electronics similar to the comparator circuit which will use infra red light to detect object in front of the car and cut power to the motor.

  2. Mostly electronics with some microcontroller programming - a budget rc car with the either ultra sonic or Infra red lught to detect objects in front of the car and take some action. The action can be more complex than in 1) for example steer, reverse etc.

  3. Mostly microcontroller programming with some electronics - if you choose a hobby quality rc car, you will need to do lot more programming to interface between the receiver and the motor, you can find all the details on my blog. This approach could allow you to do much more in the future, for example i have traction control and yaw control projects underway in cars that hit 60km/h. As Crosh has mentioned, the car, battery, charger etc will be a lot more expensive.

As we do not know what course you are taking or at what level, it might ge best to discuss the options with your professor to judge which is most appropriate for your class.

lets us know which you choose.

Duane B

rcarduino.blogspot.com

cr0sh:

simon_h:
right now I have to decide on which method to use to build my prototype. Preferably the simplest method (coz I have close-to-zero knowledge in electronic stuff) with lowest cost.
anyway, u guys really helped a lot! Thanks! keep the comments/suggestions/opinions coming in!

The simplest method will be a hobby-grade R/C car; it won't be the most inexpensive, but you might be able to get something together for under $200.00, possibly less.

25$ + expedition from hobbyking (4 and 6 channel).

DuaneB:
Hi,

There are basically Three basic approaches as follows -

  1. Pure electronics - a budget rc car with additional electronics similar to the comparator circuit which will use infra red light to detect object in front of the car and cut power to the motor.

  2. Mostly electronics with some microcontroller programming - a budget rc car with the either ultra sonic or Infra red lught to detect objects in front of the car and take some action. The action can be more complex than in 1) for example steer, reverse etc.

  3. Mostly microcontroller programming with some electronics - if you choose a hobby quality rc car, you will need to do lot more programming to interface between the receiver and the motor, you can find all the details on my blog. This approach could allow you to do much more in the future, for example i have traction control and yaw control projects underway in cars that hit 60km/h. As Crosh has mentioned, the car, battery, charger etc will be a lot more expensive.

As we do not know what course you are taking or at what level, it might ge best to discuss the options with your professor to judge which is most appropriate for your class.

lets us know which you choose.

Duane B

rcarduino.blogspot.com

I'm currently studying Mechanical Engineering, and the method I will use can be the easiest method, as long as I can achieve my objective (which is the prototype will decelerate when it senses an obstacle). Therefore, the first approach would be the ideal approach for me as it consists of the easiest method and low budget. Would like to know more in-depth details regarding this method :slight_smile:

lesto:
25$ + expedition from hobbyking (4 and 6 channel).

Got a link for that? The closest thing I could find (I didn't do an extreme depth search, but I did look at all cars, plus the discount/discontinues/scratch-n-dent areas):

That's just mechanicals for about $30.00 USD; you'd still need to purchase the motor, esc, rx/tx, servo, battery, charger, etc to make it a complete kit. Not only that, but being that it is a "go-kart" it has a very low clearance, so it would limit you to running on fairly smooth surfaces.

If you can find a complete hobby-grade R/C car kit, with everything included (kit, almost-ready-to-run, or ready-to-run), that is large enough to mount a standard Arduino on, for under $100.00 - I would certainly love to see it.

sorry, confused R/C with TX/RX

for full cart this is the (complete, just stole 4 AA batteries from some remote) for < 50$ (~80 with expedition)

lesto:
Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking

Hmm - that's fairly inexpensive, but the specs/pics don't really give any indication as to whether/how you could hook an Arduino in between the receiver and the ESC and steering "servo" (it isn't even clear whether that servo is a regular servo or not). It certainly seems completely proportional, but whether it is standard hobby grade or toy...dunno. Might be useful for hacking, though it's size is a bit on the small side, it seems.

RX system is integrated... so it is a no-go. my bad

you won't find a car that inside it's chassis will fit an arduino. but you can remove it an with a little bit of fantasy use the chassis support as arduino support

this one is ok (also better engine and battery): Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking
spare part ( so you know what you get and how to replace/upgrade)
it is missing TX/RX and lipo, that's about 30$.

80$ all + 30$ expedition = 110$ (using related article but not for charger, you can find it at 5$)

edit:

Length: 250mm
Width: 185mm
Height: 110mm

lesto:
RX system is integrated... so it is a no-go. my bad

you won't find a car that inside it's chassis will fit an arduino. but you can remove it an with a little bit of fantasy use the chassis support as arduino support

this one is ok (also better engine and battery): Radio Control Planes, Drones, Cars, FPV, Quadcopters and more - Hobbyking
spare part ( so you know what you get and how to replace/upgrade)
it is missing TX/RX and lipo, that's about 30$.

That's actually not a bad deal for a robot chassis; once you figure in lipo and charger, if you didn't need the radio, you're under or around $100.00 USD. Certainly not as cheap as an el-cheapo toy RC car that you hack, but not bad for something closer to hobby grade.

I bet if you were willing to spend another bill, you could probably get something that could fit the Arduino (ie - larger scale).

Adding the radio gear would kill it, though.

DuaneB:
Hi,

There are basically Three basic approaches as follows -

  1. Pure electronics - a budget rc car with additional electronics similar to the comparator circuit which will use infra red light to detect object in front of the car and cut power to the motor.

DuaneB, does this method requires an arduino board? Or the sensor links to the comparator, and the comparator has to be fitted in between the wire that connects the battery and the motor?