GY-85 — A quick datasheet study

ADXL345 How it Works #arduSerie 34

J3
Jungletronics
7 min readJun 5, 2017

--

In this post we will unlock the accelerometer — ADXL345off the board.

In this other post we already work with compasses…

Are you in a hurry? Do you want the codes?

What about the board GY-85, what’s so special about it?

I2c Address is 0x53

Now, back to accelerometer…Datasheet says:

ADXL345 — THEORY OF OPERATION

The ADXL345 is a complete 3-axis acceleration measurement system. The ADXL345 has a measurement range of ±16 g minimum.

The accelerometer can measure the static acceleration of gravity in tilt-sensing applications as well as dynamic acceleration resulting from motion, shock, or vibration.

The sensor is a polysilicon surface-micromachined structure built on top of a silicon wafer. Deflection of the structure is measured using a differential capacitor that consists of independent fixed plates and plates attached to the moving mass.

ADXL345 — MECHANICAL SENSOR

The ADXL345 uses a single structure for sensing the X, Y, and Z axes. As a result, the three axes’ sense directions are highly orthogonal and have little cross-axis sensitivity.

ADXL345 — APPLICATIONS INFORMATION — POWER SUPPLY DECOUPLING

For most applications, a single 0.1 µF capacitor, CDC, placed close to the ADXL345 supply pins adequately decouples the accelerometer from noise on the power supply.

ADXL345 — USE WITH OPERATING VOLTAGES OTHER THAN 3 V

The ADXL345 is tested and specified at VS = 3 V; however, it can be powered with VS as low as 1.8 V or as high as 3.6 V. Note that some performance parameters change as the supply voltage is varied.

ADXL345 — OUTPUT IS RATIOMETRIC

Ratiometric (Adjective)?

(electronics) Describing any system in which an output is directly proportional to an input.

The ADXL345 output is ratiometric, therefore, the output sensitivity (or scale factor) varies proportionally to the supply voltage. At Vs = 2.5 V, the output sensitivity is typically 256 LSB/g (see code below).

The zero g bias output is also ratiometric, thus the zero g output is nominally equal to VS/2 at all supply voltages .

ADXL345 — POWER CONTROL & AXES OF ACCELERATION

The device will come up in sleep mode upon power-up, so this is the first register we should worry about: POWER_CTL!

ADXL345 — HOW IT WORKS

Standby or Measurement : At power-up, the device is in standby mode, awaiting a command to enter measurement mode, and all sensor functions are off. After the device is instructed to enter measurement mode, all sensor functions are available.

Standby Mode: For even lower power operation, standby mode can be used. In standby mode, current consumption is reduced to 0.1 µA (typical).
In this mode, no measurements are made. Standby mode is entered by clearing the measure bit (Bit 3) in the POWER_CTL register (Address 0x2D).
Placing the device into standby mode preserves the contents of FIFO.

FIFO: accumulates samples, holding the latest 32 samples from measurements of the x-, y-, and z-axes.

Retrieving Data from FIFO: The FIFO data is read through the DATAX, DATAY, and DATAZ registers (Address 0x32 to Address 0x37). When the FIFO is in
FIFO, stream, or trigger mode, reads to the DATAX, DATAY, and DATAZ registers read data stored in the FIFO. Each time data is read from the FIFO, the oldest x-, y-, and z-axes data are placed into the DATAX, DATAY and DATAZ registers.

Measure Bit : A setting of 0 in the measure bit places the part into standby mode, and a setting of 1 places the part into measurement mode. The ADXL345 powers up in standby mode with minimum power
consumption.

ADXL345— [PSEUDO]CODING

Here is a six-steps PSEUDOCODE for ADXL345:

Notice that we have 6 questions to answer (5, actually…):

Working Code Flavor I; see others flavor in my github repo: project 34 #arduSerie

Here is my breadboard:

Now upload this code to your arduino and have fun!

CURIOSITIES ABOUT ACELLERATION:

Hyphothetical 3 stage rocket to reach orbit

Download All File for This Project

Credits & References:

Breakout — 3-axis Analog Accelerometer ADXL345

Maxed out: How many gs can you pull?

Launch Accelerations: Values, history

xsens: Accelerometers

madc/GY-85

Sparkfun ADXL345 Hookup Guide

Tap, Tap, Drop. ADXL345 Accelerometer + Arduino from http://bildr.org

— — — — — — — — — — published at Jun/2017 — — — — — — — — — —

--

--

J3
Jungletronics

😎 Gilberto Oliveira Jr | 🖥️ Computer Engineer | 🐍 Python | 🧩 C | 💎 Rails | 🤖 AI & IoT | ✍️