3-Axis Accelerometer/What it measures/02. One g, shared three ways
What it measures · 02 of 11

One g, shared three ways

The chip reports three numbers, one for each direction it can feel. Hold the board still and those three always add up to the same 1 g. Tip it and the 1 g moves from one axis to another, and that sharing is the whole of how it knows which way up it is.

Three directions at right angles

The chip has three axes, X, Y and Z, at right angles to one another like the edges of a box. Two lie flat in the board and the third comes straight out of it. Each reports the push along its own direction, positive one way and negative the other.

Lying flat, chip side up, the whole 1 g is on Z, pointing up out of the board. X and Y read nothing, because nothing pushes sideways. Tip the board and watch where it goes:

One g, shared three ways
Tip the header end down0°
X
0.00
Z
1.00
Total
1.00 g
Flat, Z has the whole 1 g and X and Y have none. Z reads 1.00 because Z points up, away from the Earth, and that is the direction the table is pushing.

The slider tips the board with the header end going down. As it does, Z shrinks and X grows, negative because X points down the board towards the header and the push is coming from the other way. At 90° the board is standing on its header and the whole 1 g is on X. Carry on and Z goes negative: upside down.

The total, printed under the bars, never moves. It is the length of the arrow the three numbers make together, and while the board is still that arrow is gravity's, 1 g long.

The angle is in the sharing

That is what makes tilt measurable. At 30° the board reads −0.50 on X and 0.87 on Z, and no other angle gives that pair. So the angle can be worked back out of the two readings, with one line of trigonometry that tilt from gravity walks through.

It also says what an accelerometer cannot see. Turn a flat board round on the table, like the hand of a clock, and the 1 g stays on Z the whole time. Nothing changes, so nothing can be measured. Which way a level board is facing is a job for a compass.

Positive and negative

Every axis has a direction printed nowhere on the board, and the sign of the reading depends on it. An axis reads +1 g when it points straight up and −1 g when it points straight down. That feels backwards until you remember the chip reports the push holding it up, not the pull of the Earth.

Which way each of this board's three axes points is which way is X, and it is worth knowing before the first reading, because a sign that looks wrong is usually an axis pointing the other way from the one you pictured.

When it does not work

Tilted, X and Z add up to more than 1.

They do not add up directly: the total is the square root of X squared plus Y squared plus Z squared. Tipped 45°, X and Z are each about 0.71 and the total is 1.00. The tilt sketch prints the total for exactly this reason.

The total is 1.03 with the board still.

Within what the chip promises. Every axis can be off by up to 120 mg on a mounted chip, and those errors land in the total too. A total that stays near 1 but is not exactly 1 is a still board; one that jumps around is a moving one.

Turning the board flat on the table changes nothing.

Correct, and it cannot. Spinning a board that stays flat keeps the 1 g on Z the whole time, so X and Y stay at zero. An accelerometer can tell tilt, not which way the board is facing on a level surface. That needs a compass, a magnetometer.

Where this goes next

Four pins, a chip smaller than one of them, and the six parts soldered round it.

The four pins →

Edit this page — content/books/3-axis-accelerometer/one-g-three-ways.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

3-Axis Accelerometer

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →