Questions tagged [accelerometer]

A component which measures G-force to detect which direction it is moved or tilted in.

Filter by
Sorted by
Tagged with
7
votes
5answers
38k views

Can I measure velocity from an accelerometer? How accurately?

I've bought this module Kootek GY-521 MPU-6050 MPU6050 Module 3 Axis analog gyro sensors+ 3 Axis Accelerometer Module My project will involve affixing this to a moving object, moving at velocities ...
6
votes
2answers
8k views

What does this notation stands for? Wire.read() <<8 | Wire.read()

I'm using the Arduino's site test code for getting raw values from a MPU-6050 accelerometer + gyro. In the loop, there are this lines for getting the next data from its registers: Wire.requestFrom(...
5
votes
2answers
16k views

What is the difference between Accelerometer, Gyro, and Magnetometer Sensor?

I'm starting in the arduino world and I'm building an autonomous smart vehicle. So, after some weeks building and adjusting the vehicle, I got to a point in this project that I want to log it's ...
5
votes
1answer
2k views

A proper way to get the roll, pitch and yaw values

TL, DR : What is the method(in terms of sensors and algorithm) to get the roll, pitch angles of an aircraft at any instant. I am planning to build a hobby aircraft. I am so confused about which kind ...
5
votes
3answers
779 views

Ooops, no LSM303 detected … Check your wiring!

History I have an Adafruit 10DOF IMU Breakout which has been working on my Mega for some time. This morning my program did not run so I starting troubleshooting. Scenario I eventually plugged the IMU ...
5
votes
1answer
255 views

Do gyroscopes purposefully show erroneous data?

I tested an MPU-6050 (GY-521) using an Arduino Nano. I used the I2CDevLib and opened the MPU6050_DMP6.ino with the Arduino IDE. I opened the MPUTeapot.pde Processing-file with Processing. A few ...
4
votes
1answer
771 views

Arduino 101 accelerometer drift or calculation error?

I want to calculate the displacement of the Arduino 101 board compared to the starting point (only in the x direction so far). In below data I'm swinging the board multiple times in circles around ...
4
votes
1answer
240 views

Methods to prevent Accelerometer values changing from current spikes

I've connected an Arduino Uno to a MAX7219 IC, which is connected to only one standard 8x8 LED matrix, and an ADXL355 3-axis accelerometer. I use the matrix initially, and turn on all LEDs, while ...
3
votes
3answers
1k views

What is the right way to query an I2C device from an interrupt service routine?

The ADXL345, for example, requires that interrupts are responded to by querying the INT_SOURCE (interrupt source) register. In example code for the SparkFun ADXL345 Arduino Library, there is code that ...
3
votes
2answers
13k views

Detecting distance moved by accelerometer?

I have an accelerometer connected to an Arduino Uno board, is there a way I can detect the distance it this accelerometer moved on each of the 3 axis?
3
votes
1answer
670 views

How to get and interpret digital accelerometer data?

I am trying to connect an Arduino to a digital accelerometer. The Arduino receives commands from a mobile app and transmits over Bluetooth through hardware serial. I also posted this question here. ...
3
votes
3answers
199 views

Accelerometer IoT

I am not sure if I am in the right place. I would like to build a device (as small as possible) that has an accelerometer and can talk to my phone via bluetooth. Im not asking anyone to build this for ...
3
votes
1answer
1k views

Accelerometer Interrupt Meaning - Wakeup Function

I am working with an LSM9DS1 IMU, and now specifically trying to program a wakeup feature into the system. My idea is to set the accelerometer at the lowest possible read rate, then when the ...
2
votes
3answers
6k views

Send multiple sensor values over serial

I want to send a JSON string over serial from arduiono device to my computer. The JSON string contains a sensor value array. To fill this array I use String.concat("value") function. But If I have ...
2
votes
1answer
836 views

How can I simulate an accelerometer?

I am new to Arduino. I want to simulate a circuit which uses an accelerometer ADXL335 and a DC motor. If any deviation observed in the accelerometer readings, I want the motor to rotate. Is there any ...
2
votes
4answers
5k views

How to use Multiple MPU9250 to Arduino Lilypad [duplicate]

Is it possible to connect more than one or to be specific 5 MPU9250 into 1 Arduino lilypad? How will I set the addresses, and where should I put the pins for SDA and SCL? I hope someone out there ...
2
votes
3answers
128 views

Sensing horizontal tilt

I'm building a digital gear shift knob, which would display current gear (1-5, R) and based on readings from OBD-II change color when gear shifting is required, to save on fuel consumption. I need a ...
2
votes
2answers
82 views

Most precise way to measure Linear distance travelled by a wheel

Suppose a bot with wheels is traveling in a a straight line,and we want to measure this linear distance traversed by it as accurately as possible. One of the ways is to use an optical encoder to ...
2
votes
1answer
342 views

ADXL355 accelerometer code

I am doing a project which monitors vibrations using an ADXL355 sensor and an Arduino. I have used the MPU-9250 sensor before. I am not able to find a library or tutorials for calibrating, filtering, ...
2
votes
1answer
457 views

Arduino Mega and gyroscope erroneous values

I have Arduino mega2560 and MPU6050. I connected to Vcc pin of the gyro to +5V on the mega, the SDA to SDA pin, SDL to SDL pin, AD0 and GND to 2 GND pins. I used this code: #include<Wire.h> ...
2
votes
1answer
819 views

How can I2C be made to work through a level shifter?

I am attempting to use a bi-directional level shifter for an IMU to shift the SDA and SCL lines in an I2C implementation, however cannot get the level shifter working with the Arduino at all. It feels ...
2
votes
3answers
679 views

Absolute encoder vs Accelerometer for calculating angles

I've been toying with this idea for a while and after some thorough research I'm more than happy that the project is realistic. However I'm in need of some direction in terms of the sensors I should ...
2
votes
2answers
407 views

Is it possible to measure the velocity of a Unmanned Aerial Vehicle using only accelerometer?

Our project is about dropping a payload from a UAV on the specified area. We are using an accelerometer (connected to the Arduino board) to measure the velocity of the plane (assuming the initial ...
2
votes
1answer
239 views

9 DoF Sensor Accelerometer Readings Inconsistent

I have the following sensor stick: https://www.sparkfun.com/products/10724 It has an accelerometer, gyroscope, and magnetometer. I have connected it to an arduino and am reading the accelerometer ...
2
votes
2answers
1k views

Using Arduino Micro with MPU6050

I have an Arduino Micro and an MPU6050 gyro/accelerometer board; I want to read DMP data from the MPU6050, but the sketch requires the use of the interrupt pin, of which I have none of the interrupt ...
2
votes
1answer
110 views

My motor driver gets stuck in either high or low with a certain speed super randomly. Motor output stops going based on accelerometer input

Running a DC motor(6.5A max input), motor driver (MD10C 7Amp peak output), and arduino Mega. Basically, I am creating a stabilized object based on the accelerometer's input. It works great but all of ...
2
votes
1answer
229 views

How do I connect an accelerometer (GY-521) to a SparkFun Thing Dev (ESP8266)?

All of the wiring diagrams I've found for wiring up a GY-521 accelerometer to an Arduino have looked something like this: I've read in several places that it needs to be connected to A4 and A5. I ...
2
votes
1answer
3k views

What is corrrect the way to find roll, pitch, yaw?

I have an MPU9250. I have calculated accelerometer, gyroscope, magnetometer. But I want to know how to caclulate roll yaw pitch. I have searched on Google. I found many answer roll = (atan2(-...
2
votes
1answer
237 views

ADXL345 becomes 0g when plugin MicroSD Adapter using SPI

Try SD SPI code and ADXL345 SPI code separately and both are fine. When merge the codes, ADXL345 reading okay (not plug in MicroSD Adapter). Pin should bo okay. Every time MicroSD is plugged (the ...
2
votes
2answers
387 views

AtTiny85 and MMA8452Q accelerometer cannot connect using i2c

I am trying to connect the MMA8452Q with AtTiny85 using the TinyWireM library. I made the proper hardware setup with pull-ups on SCL and SDA pins - tested it on Arduino Uno and it works, however ...
2
votes
1answer
365 views

Why is there no smooth value from ADXL335?

I have written this code to read x-acceleration from ADXL335. Why is the value toggling between 342, 343, 344 even at rest? Is there anything I need to do to get a smooth curve? How to increase ...
2
votes
1answer
621 views

Accelerometer readings on a moving object [closed]

I hope this stack is the right place for this question. I have an accelerometer mounted securely on a swaying object -lets say a stick or pole- this object is swinging back and forth in small angles (+...
2
votes
1answer
160 views

Adding fade to this RGB LED IMU

I've built an accelerometer based dice. It changes colour based on what side of the dice faces up. All is well and good, except I'd like the RGB to fade from one colour to the next instead of changes ...
2
votes
2answers
7k views

How do I communicate with a sensor via an Arduino's RX/TX ports?

I have a sensor that communicates via serial communication. CTi Sensors TILT-05. It transmits an ASCII string with data separated by commas. I want to be able to read the incoming ASCII data in the ...
2
votes
1answer
243 views

Function not successfully reading sensor registers

I'm trying to write a library for an accelerometer/magnetometer sensor. The sensor is a LSM303D chip (https://www.pololu.com/file/0J703/LSM303D.pdf). I've written a function, readRegister() (below) ...
2
votes
2answers
6k views

Linear acceleration from MPU 6050

When reading the MPU 6050 has accelerometer and gyro, I assumed it was linear acceleration, but now I second guess that. From this video https://www.youtube.com/watch?v=qmd6CVrlHOM it seems like they ...
2
votes
1answer
336 views

Interfacing accelerometer LSM303DLH with Arduino UNO using I2C

I am trying to connet a tri axis accelerometer LSM303DLH to arduino UNO using the libraries taken from the following links (https://github.com/adafruit/Adafruit_LSM303DLHC and/or https://github.com/...
2
votes
1answer
896 views

Analog angle conversion from +70° to -70°

I am using below sensor (accelerometer) .My application is a solar tracker, where I wanted to convert the sensor output into +70° to -70° format. My question is how can I convert the angle? #define ...
2
votes
0answers
37 views

Does anyone know code for a filter that bypasses small vibrational movements in my accelerometer input data

So basically I have a DC motor that is self stabilizing a platform using an accelerometer as its input. When i hit the table, everything freaks out and the platform moves rapidly back and forth for a ...
2
votes
0answers
54 views

looking for a very accurate and sensitive accelerometer [closed]

For a research type project, we are looking for a very accurate and sensitive accelerometer (preferably 6-axis). The average range of the acceleration that we need to record is about 0.0003g (g=...
2
votes
2answers
678 views

Problem with measuring vibrations (Arduino UNO + step motor + accelerometer)

I'm trying to measure vibrations of the motor's shaft that is oscillating due to an eccentric load. For that, I am using the MPU 6050 6 axis accelerometer. The motor is a NEMA 17 stepper, connected to ...
2
votes
0answers
601 views

Transforming from analog output to speed and acceleration with gy-61

Maybe it's a simple question but I'm unable to get what I need. My task is this: Get the acceleration and speed of each axis of the accelerometer. I thought of something like: const int VCCPin = ...
1
vote
6answers
3k views

Detect a non-human moving object

I would like to design a system in which I am able to make a light flash when a motion sensor detects a movement of a non human object such as a car. (The goal here being that when a car is moving ...
1
vote
2answers
4k views

How to change i2c address for mpu9250?

I'd like to connect 12 mpu9250 sensors to one arduino board. I can't find documentation on how to change the addresses of mpu9250 boards. (i read through the reference ). Some tutorials talk about ...
1
vote
1answer
2k views

square root of large number

I've got 2 int16_t numbers, say 388 and 10288, which are sensor readings from an accelerometer. I want to estimate the angle of the device on that, but seemingly there are some type overflow issues: ...
1
vote
2answers
406 views

Adafruit_LSM303 tilt compensated compass

I am having troubles with tilt compensating my compass. I am using the LSM303DLHC accelerometer/compass in combination together with the Adafruit_LSM303_U.h. I was able to get my compass to the ...
1
vote
2answers
919 views

Analog vs Digital Accelerometers - pro's and con's? [closed]

For my project i need to measure accelerations up to 16g. My options are either digital accelerometers such as the MPU6050 or MPU9250 or an analog accelerometer such as the ADXL326. What are any ...
1
vote
1answer
465 views

Does the position in which you mount an IMU matter?

Forgive me, I'm sure this is a total noob question, but I have never seen it actually addressed in any example or demo. When using something like a MinIMU-9 board (https://www.pololu.com/product/...
1
vote
2answers
5k views

Enable free fall detection using Arduino

I'm trying to get an arduino board to detect simple free fall condtions. Currently, I have a 9DOF sensor (https://learn.sparkfun.com/tutorials/lsm9ds0-hookup-guide) and am able to get the raw data ...
1
vote
2answers
1k views

MPU6050 acceleration values not 16-bit?

I'm looking at the little code snippet from this (many other projects also use similar code): void loop(){ mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); ax = map(ax, -17000,...