Connecting an accelerometer to a Pi
When my son is not using my Pi for watching toons I plan to use it to control a model submarine droid. Appart from controlling servos via GPIO pins (to my understanding there's a kernel module [servoblaster] that does that to minimize servo jutter and stop them from overheating dew to task switching timing inaccuracies afflicting userspace) ... but I wanted to give my SUB an accelerometer so that it could correct unwanted accelerations.
This might be a good accelerometer for the job: https://www.modmypi.com/adafruit-tri...-accelerometer but there's no tutorial for connecting it to Pi and reading data from it. Any help is appreciated. |
Hi there,
Quote:
Quote:
Quote:
That probably means hours, if not days of investigation and testing. But I'm afraid someone has to do it. If nobody else did it for this chip on the Pi yet, you might have to be that pioneer. ;-) [X] Doc CPU |
Quote:
In a nutshell static measures gravity and dynamic measures shock and motion. http://www.analog.com/static/importe...ts/ADXL345.pdf |
Quote:
I also said "unwanted acceleration": g is constant and practical so I can deal with that as acceleration is a vector and vectors sum (yes it's simple physics). I found some other interesting sensors with accelerometer, compass and rotation sensor: I might use one of those |
School project?
Yes, look into using Inertial Measurement Units (IMUs) using a fibre optic gyro. They are small and used in drones etc. I think you will find that using acceleration as a sole means for determining position very crude. Also IMUs have a drift factor, if you do not use some external input for speed and depth make sure to take it into account. |
Quote:
Yeah ... I was guessing that the deceleration caused by drag (and fluid current) would be unmeasurable so I'd haveto account for that somehow, maybe have a small propeller up front attached to an undriven DC motor and measure the tension produced. If I remember correctly the voltage produced is close to linear with angular velocity of the prop, and that should be linear with the speed too. Water is really dense compared to air so I cal assume any lateral drift is dew to fluid movement, or at worse, the sub changing immersion depth ... so I guess doing full auto might need a means of measuring depth too. How about an accelerometer placed on a tilting surface that is moved by pressure differential between outside and inside ? Really coarse if fine for a first attempt at a drone ... if I like it I'll look into better accuracy but GPS will not work under water so I'll haveto figure out something else. Update on the sensors: A friend of mine has a 10DOF left over from is multi-rotor drone chopper ... he's gonna give it to me for some reasonable price so I think I'll go for that. |
Now that I have the IMU I did a littple reserch and play with it. If anyone is intrested I wrote a small article on how I went about reading some information out of my IMU on
docs.slackware.com |
All times are GMT -5. The time now is 11:13 PM. |