Skip to content

kaic/Motion-With-Accelerometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Motion-With-Accelerometer

A simple Arduino-based inertial motion tracker using a 3-axis analog accelerometer (e.g., ADXL335).
The sketch reads raw acceleration, removes sensor bias, integrates acceleration to estimate velocity and position, and streams all telemetry over Serial.

How It Works

  • Reads analog values from the X, Y, and Z axes.
  • Converts ADC readings into acceleration (g units).
  • Calibrates the sensor by averaging samples while the device remains still.
  • Removes sensor bias and subtracts gravity from the Z-axis.
  • Integrates acceleration over time to estimate:
    • Velocity
    • Position
  • Streams all telemetry over Serial for logging or visualization.

Features

  • Lightweight Arduino implementation
  • Automatic bias calibration on startup
  • Adjustable sampling interval
  • Real-time telemetry output
  • Basic inertial navigation using classical kinematics

Limitations

This is a simplified inertial tracker.
Analog accelerometers accumulate noise and drift quickly when integrated.
Without additional sensors (gyroscope, magnetometer, GPS), long-term position accuracy will degrade.

Hardware Requirements

  • Arduino board (Uno, Nano, etc.)
  • ADXL335 or compatible analog 3-axis accelerometer
  • 3 analog input pins (A0, A1, A2)

Serial Output Format

dt:<seconds>,ax:<g>,ay:<g>,az:<g>,vx:<m/s>,vy:<m/s>,vz:<m/s>,px:<m>,py:<m>,pz:<m>

License

MIT License

About

How to get position, velocity and acceleration of an arduino using a accelerometer and integral calculus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages