Blog

Remote control car speedometer

Feb 9, 2009
Category:Arduino Electronics 

For my next project, and this is one I have been wanting to do for while, I will be makeing a speedometer for my remote control car.

"What good is that?" I hear you say, "how are you going to read the speed when it's going past you at 30 miles per hour!?"

Well I intend to log the speed to a SD card, so that it can be reviewed on a computer by the means of some pretty graphs and statistics. A display could be added to the car to show the maximum speed achieved or something, but I'm going to concentrate on logging to card to begin with.

My first thought was GPS, this would allow a top-down route to be plotted on a map, and also allow speeds to be calculated. The problem with this is that GPS has a resolution of about 10 metres, which means any stops, starts, curves and turns within 10 metres wouldn't be picked up and speed calculation won't be very accurate.

My second thought was to make a localised GPS using three or more transmitters around the race area to allow a receiver on the car to triangulate its position. This would also allow plotting of the route on a map. Although this doesn't seem impossible it may be quite complicated and seemingly expensive. I will put this on the back burner and will hopefully revisit it soon.

My third thought (okay it was my first, but I skipped it to think about the other two methods) is to simply measure how fast one of the wheels turns round. As the car is a rear wheel drive I decided to use one of the front wheels as this would give a better indication of speed rather than measuring how fast I can burn rubber! I thought a reed switch and magnet would probably do the trick.

Image

So there it is, a magnet mounted to the inside of the wheel, and a reed switch inside that big blob of blue tack. I connected the reed switch to the Arduino development board and also plugged in my SD card reader/writer that I made earlier. I was originally going to get the Arduino to do all the calculations and work out the speed to log to the memory card, but then I decided I would just log the milliseconds to the card each time the reed switch was activated.

My first test was just spinning the wheel by hand to see if it was all working, and this is the data I got back (after a bit of processing)

Image

Beautiful :D

Probably not very well calibrated yet, I did measure the diameter of the wheel and do my best to get the calculations accurate, and this should be good enough for testing. Once I have a finished product I will calibrate more accurately.

Right then, time to get the show on the road, literally. I managed to get the Arduino, SD card writer, and prototyping board with an indicaor LED and start stop button on to the car, as well as a 9v battery, which I soon removed as I wired the Arduino straight to the car's battery.

Image

I drove around slowly in circles to begin with, everything seemed okay and nothing fell off so I thought I would knock it up a notch, I did flat out straight up the road, paused briefly and turned round, then did flat out straight back down the road. Then I went and did a few laps around a little triangle of trees at the end of the road. Here are the results...

Image

All looks promising at first glance, but wait a minute, we never seem to get above 25 MPH, in fact those two peaks in the graph between 55 and 85 seconds where I went flat out up and down the road should be up somewhere between 30 and 40 MPH. On closer inspection it looks like above 25 MPH the reed switch fails to register every revolution of the wheel. I thought to begin with that at higher speeds the magnet might go past the reed switch too fast to activate it, but if this was the case you wouldn't see any readings at all when I was above 25 MPH. It actually looks like the magnet has been passed to recently to be able to trigger the switch again, rather than is going past too fast to trigger it at all.

Perhaps some residual charge/field in the switch hasn't depleted and is stopping it activating every other revolution at high speeds. Perhaps a lower or higher pull up resistor would help, or maybe pulling down would be better. I am just clutching at straws here, can you tell?

What I have discovered now is something called a hall effect sensor, which measures magnetic field and will give an analogue output rather than a simple on or off that the reed switch does. Also there is no moving parts and I think it is much more sensitive and probably reacts a lot quicker. Unfortunately I can't source these from my local electronic shop and I'm having to place an order for them along with some other bits and bobs so it might take me a little while to get my order together.

I think this was quite a successful prototype and have great expectations for the hall effect sensors. I will be sure to post how that goes when I get them.... And here it is!


Comments