# Accelerometer with Ratiometric Analog Outputs constant output despite being moved

Joined Sep 14, 2020
48
Input measured 4.9 V (4.50-5.25 allowed). Output on pin 5 or 6 is always 2.4 V.

Datasheet

Outputs are not tied together. Is there something I need to do related to load impedance at these outputs?

capable of sinking or sourcing up to 100μA. The user should ensure the load impedance is sufficiently high as to not source/sink >100μA
An ESP32 is also reading the data. It outputs zero for everything:

Code:
float x, y;

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

void loop()
{

Serial.print(x, DEC);    // acceleration in X axis
Serial.println(" ");
Serial.print(y, DEC);    // acceleration in Y axis
Serial.println(" ");
delay(100);
}

#### LowQCab

Joined Nov 6, 2012
2,940
Where is the rest of the Circuit ?
.
.
.

Joined Sep 14, 2020
48
Where is the rest of the Circuit ?
You mean the two wires connecting the outputs to the ESP32? Can you not just imagine two wires?

Joined Sep 14, 2020
48

#### LowQCab

Joined Nov 6, 2012
2,940
The I/O-Pins You are using are probably not set up correctly.
Have You tried the "ST" ( self-test ) function of the Accelerometer ?
.
.
.

Joined Jan 15, 2015
7,149
Are you rotating on the X and Y axis? With the applied 5 volts I expect to see right about 2.5 Vout on the X and Y axis till the chip is rotated on the X and Y axis.

Less knowing exactly which ESP32 Development Kit you have? I see ESP32-DEVKITC-32D but a good pinout link would help for your exact board? The code you posted isn't going to return much of anything other than a value between 0 and 4095. Your MXR7305VF sensor should output 250 mv/G. It measures acceleration with a full-scale range of ±5g and a sensitivity of 250mV/g. This is your sensor data sheet.

The ESP 32 is a 3.3 volt chip and any analog input cannot exceed 3.3 volts. With your sensor the 2.5 volts is normal for zero rotation on the X and Y axis. With 250 mv/G and +/- 5.0 G that's 5 * .250 volt = 3.75 volts or 2.5 volts - 1.25 volts = 1.25 volts. Your output range for X and Y axis will be between 1.25 volts and 3.75 volts with the latter exceeding your 3.3 volt ADC limit on your ESP32.

All your code will return is values between 0 and 4096 (2^12) for a 12 bit A/D which is what the ESP32 is, a 12 bit Analog to Digital converter. It's not going to work with your sensor. I suggest you disconnect the ESP 32 and measure your sensor out X and Y referenced to ground while you rotate the sensor on the X and Y axis. You should see the Vout change as noted.

With 2.5 volts applied to a useable A/D input you should see 4096/2 = about 2046 or 1/2 of 4096 and that would be with a 5.0 volt referenced A/D. With a 3.3 volt referenced A/D 1.65 volts would be 1/2 full scale or 4096 / 2 = 2048 bits.

If rotating your sensor does not change Vout the sensor is faulty. Again the sensor Vout will exceed the Vin of the ESP 32 which is a 3.3 volt chip.

Ron

Joined Sep 14, 2020
48
Have You tried the "ST" ( self-test )
I will try it. Thank you.

Your output range for X and Y axis will be between 1.25 volts and 3.75 volts with the latter exceeding your 3.3 volt ADC limit on your ESP32.
I am probing the outputs, and there is no change in the output voltage. I also have the same circuit except with voltage dividers, but it does not matter much since the raw voltage is constant anyway. The same reading happens on the other circuit. I believe the sensor is good, but I can put it on an adapter board and breadboard setup to experiment with...

---

Perhaps the frequency is just too low at 27 Hz? It says it is an automotive IC. So maybe it is just for sensing a large change in acceleration, like a car flipping over or something...

Joined Jan 15, 2015
7,149
The data sheet for your accelerometer does cover Frequency Response 3db @ 5.0 Hz. Just powering the chip, not connected to anything, rotating the chip on the X and Y axis you should see the Vout changing. Just give that a try. If your Vout for both X and Y axis does not change you likely have a bad chip.

Figure it this way. The sensitivity of your chip is 250 mV/G. The gravity on the earth's surface is 1.0 G. Nominal output of your Sensor is 2.50 volts +/- 15 mV. So laying flat on a surface you should see between 2.535 volta and 2.565 volts. Rotating the sensor on the X or Y axis 90 degrees you should see a change of 250 mV or 0.250 volts from where you started.

Ron

Last edited:

Joined Sep 14, 2020
48
ADC pins. These are highlighted with a red border in the figure below.

The pins are the same even though I have a different development board. I think I connected it wrong last week when I got no voltage difference. So two mistakes.

It works now. Now I know I can only use the pins connected to the ACD... duh. Thanks you two for helping me work through it!

#### Attachments

• 245 KB Views: 0