ADXL362 accelerometer giving zeros output with SimpleRead


#1

Hi, so I wired up an ADXL362 accelerometer using a breakout from Sparkfun to work with an arduino uno. To power the sensor I have 3.3V output from the arduino going to the V input of the ADXL362 and arduino ground going to the sensor ground. Also I level shifted pins 9-11 of the arduino from 5V to 3.3V using a voltage divider and plugged those into CS, SCK, and MOSI. The MISO output from the sensor is wired directly into pin 12 of the arduino. When I try to run the SimpleRead example code from the library I get zero output for all measurements as seen below. I also tried connecting the MISO through a fourth voltage divider but I still could not read anything. I’m not sure if it’s just a wiring issue or a coding issue. I am just loading up the SimpleRead sketch and pressing upload. Any advice is appreciated!

Sensor output:
X=0. Y=0. Z=0. TEMP=0
X=0. Y=0. Z=0. TEMP=0
X=0. Y=0. Z=0. TEMP=0
X=0. Y=0. Z=0. TEMP=0
X=0. Y=0. Z=0. TEMP=0


#2

Just a quick look at your picture it does not appear that you have your ground plain on the board hooked to ground on the Arduino. It is a little hard to see though. This would mean that your resistors would actually not be grounded. I would double check the wiring.


#3

Hi Robert, the ground is grounded. The red wire goes from the arduino ground to the negative rail of the breadboard and the voltage from the divider was checked using a multimeter and read ~3.3V. Thank you!


#4

@designSTROM Let me look into this with one one my coworkers. I am thinking that there is something off with how this is wired. Let me see if I can find an example circuit for this board and see what we can do.
-Robert


#5

Thank you, I really appreciate this!


#6

Hello @designSTROM,

Unfortunately you can’t run the signal through a voltage divider to bring the voltage from 5V to 3.3V. The resistance distorts the signal too much and the two resistances in the divider would need to remain perfectly constant. The eval board has an ever-changing resistance and can’t be counted on. There is a pretty easy solution to turn your 5V Arduino into a 3.3V one by following the instructions located here:

After the voltages get fixed then you can verify the connections between the sensor and Arduino. The below link can help explain how the Arduino is hooked up so you know which pins need to be used. You have to use this pins specifically as I have personally tried to use other pins but there are hardware restrictions allowing only these pins to work.
https://www.arduino.cc/en/Reference/SPI

I know this is a lot of info, please look it over and let us know if you have any further questions.


#7

Thank you Joey! So if I picked up a logic level converter that goes from 5V to 3.3V (and vice versa) would that resolve the issue? So I would just set the logic converter as an adapter separating the wires from the Arduino and the sensor. And I will be sure to connect the pins according to the second guide you sent.


#8

Yes. Actually SparkFun’s logic level converter (1568-1209-ND) is recommended for SPI interface. This would avoid the soldering part of the conversion and using their hook-up guide makes it really easy.


#9

Just out of curiosity, what does a logic level converter do differently than a resistor voltage divider? Why would one approach work and not the other?


#10

Biggest issue with the voltage divider is the continuous change in resistance. I’m going to reference my extremely crude drawing below. Assuming there was only the two 100 Ohm resistors there, we would get 5V across each of those resistors because the resistances are equal. Cut the voltage in half, simple and easy.

Once we add the 10 Ohm resistor in there (this would be an example of your eval board) then the resistance of the bottom circuit changes. Since they are connected in parallel, the total resistance of the bottom resistor and the eval board is going to be below the smallest resistance in the circuit which is of course the 10 Ohms. This throws the proportions way off and you no longer have the same voltages you did before.

Even if you had a way to measure the resistance of the eval board and get the proportions exact, you have to keep in mind that as the eval board operates the internal resistance is going to be changing constantly.

Voltage Divider

A logic level converter is basically a transistor that switches a secondary voltage on when it receives a signal. The nice thing about that is when it gets that input voltage it will send out a completely separate voltage which means it’s going to be a lot cleaner than if you were to run it through resistors.

I hope that makes sense.


#11

I picked up a logic level converter. Not the one from Sparkfun, but this one: http://amzn.to/2h7m8rn. It says I2C but for a logic converter does that matter? Anyway I plugged it into the system and I am still getting no output. I’ve tested the output of the converter and they are all 3.2V which should be within range of the sensor. Do you have any ideas as to what else could be causing this issue?


#12

@designSTROM

First I would just double check you wiring to make sure everything has good connections. Maybe you can show me what is hooked up to which pins.

Second is there an output from the ADXL362? Can you do a reed without the conversion to see if there is an output. This may verify that the ADXL362 is working properly.

Third we need to look at the code to ensure it is working properly. I have not used the simple read library myself. I may have to load it to see what is involved. If you want you can load your code on here and we can look this tomorrow with my team.

I was looking at one of the other tutorials I have and it shows the pins ordered as such.
◦SS – digital 10. You can use other digital pins, but 10 is generally the default as it is next to the other SPI pins;
◦MOSI – digital 11;
◦MISO – digital 12;
◦SCK – digital 13;
You stated you were using 9-11 I just want to ensure everything is hooked up correctly per your set-up.
-Robert