How to Use the ADXL335 Analog Accelerometer

If you want to build a tilt-controlled toy, a vibration detector, or a simple motion logger, describe it to Compoden's AI build assistant and it will recommend the ADXL335 with a board that has analog inputs and the code to read it. The ADXL335 is one of the easiest accelerometers to start with because it outputs plain analog voltages you can read directly.

What the ADXL335 Measures

The ADXL335 is a three-axis accelerometer. It measures acceleration along the X, Y, and Z axes, which includes the constant pull of gravity. That means you can use it to detect tilt by watching how gravity shifts between axes, to sense vibration, or to register sharp movements like taps and shakes. Unlike digital sensors, it reports each axis as a continuously varying voltage.

How It Connects

The ADXL335 provides three analog output pins, one per axis. Each pin sits at a midpoint voltage when still and swings up or down with acceleration. Because the output is analog, you read it with your board's analog-to-digital converter rather than I2C or SPI. It is a 3.3V part, so on a 5V board you should power it from the 3.3V pin and, ideally, feed the board's analog reference accordingly for steady readings.

Wiring Basics

  • VCC to 3.3V
  • GND to ground
  • X output to one analog input pin
  • Y output to a second analog input pin
  • Z output to a third analog input pin

On boards without a true analog input, such as many that only read 5V logic, mind the lower 3.3V swing of the outputs and adjust your scaling in code.

Example Use and Code Notes

A common starter project reads all three axes and prints them to the serial monitor so you can watch the values change as you tilt the board. You typically record the resting voltage of each axis, then convert the difference into an acceleration value or a tilt angle. No special library is required: you read the analog pins and do the math yourself, which makes the ADXL335 a good way to learn how accelerometers actually work before moving to digital parts like the MPU-6050.

Build it with Compoden's AI

Tell Compoden's AI build assistant what motion you want to capture, and it checks the ADXL335 and a board with enough analog inputs against real stock, generates the wiring and reading code, and ships the matched kit to your door in India. You avoid the common mistake of connecting a 3.3V sensor to the wrong power rail.

Want a hands-on introduction to motion sensing? Describe your idea to Compoden's AI build assistant and get a complete ADXL335 kit on the way.

Does the ADXL335 use I2C or SPI? Neither. It outputs analog voltages, so you read each axis with your board's analog inputs.

Can the ADXL335 measure tilt? Yes, because it senses gravity, you can work out tilt angle from how the gravity component shifts between the three axes.

What voltage should I power it at? The ADXL335 is a 3.3V part, so power it from the 3.3V supply rather than 5V for accurate, safe operation.

Back to blog