Sensor values jump suddenly

Hi All. An Arduino newbie here.

I have an issue with my ADXL335 accelerometer while running the sketch. It worked totally normal since I first built it a few weeks ago.

Since yesterday, I noticed that the 'z' values jump from around 350 ( which is the normal steady state value while it is lying on the table ) to around 1000 or 1500 or even more; randomly. This happens even if I am not touching it.

Upon further investigation, I noticed that even when I very very very gently touch the wires going from the Arduino to the ADXL335, the z value jumps to these aforementioned really high values.

I also noticed that when I wiggle my finger an eighth of an inch away from the sensor without even touching it, the numbers jump high also.

I would appreciate any feedback.

#include "ADXL335.h"

ADXL335 accelerometer;

void setup() {
  Serial.begin(9600);
  accelerometer.begin();
}

void loop() {
  float x, y, z;
  accelerometer.getXYZ(&x, &y, &z);
  Serial.println(z);
  
}

Loose connection somewhere.

The ADXL335 has analog outputs. A disconnected or intermittently connected Arduino analog input will pick up electromagnetic interference or respond to the presence of a nearby charged object.

Did you cleanly solder header pins to the sensor module?

1 Like

Ty. I will look into it.

BTW, when this entire system is connected on a bread board and that breadboard is in turn placed on a metal kitchen counter and when I touch that counter, I see the same super high random values.

Ty again for your reply.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.