
AnnaCat (Customer) asked a question.
ELECTRONICS:
Components:
Variable Table Top DC Power Supply (running at 24V)
Terminal Block (24V)
Terminal Block (Ground)
P1-01DC
P1AM-GPIO
P1AM-100
P1-08ADL-2 (unused in this scenario)
P1-08DAL-2 (unused in this scenario)
P1-15TD2 (unused in this scenario)
ELEGOO MEGA2560
Adafruit LSM9DS1
4 STEMMA QT Wire Connection
Connections:
The Adafruit sensor has been wired to the GPIO according to the LSM9DS1 Adafruit tutorial: https://learn.adafruit.com/adafruit-lsm9ds1-accelerometer-plus-gyro-plus-magnetometer-9-dof-breakout/arduino-code
and P1AM-GPIO documentation:
https://facts-engineering.github.io/modules/P1AM-GPIO/P1AM-GPIO.html
where SCL (yellow) and SDA (blue) of the sensor are connected to pins 12 and 11 respectively. Power (red) and Neutral (black) wires from the sensor are connected to VCC and GND pins on the GPIO respectively.
SOFTWARE:
I have followed the software setup guide portion of the LSM9DS1 Adafruit tutorial.
All requisite Arduino libraries have been installed. The example code found in the Adafruit LSM9DS1 library (see lsm9ds1.ino) has been modified slightly (see lsm9ds1Modified.ino. These modifications include the removal of the definitions at the top of the example code, the inclusion of the P1AM.h header file, the writing of the function:
while (!P1.init()){
}
and the writing of the print statement:
Serial.println("LSM9DS1 data read demo")
As far as I’m aware, the definitions are not needed since the SDA/SCL pins are hardwired and the P1AM must be initialized via the function mentioned above
The only text printed to the serial monitor is the slots and numbers for the 3 additional modules that I have connected to the 100 module, along with the text "LSM9DS1 data read demo.” No other serial outputs arrive at the monitor (see P1AM_LSM_SerialOutput).
Troubleshooting:
Using a multimeter, I measured the voltage of the GPIO’s VCC, SCL, and SDA pins (all with respect to GND). The VCC pin gave ~3.3V, the SCL pin gave a maximum of ~3.3V, and the SDA pin gave a maximum of ~0.77V.
While using the sensor in conjunction with the P1AM I have tried swapping the GPIO shield, the LSM9DS1, and the 4 STEMMA QT Wire separately, with no change to the serial output.
This contrasts the voltage that these pins yield when the Adafruit sensor is used in conjunction with the MEGA2560 microcontroller. Again, the Adafruit LSM9DS1 is wired according to the aforementioned tutorial (SCL and SDA wires to the pins of the same name, Power to 3.3V pin, and Neutral to GND pin). Using a multimeter, the 3.3V pin gave ~3.3V, the SCL pin gave a maximum of ~4V, and the SDA pin gave a maximum of ~ 4V (all measured with respect to GND). In this configuration, running the attached software without the while (!P1.init()) statement, the IMU data is printed to the serial monitor as expected (see Mega_LSM_SerialOutput).
Thoughts:
From what I understand, the SCL and SDA pins should fluctuate between 0V and some high voltage (at least 3.3V in this case). I assume that the lsm.begin() statement does not return true because the SDA pin not reaching requisite maximum voltage. As a result, no other functions associated with the object can be called. However, if the lsm.begin() statement returns false, the "Oops ... unable to initialize the LSM9DS1. Check your wiring!" statement should be printed to the serial monitor...
Thank you in advance for any assistance!
Library Version Information:
Adafruit LSM9DS1 Version 2.1.1
P1AM Version 1.0.5
Adafruit Unified Sensor Version 1.1.7
I just noticed the word "Bad" written on the 100 module.
I swapped it out and the sensor is working properly...
Sorry to bother you and thanks for your time!