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.

Any of the common
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
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
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
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.

Bits and pieces

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
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

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 ?

 

CAR
L293D motor driver IC $3.50
http://www.hvwtech.com/products_view.asp?ProductID=341

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

CAR
PIC16F627 microcontroller mounted on car to control the motors on vehicle UNDETERMINED
http://www.microchipdirect.com/productsearch.aspx?Keywords=PIC16F627++

CAR
rfRXD0420 UHF RF Receiver microcontroller $2.30
http://www.microchipdirect.com/Chart.aspx?branchId=403&mid=1&treeid=1

HEADSET
rfPIC12F675F rfPIC Microcontroller with UHF RF Transmitter Product Family $1.83
http://www.microchipdirect.com/Chart.aspx?branchId=401&mid=1&treeid=1

HEADSET
ADXL322 ACCELEROMETER <$23.96
http://www.sparkfun.com/commerce/product_info.php?products_id=849

 

 

 

Choices

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.

That sounds really complex I

That sounds really complex I bet you will have to create a software program to allow on screen keyboard to be controlled via an accelerometer which controls an on screen curser or something like that but I’m a bonehead when it comes to this stuff. Well the intention is too design the car also. Just a question how small could a car be with these components, the smaller the better. I was hoping to design a toy grade remote control car nothing complicated just the basic necessary components and the smaller the better. I’ve been struggling to find very small dc motors which are for use in toy grade cars, I’m assuming that they would be hard to come by as they arent exactly saught after by rc enthusiasts.

By the way thanks again robologist I’ve decided just to use two PICAXE-18 microcontrollers one on headset and one on the car, your info is well appreciated.

About the design being for someone with a disability baseOverApex that is the idea behind the design but there is no point in me saying it will ever be built when I’m only trying to gather together a beginning for a design.

Wireless modules

Sparkfun has devices here : http://www.sparkfun.com/commerce/categories.php?c=16

There is a receiver http://www.sparkfun.com/commerce/product_info.php?products_id=8948

And a transmitter http://www.sparkfun.com/commerce/product_info.php?products_id=8945

that could work fairly cheaply, without much hassle involved. I believe similar modules have been discussed here at LMR too.

hello robologist thanks

hello robologist thanks again can you confirm that I have the correct understanding of the operation.

This is how I imagine it will work

Head movement is sensed by the accelerometer sensing system the ADXL322. Data is sent to “head mounted” microcontroller the PICAXE-18 the processed data is then sent to microcontroller rfPIC12F675F to be transmitted by the RF Link Transmitter to car. The rfRXD0420 receiver microcontroller collects data via the RF Link 2400bps receiver. Data is then processed by PICAXE-18 microcontroller which controls the motors on vehicle via the L293D motor driver IC.

selected components

L293D motor driver IC

http://www.hvwtech.com/products_view.asp?ProductID=341

 

 

CAR - PICAXE 18 Pin Power Project Board

http://www.sparkfun.com/commerce/product_info.php?products_id=8330

 

 

CAR - PICAXE-18 microcontroller

http://194.201.138.187/epages/Store.storefront/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE015

 

 

CAR - RF Link 2400bps Receiver - 315MHz

http://www.sparkfun.com/commerce/product_info.php?products_id=8948

 

CAR - rfRXD0420 UHF RF Receiver microcontroller

http://www.microchipdirect.com/Chart.aspx?branchId=403&mid=1&treeid=1

 

HEADSET - rfPIC12F675F rfPIC Microcontroller with UHF RF Transmitter Product Family

http://www.microchipdirect.com/Chart.aspx?branchId=401&mid=1&treeid=1

 

HEADSET - RF Link Transmitter - 315MHz

http://www.sparkfun.com/commerce/product_info.php?products_id=8945

 

HEADSET - ADXL322 ACCELEROMETER

http://www.sparkfun.com/commerce/product_info.php?products_id=849

 

 

HEADSET - PICAXE 18 Pin Power Project Board

http://www.sparkfun.com/commerce/product_info.php?products_id=8330

 

 

 

HEADSET - PICAXE-18 microcontroller

http://194.201.138.187/epages/Store.storefront/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE015

 

 

Not quite

There is no need for 2 rf receivers or the need for 3 microcontrollers to be in this type of system. I’d suggested the complete rf modules on the Sparkfun site in place of the incomplete chips of the rfRXD0420 and rfPIC12F675F.

So it would be Headset with ADXL322 module -> read by PICAxe 18 -> transmitted by RF Link transmitter 315 -> received by Car with RF Link 2400 bps receiver -> read by another PICAxe 18 -> sends control signals to L293D h-bridge to drive car

thanks robologist

I have to say thanks again robologist I would have been lost without your help I think may’be you could be an angel well you may as well be one if your not, I don’t know what to believe evryone can believe what they like but I don’t pray but I did wish and I got my wish so thanks

On-Screen?

I wouldn’t bother with an on-screen keyboard. You know the accessibility control panel? Since Windows 95, there’s been a SerialKeys devices option in there. Get this: you send ASCII characters in the serial port and they come into the OS as if they’d come from the mouse / keyboard. You can send control characters, mouse commands, etc. The one thing Microsoft have done right in the last 20 years and you know what those muppets did in Vista? They removed this feature. Madness. Absolute madness.

Modification of an existing R/C car would definitely be simpler than making it from scratch.

I have to agree with BOA,

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.

It’s not
The complex bit is the software which translates the accelerometers into fwd/rev, left/right. Once an accelerometer settles, sure it can tell you which way is down, but filtering the action from the reaction is going to be entertaining. Say you move an accelerometer “forward,” you’ll have positive acceleration in that direction. If you stop abruptly, you’ll have negative acceleration in the same direction, possibly quite large, possibly only for a short time. Bear in mind that the direction you moved might be perpendicular to gravity… I can see the complexity mounting.

Might be difficult, but it has been done.
Check out the internals of the Wii-mote. They have an 8051 in there reading a 3 axis accelerometer, and sending the info over Bluetooth, very similar to this project. It’s a fascinating device I’d love to incorperate into a robot sometime, and others have a few times. To find out what is going on, it might be good to have the head device programmed to simply stream data read while someone tilts their head around. Would give some good ideas to begin seeing what could be coded for interpretaing the data. I don’t think the head accelerations will overpower the accelerations due to gravity, unless AC/DC or Linkin Park is playing in the background.