*Understanding Accelerometer "Ringo-Project"*

*Understanding Accelerometer "Ringo-Project"*

January 22, 2016

Recently I bought one tiny arduino-basedÂ robot called Ringo by PlumGeek.Â It is a "fun-bot" because it has many sensor on board. You can built your own behaviour and PlumGeek has made many many function to simplify your life or you could build it your own from scratch.

Â

It has many inputs & outputs such as

Â RGB NeoPixel LED, IR LED Transmitter, Piezo Sound Element, Ambient LightÂ Sensor, and many more.Â EachÂ sensorsÂ already connected toÂ ATmega 328P (Arduino UNO), some of them connected to I2C port. It also packed with 3 axis Accelerometer, and 3 axis Gyroscope.Â

Â

Â

Using Freescale MMA8451Q Accelerometer on board, I could play with a simple code to access the accelerometer.

Â

Â

ACCELEROMETER?

To understand this "Magic Thing", we can easily think about a box in shape of cube with ball inside it.Â

Each side of Â a cube box is like pressure sensitive sensor labeled with negative and positive axis. Okay, Let's leave the earth for a moment and bring this box to theÂ outer-space.Â Now weÂ can eliminate gravity effect and the ball is perfectly center,Â not touching any side. Imagine that the gap between outer side of the ball and inside the cube is realy-realy small.Â In this situation the accelerometer output will be zero.

Â

If we move the box suddenly to the left, let's say we move the box with acceleration 1g.Â The ball will hit the X- side because of the action-reaction term.Â So the result will be -1g for X-axis.

Accelerometer measured the force that caused by accelerationÂ in opposite direction. Enough time in outer-space, we have to go to our home on earth when Sir Isaac Newton found the gravity effect while observing an apple fell off the tree.

Â

In our home, ball inside the box is accelerated by gravity so that ball sit on Z- side even if the box is not moving.

Â Now if we can throw the box to the skyÂ so it moves perfectly aline with vertical axis, with acceleration of g, you can make the result zero like in outer-space but for just a moment.

For the real life, this model is not exactly how a accelerometer sensors Â work. But you can think and solve the accelerometer problems with this kind of model.

Â

Acccelerometer in Ringo board

Â The sensitivity of this sensor is depand on which mode we are using. In 2g mode the sensitivity is 4096counts/g, 2048 counts/g Â for 4g modeÂ and 1024 counts/g for 8g mode.

All accelerometer has zero-g level.Â This is the value that corresponds to deviation of an actual output signal while the sensor is stationary.

Â

Application...

as measured, the accelerometer data stored safely and can be calculated as g-factor with below equation

Â

AccelerometerAxis = AcceleroData x Sensitivity

Â

The result will be in gÂ Â , Let's called it Rx for X-axis accelerometer data, Ry and Rz with corresponding.

If the device is not moving and the force that apply to the sensor is just gravitation, you can easily define the inclination of device relative to the ground each axis with simple calculation.

You can calculated angle between X,Y, andÂ Z axes :

Â

Axr: arccos (Rx/R) ;

Ayr: arccos (Ry/R) ;

Azr: arccos (Rz/R)Â ;

Â

where R = sqrt(Rx^2 + Ry^2 + Rz^2)

Â

Â

## Who am I ?

Part time adventurer.

Engineer.

Cats lover.

Fingerstylist.

Robot enthusiast.

Globetrotter.

Diver.

February 5, 2017

May 9, 2016

March 18, 2016

March 9, 2016

January 22, 2016

January 21, 2016

January 12, 2016

December 5, 2015

July 7, 2015

June 19, 2015