Let's Make Robots!

accelerometer and microcontroller, which ones do I use?

Hello there everyone I was wondering if anyone could give me information regarding a project I have. I have a design where an accelerometer would be used to detect headmovement or tilt of the head where the information would be processed by a microcontroller and transmitted to a remote control car. (head movement forward would = acceleration , tilt to the right would turm the wheels to make the car go right etc)

 My design also involves a microcontroller at the recieving end i.e. mounted on the car to provide control for the motors to control steering and speed.

I was wondering if anyone could tell me which microcontrollers could be used for this project and what would be the best way to transmit the signal.

Also how complicated would it be to make the car to go at a speed relative to the tilt of their head if it would make things easier to have a single speed whether in forward or reverse I would be pleased wnough with that. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Any of the common microcontrollers, really.  It's what you hook them up to and how you program them that matters.  Do you have any experience working with electronics or microcontrollers?
Thanks a lot for your reply Mr Clean I've got some experience with old electronics components I've managed a dc to ac inverter but my electronics experience is pretty primitive. What is it that microcontrollers would be hooked up to, I know that will sound stupid to you but I only have the concept but dont know how I'm going to go about it. Do you know how the signal from the microcontroller which interprets the accelerometer data would send a signal to the microcontroller mounted on the car and how would it recieve the signal via a reciever or something and if so what type would be suitable? I know that is a lot of info to ask sorry but I havn't a scooby doo just now.
What programming experience do you have? I'd recommend finding a chip you can program in a language you're comfortable with.
well I'm not concerned with that really at the moment but C++ is my only programming laungage but I am mainly just concerned with the main structure of the project just now, I'm just fitting it together so as I know which components could be used for it. I've been trying to find out if a standard remote control transmitter and reciever would be compatible for this type of application. I take it the microcontroller would be programmed to control the transmitter on the headset and the microcontroller on the car would be programmed to control the reciever, I'm just having guesses here because but I've a feeling it's going to be slightly more complicated than that, can anyone tell me a set up which would work in theory or anything I mean just a kind of block diagram explanation or something.

Sparkfun has a lot of good toys that would work towards your project. Starting out :

an ADXL322 based braekout module :  http://www.sparkfun.com/commerce/product_info.php?products_id=849 which outputs a variable voltage according to the acceleration being detected, great top be read for ADCs. The 2 g ADXL322 was suggested for greater sensitivity compared with the 5 g ADXL320 or the 18 g ADXL321 .

The Arduino USB board: http://www.sparkfun.com/commerce/product_info.php?products_id=666 might be a good micro to use.  Not sure about the Processing language it uses, but seems popular and uses an AVR micro. It has 6 ADC pins to read several accelerometers or other analog sensors if need be.

PICAxe is fairly popular here, has some A to D,  programmed in a form of Basic  http://www.sparkfun.com/commerce/categories.php?c=125 

I might try an LPC2148 ARM board,  : http://www.sparkfun.com/commerce/product_info.php?products_id=676

For communications, there are a lot of options depending on hopw far and how fast  to send/get data : http://www.sparkfun.com/commerce/categories.php?c=16

Simple format :

1. accel sensor to "head" micro, transmits current sensor info over chosen wireless link. 

2. receiver gets data to transfer to micro on vehicle, micro takes data and generates "drive" signals, that command the wheel motors as previous electronics did, or through added h-bridge. 



Hello robologist I cant thank you enough for giving me this help thanks I think I now have a great place to start with this, its looking good.

Forgive my stupidity but what is the function of the The Arduino USB board is it to replace a microcontroller or to program it. I've sorted the car out for components using the links, these are the components I have picked so far I'm now just unsure of the validity of what could be used with the adxl322 accelerometer as in which microcontroller. This will sound silly to everyone but how would the microprocessor for the reciever send data to the UHF RF reciever ?


L293D   motor driver IC         $3.50

PICAXE-18   microcontroller ( COULDNT FIND DECIDED TO GO FOR PIC16F627)

PIC16F627   microcontroller mounted on car to control the motors on vehicle  UNDETERMINED

rfRXD0420   UHF RF Receiver microcontroller        $2.30

rfPIC12F675F  rfPIC Microcontroller with UHF RF Transmitter Product Family    $1.83

ADXL322 ACCELEROMETER         <$23.96




The Arduino was suggested as an alternate micro to use as there was mention of C programming, but it appears you have chosen PICs. PICAxe devices (based on PICs) can be found at http://www.rev-ed.co.uk/picaxe/ as well as at the Sparkfun site and others. Essentially any micro that can read a 5 volt analog voltage can read the ADXL322 accelerometer.

The $23.95 price though is for buying 100 of them, they are $29.95 for a single ADXL322 module.

The receiver and transmitter devices will require a number of external components too, but there appears to be good application notes on building these devices. What might be most difficult is soldering the LQFP package the device comes in. Data appears to be sent through a serial connection to the rf device.  Application note AN860 gives a reference design for a receiver on page 7, and there is probably a similar design for the transmitter somewhere. If you don't feel comfortable with putting these together, it might be better to go with more prepackaged rf solutions, to eliminate a few points of failure.

Are you retro fitting this to an existing radio control car? If so, use the existing radio control gear.

The transmitter sticks are connected to a couple of potentiometers. These could easily be replaced with digital pots. The position of the "wipers" on these pots would be set by your microcontroller.

At the other end, the receiver might be hooked to the servos inteh car as normal. Failing that, if you want, you could put another microcontroller which sucks inteh receiver signals, does a bit of processing ad fires them out again to the servos. Not sure why you'd want this extra step, though.

For info, I have a personal interest, here. I do a bit of work with disabled folk and one of my clients at the moment uses a head-mounted stick to poke at the keyboard. I'm tentatively researching methods by which he could control the computer with head movements.


I have to agree with BOA, using the transmitter and reciever that came with the car is what I would look into. 

I was looking into doing something similar to what youre doing with your car, only I was planning to to this in an rc plane(yeah I know, insane).

The setup I was going to use was have 2 accelerometers, one in the craft, and one in the control system. 

The control setup was going to use two gloves, one controling the the z axis rotation(left/right banking), and the other controling the x axis rotation(nose up/down). The second glove was going to be used to detect presssure to control the throttle (tight fist, more throttle, loose, less).  The idea of the zx control on the glove came from how the old figher pilots used to describe combat techniqes. Usually demonstrating with the hand gestures. This is the similar thought that I had when working on the idea but without doing all of the movements, just need to do pitch and rotation.

As I was mentioned before about boa's idea The thought was to use the tx.rx from the plane(am 72mhz band or 49mhz possible pwm depending on the radio gear), converting the accelerometer data to servo movement. The second proc would receive the data convert it back to what the accel should read, and control the planes movement based on what the acceleromter should be reading (I was still a bit fuzzy on if this was possible at the time). This way it could maintain a steady angle and correct itself if it was going out of balance. This was the theory of course. Sadly the plane I was going to use met it's ill fate on a baseball diamond when the fusalage broke(into many peices) during a (spectacularly)botched landing. I still have th radio gear, a new pair of gloves, and accerlers(memsic 2 axis), just haven't replaced the plane.