Arduino 5 Minute Tutorials: Lesson 7 - Accelerometers, Gyros, IMUs

Hello.
I need to control a 9DOF sensor with a gyroscope, an accelerometer and a magnetometer, in order to eliminate the deviation issues of my autonomous vehicle.
I was wondering if there is any useful advice you have to suggest
Thank you.

@Hend That will come down to data analysis; perhaps set a minimum threshold value below which you can assume the subject stopped moving.

@murtadaabd87 You need a microcontroller to read the values of the sensor, then either send the appropriate pulses directly to the servo motors, or via a servo motor controller. It all comes down to the code on the microcontroller.

@Dim Many flight controllers have all these features. Consider the Quadrino Nano: https://www.robotshop.com/en/lynxmotion-quadrino-nano-drone-uav-flight-controller-with-gps.html

Just brought a adxl326. Some odd reason I can not get any horizontal data on X any y. But only when it tilts. Example. Want to measure the g force and acceleration of a drag car.

@Aaron Each axis has its own pin, and your code needs to read each axis.

I have used accelerometer Adxl345.I have collected the outputs in x,y,and z.but my requirement is to measure the position of that car .what I have to do.and what is the programming code that I must use to get my requirement.

@amir You need to integrate the values to get velocity, then position. Note that there is drift (the sensor cannot provide every subtle change fast enough, and the microcontroller will miss some values), so the position will become less accurate over time. If the application is outdoors, a GPS module is best.

light blue bean app when connected to bean, the accelerator values are continuously changing even i am not changing the position of bean. how to make the values constant??

@yogesh This requires some troubleshooting which we cannot do in the comments section. Please create a new topic on the RobotShop Forum under “Robot Parts -> Sensors” and provide as much information as possible.

can i get a programe for arduino mega of robot controlled by using bluetooth modulue…???

@saikumar Unfortunately creating custom code is beyond the scope of this article. We suggest creating a new topic on the Arduino Forum.

Im going to be making sort of a self balancing robot with arduino uno… What gyro would i use… and do i also need and accelerometer… where would I find code to program… Thanks

@mark bertollo An accelerometer will give you a good idea of if your robot is vertical, whereas a gyro will tell you if it’s rotating / falling. You likely only need low acceleration values for each (2g for the accelerometer for example and 300 deg/s2 for the gyro). We do not have any specific sample code to suggest since it will depend entirely on the parts you choose.

I want to read data from an IMU and display it,could anyone help me how to do it?

@christy There are many ways to do this - have you already selected the parts? You need to know how the IMU communicates (analog, I2C etc), as well as the LCD (digital, serial, I2C etc).

Hi, im trying to create an electronic bike alarm which is opened by my mobile phone via bluetooth. if the lock is cut this will trigger a loudspeaker and activate a gsm which will send a sms to the owners phone. aswell as just activating if the cable is cut, i want it to activate using an accelerometer if the lock is shaken in a attempted bike theft. is this all possible via one arduino board and one massive code? ive got the lock working with my mobile so far via bluetooth. any help would be much appreciated.

@scott Certainly! We hope you post your project on Let’s Make Robots.

how to calculate speed using gyro?

I’m trying to use one of the ADXLXXX (16g and 200g ) accelerometers with an Arduino. Is it necessary to place LPFs on the X,Y, and Z outputs?