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

Typo: 1 rotation per minute does not equal to 360deg/s as implied within the parenthesis.

@Maruf: Thank you for the correction. We have updated the article accordingly! :slight_smile:

Hello, I’m trying to use a gyro/ accelerometer sensor and my software so far is on vba, so my question is. Would it be possible to feed the data into excel or run the sensor on vba?

@Hamid Yes, but that’s entirely on the software side; your interface board / adapter which acts as intermediate between the sensors and your computer is outputting the sensor data in a specific format. You then need to create a custom code (in whichever programming language you are familiar with) to read these values, and output them in a format which can be imported into EXCEL (for example comma separated data). If you’re using Arduino, you can use he serial monitor and then copy/paste (or special import) the data.

Hey Cole. I am working on a project that involves three points on the same plane, and how they change as the plane is moving/rotating. I am assuming that I would connect a 6dof IMU on each point and feed it back to the arduino in real time. That way I can measure how much each point has moved since its initial position, and where the plane is now. Does this sound correct to you? Secondly, do you have an IMU or Arduino that you would suggest for my use? Thanks!

I am using LSM9DS1 connecting with unity. I need to calculate velocity and distance from accelerometer from arduino. My problem is that I don’t know what should I put for delta Time in the formula such as velocity = ac. * delta_T

@Marko Are the points on the plane fixed? If so, then you really only need one IMU. If they can each move, then yes, you need one for each point. Note that IMUs are not good for absolute positioning. To get a better idea of what you want to do, can you create a new topic on the RobotShop forum and provide a few drawings of what you want to do? It’s not easy with text only here as comments.

@matin Ideally you would use the Arduino’s timer to get the time. The faster the better.

Hi Mr. Benson. Thanks for your previous answer. If I have a 2 axis gyro, is it safe to assume that, if programmed correctly the quad will stabilize along x and y axis when the pitch/Roll joystick is released? Thank you very much for your time. Best Regards

@Agustín Ramón Ruckstuhl No; you need an accelerometer to stabilize with respect to ground. A gyro only tells you rate of rotation, but that is only relative. An accelerometer gives you absolute angle with respect to ground, though even that cannot account for wind.

How can we obtain linear acceleration (due to motion alone) from accelerometer? Because accelerometer gives acceleration of motion + gravity, right?

@mei The sensor will always provide the force of gravity, but you can (fairly) easily remove this using equations and simply obtain the raw three axis linear acceleration values.

I am using ADXL335.
My query is, how to make a ROBOT turn using the values obtained by accelerometer’s ouputget the values. Is there any matematical equation available?
I also dont know what exactly the output values of accelerometer indicates.

@Rameel Khan The output is analog, so you need a microcontroller which accepts 0-5V analog via ADC pins. The microcontroller would then be programmed to convert the analog values to acceleration values. It would then be up to you what to do with these values and how you want your robot to “react”.

im trying to make a glove that can identify finger movements of deef mute people and convert them into words .the convertion can be done by myself i want to know how to get accelometer reading correctly.can you help?

@Popi_chan We recently saw a project about this. You need to interface the sensors with a microcontroller and create the appropriate code.

I am using GY-521 MPU 6050. I have created a c++program for my Robot using qt, Now I have added a condition for Gyro, but I would like to add more condition for Accelerometer, magneto meter. If possible to add Accelero, magneto condition with gyro or else need to create separate header and source file for that ?

@Jerwin Prabu You can use only one “header” depending on the complexity of the code, if you use libraries etc.

@ Benson. I have decided to use only gyro for my robot motion, but If possible to make my Robot straight movement using gyro ? I have used encoder condition for straight motion that is working, but I want to make my robot exact straight what can I do for that ?

@Jerwin Prabu No; a gyro only measures the rate of angular acceleration. You need a magnetic compass.