Msa301 problem

Hello,

I received a delivery of Garden Breakout with bme280 and msa301 sensors. The bme280 works perfectly fine but I seem to have a problem with msa301. One of the axis is “locked” and does not provide any sensible accel reading. I tried couple of examples. Below is sample code I used and the output. Is the unit faulty or do I need to change the calibration of z-axis or try something else? Any advice will be be much appreciated.

Regards,
Pawel

Python code:

import time
import board
import adafruit_msa301

i2c = board.I2C() 
msa = adafruit_msa301.MSA301(i2c)

while True:
    print("%f %f %f" % msa.acceleration)
    time.sleep(0.5)

Output:
2.073241 2.872852 -39.224000
2.422771 -4.400251 -39.224000
3.682038 -19.037430 -39.224000
4.936517 -20.593558 -39.224000
8.848383 -24.299536 -39.224000
7.354500 -20.373306 -39.224000
2.164215 -8.790926 -39.224000
-1.220962 2.456288 -39.224000
-3.653310 -9.399013 -39.224000
-0.454868 -9.035118 -39.224000

Have you got a Pimoroni MSA301 breakout? If so, it might be worth giving our library a go - it looks like you’re using an Adafruit library there?

Thank you for helping with this. Yes, it is Pimoroni MSA301 breakout mounted on Breakout Garden Mini. I’ve tested it on both 2C slots with Pimoroni’s library and the results are similar, with the exception that a different axis seems to be “locked”.

See the output of ‘accelerometer.py’:

-02.00g : -00.53g : -00.70g
-02.00g : -00.38g : -00.70g
-02.00g : -00.31g : -00.49g
-02.00g : -00.15g : +00.33g
-02.00g : +00.21g : +00.71g
-02.00g : +00.25g : +00.73g
-02.00g : -00.42g : +00.81g
-02.00g : -00.85g : +00.29g
-02.00g : -01.00g : -00.17g
-02.00g : -00.83g : -00.47g
-02.00g : -00.94g : -00.34g
-02.00g : -00.95g : -00.33g
-02.00g : -00.90g : -00.28g
-02.00g : -00.94g : -00.14g
-02.00g : -00.96g : +00.55g
-02.00g : -00.41g : +01.00g
-02.00g : -00.68g : +00.50g
-02.00g : -01.06g : -00.18g
-02.00g : -00.93g : -00.17g
-02.00g : -01.02g : +00.05g

Ah - sounds like you might have a faulty sensor then :( If you drop an email to support@pimoroni.com they’ll be able to sort you out with a replacement!