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

Hi,
I want to use this sensor i.e. MPU6050 to determine the basic strokes of characters like vertical, horizontal left curve, right curve, back slash and forward slash. This is been recognise for the purpose of human character recognition. Can you guide whether this concept is useful for my purpose or how shall i proceed to serve my purpose. Thanks in advance for your response.

@■■■■■■■ Kotak To confirm, you want to mount the sensor on a pen / pencil to track motion to determine what the character is? This might be possible, but would take a LOT of programming to filter out unwanted positives.

hello, can you help me the with code for finding the displacement using accelerometer adxl335 with arduino uno board.?

@Balaji V There is actually quite a bit of sample code online - search for “ADXL335 Arduino” in Google.

how do i compute pure acceleration form accelerometer & rate gyro can you give me the code

@piyush jain It depends on the type of accel / gyro and the input. Normally the output is described in the chip’s datasheet, as well as how to convert to acceleration.

what is the unit of the data that displays in serial monitor, like 335 286…?
when coding is done for linear aceleration

@Balaji V It depends on the accelerometer you choose; some are analog, others are I2C etc.

plz send me the code\
and libraries

@bdullah We do not have additional code / libraries as part of this article. You can visit www.arduino.cc for more details.

How do you connect an arduino to an accelerometer?

@IG That depends on the communication of the accelerometer you choose - it might be analog (connects to analog pins), I2C (connects to I2C pins) or serial.

i am getting the following results when my sensor is at rest:
AcX = 436 | AcY = -64 | AcZ = 14928 | Tmp = 27.92 | GyX = -555 | GyY = 306 | GyZ = -53
And when i am rotating my sensor, GyX, GyY or GyZ change for a few secs then they are back to normal. Is it suppose to happen? and what is the unit of the following values?
Further can I compute the displacement from these values?

@bhavuk An accelerometer measures linear acceleration, including the force of gravity. The gyro component measures angular acceleration. You need to read through the sensor’s datasheet to know what the proper range of values should be.

Hello, I am trying to use an accelerometer to light up some lights. after I get to a certain speed I would like to have the lights light up and then when I go under that speed I would like the lights to shut off. Would that be possible to do with an accelerometer and an arduino?

@Conner Sort of - an accelerometer measures linear acceleration, so you would need to integrate in order to get velocity. There will be drift, so you will ideally need some other sensors to help zero it.

Hello , I’m trying to use an gyroscope to detect the rotation direction (clockwise or counterclockwise or the device is stay still). Is this possible ? Thank you.

@Khoa Tran Yes and no - it will tell you the direction of angular acceleration. However, accelerating on in direction might not mean it is rotating in that direction (but simply might be decelerating). A quadrature encoder should work well.

Please, can someone help me: i have a gyroscope and i want to get the angle from it? how can i do it’s very urgent, please help me

@Jihene As explained in the tutorial, a gyroscope provides the rate of change of the angular position over time which gives you the angular velocity. However, you can obtain the angular position by integrating the angular velocity. This tutorial will provide you further explanation about this and an Arduino sample code.