A5 pin low and having i2c multipe sensor trouble

Hi, I am trying to have 2 sensors using i2c. I am using fairly long wires and thought that why it want working, but I measured the A4 pin and it was very close to 5v, but the A5 pin was 1.3 or so. When I tried an example code for one of the sensors by itself on another circuit it worked normally. I am not sure if my code dealing with multiple slave devices is wrong or what. if someone can please help it would be greatly appreciated.

I will include my code. Sorry if it is a bit messy. I marked the parts I believe are related to my problem with “HERE” on the far right side of each line related.

The sensors I am using are the mpu6050 accelerometer and the VL53l0x

Thanks

Tasskat-Code-2.0.ino (4.47 KB)

Post a wiring diagram and links to the used breakout boards (I doubt you're using the chips directly)?

The VLS3L0X is a 2.8V device which is not 5V tolerant. So if you really had 5V on SDA you might have already fried it.

I will include the wiring in a second, it’s not fired, I just tried it on 5v on another circuit by itself with no other sensor and it worked. I read that the one I have can handle 5v.

GY-521 MPU-6050 MPU6050 3 Axis Accelerometer Gyroscope Module 6 DOF 6-axis Accelerometer Gyroscope Sensor Module 16 Bit AD Converter Data Output IIC I2C https://www.amazon.com/dp/B008BOPN40/ref=cm_sw_r_cp_api_aKMVBbH2GYH7J

Icstation VL53L0X 940nm ToF Laser Ranging Sensor Distance Measurement Module I2C Interface for Arduino Amazon.com: Icstation VL53L0X 940nm ToF Laser Ranging

I couldn’t figure out the software for drawing the diagrams and I am sorry in advance, so I am linking one that was already drawn, the connections for the sensors are standard,

5v-VCC on both
GND-GND on both
A5-SCL on both
A4-SDA on both
2-int pin on mpu-6050 accelerometer

I also have another circuit depicted in the diagram where pin 7 controls a mosfet gate pin to control a sullinoid on 12v but that already works and doesn’t effect my problem.

Pin 4- button-ground

Thanks, if you can help I would greatly appreciate it.

Sorry the link isnt working, here is the image.

I cannot find schematics for the VL53L0X board. It seems on the photos like they use a TXS0108E level converter to convert the bus levels. As this pulls the bus to 5V is may produce a failure on the MPU6050. Try connecting VCC of the VL53L0X to Arduino's 3V3 pin. Report if this helps.

How long are your wires? I2C has a maximum length of about 50cm.

Will do, again thanks for the help.

The wires are around 2 or 3 feet but I still measure 3.3v on A5 and A4 pins.

I now disconnected the vl53l0x and just have the mpu 6050 in the same circuit and it seems to work for just the mpu6050 sensor, I am not sure if I am doing something wrong in my code or wiring for dealing with multiple slave devices because both sensors seem to work independently.
I will try the 3.3v pin for vcc and let you know.

Thanks.

The wires are around 2 or 3 feet but I still measure 3.3v on A5 and A4 pins.

That's not the problem, it's the capacitance of the bus that's increased with longer wires. That makes the edges less steep and you might not get to the necessary voltage fast enough in a transfer. Try to make the wires shorter.

I now disconnected the vl53l0x and just have the mpu 6050 in the same circuit and it seems to work for just the mpu6050 sensor, I am not sure if I am doing something wrong in my code or wiring for dealing with multiple slave devices because both sensors seem to work independently.

I guess you have a hardware and not a software problem.

I have a board where the HIGH on one pin only measures about 3V. It happens. Try using it for input.

I now believe it is how I am utilizing the sensors. Something I am not defining with i2c or something in code. I have both connected on the same circuit and the mpu works for some code I wrote to test both sensors at once ( which was basically combining the sensors example codes) and only the mpu sensor worked, but when I ran just the vl53l0x code it worked fine. I will include the testing code I used, I am sure it will be much easier to look through without all of the other stuff on my other code.

Thanks.

sensor_test.ino (950 Bytes)

You need pull up resistors on the I2C bus. Connect them from each bus signal to the 3V3 line. Use 2k7 resistors. Also disable the internal pull up resistors to 5V by setting the pin mode to just input immediately after beginning the I2C bus.

Three feet is pushing it for an I2C bus. These are only designed to be used across a PCB.

What variable or pin do I set to input to disable the internal 5v pull up? is it just the A5 and A4?

I also added the resistors like you said, sill only one sensor is returning data, but probably because I haven't disabled the internal pull up yet.

Thanks

is it just the A5 and A4?

Yes.

sill only one sensor is returning data

Whether this is you only problem is moot, but those things need doing.