I2C Level Converter with Bar30 Pressure Sensor

Hello,

I recently bought the I2C level converters,bar30 pressure and temperature sensors from your website.I tried to use them together and my setup was like you stated in the documentation.

SDA >> Arduino A4 pin
SCL >> Arduino A5 pin

After uploading example code , I get extremely big values.As I searched from the forum , that values means that the sensor is not communicating with the Arduino.I know the sensors aren’t damaged, so what is wrong in this setup ?

@Baglayici,
Did you verify that the the SJ1 solder jumper is set for +5 vdc on the converter board?

Regards,
TCIII AVD

@tciii,

I didn’t see any example of your suggestion.How am I supposed to do that?

Regards,
Engin

@Baglayici,
See the three solder pads at the top edge of the board labled SJ1? Make sure that there is a jumper between the 5V pad and the center pad.


Regards,
TCIII AVD

Can you post the output when you run the example? Also, try swapping the SCL and SDA wires.

@tciii Yeah, SJ1 is soldered to +5V.

@jwalser I tried to swap pins but didn’t work as well.Here is my output:

Hi Engin,

It sounds like you are doing everything right Just to confirm, can you please take a picture of your setup, including the boards and where everything is plugged in?

Can you also please try using the following code instead?

#include <Wire.h>
#include "MS5837.h"
MS5837 sensor;

void setup() {

Serial.begin(9600);

Serial.println("Starting");

Wire.begin();

sensor.init();

sensor.setModel(MS5837::MS5837_30BA);

sensor.setFluidDensity(997); // kg/m^3 (997 freshwater, 1029 for seawater)
}

void loop() {

sensor.read();

Serial.print("Pressure: "); 
Serial.print(sensor.pressure()); 
Serial.println(" mbar");

Serial.print("Temperature: "); 
Serial.print(sensor.temperature()); 
Serial.println(" deg C");

Serial.print("Depth: "); 
Serial.print(sensor.depth()); 
Serial.println(" m");

Serial.print("Altitude: "); 
Serial.print(sensor.altitude()); 
Serial.println(" m above mean sea level");

delay(1000);
}

-Adam

Hello @adam ,

It’s not only about pressure sensor , I can’t get correct values with temperature sensor too.I tried your code,didn’t work as well.Here is my setup:

Do you have a multimeter that you can test continuity with? Your jumper wires may be loose/worn out, do you have more jumpers you can try?

@jwalser I tried another jumpers , it doesn’t change anything.I don’t have a multimeter right now, I think there is a problem with the plug-in side.When I use the external pins nearby the plug-in side ,sensor works just fine.But when i plug the sensor it stops working.I have 2 I2C converters , both are the same
.

Engin,

The DF13 connectors can be quite tight. Are you sure you are plugging in the sensors all the way? The top boss of the plug should be flush with the top of the socket. If the sensors are working fine on the pins, then it sounds like both the sensors and the level converters are working fine.

-Adam

Adam,

I think I am plugging it right,but it doesn’t work anyway.Looks like I will have to use only pins , DF13 connector certainly doesn’t work…Thanks.

Engin,

If the DF13 connector doesn’t work due to a bad solder joint, then we definitely want to get that fixed for you! Can you please post a close up picture of of the base of the connector where the solder joints are? Can you see a bad connection there? Can you also post a picture of the connector when a sensor is plugged in from the side so we can confirm it is going in all they way? I want to cover all bases as it it quite odd that both of your level converters have the same issue.

-Adam

Adam,

Connections seem like fine.


I have the same problem. My connection is the same as yours and I used a Arduino Mega.

I have the same reading as well. I am really confused about the connection from the I2C converter to the arduino. How can I assign to my own analog pins?

@yf144114,

The I2C converter pins must be connected to the two specific I2C pins on the Arduino. Here are those pins:

Uno, Ethernet: A4 (SDA), A5 (SCL)
Mega2560: 20 (SDA), 21 (SCL)

It cannot be connected to any analog pins because I2C is a digital communication protocol. If you have a chance, please post a few pictures of how you have it connected and we can help out.

-Rusty

Engin,

Okay, the solder joints seem fine. I’m trying to figure out why the level converter is working fine when the sensor is connected through the pins, and not the DF13 connector. When you tested on the pins, how did you connect the sensor to the pins? If you pushed up a standard header pin on a jumper wires into the sensor DF13 connector, it may have widened the contact which prevents it from making a good connection in a DF13 connector now.

-Adam

Adam,

I used jumper wires just as you described , but before that I plugged-in both sensors to DF13 connectors and they didn’t work…So I don’t think contact pointrs are the reason.Thanks.

-Engin

Hey, I have just bought Bar30 pressure sensor with I2C level converter and am having the same issues when trying to get readings via Arduino.

Was a solution ever found?

Thanks!

Hi Owen, can you please show us a picture of how you have everything wired, and can you show us the output of our example arduino sketch?