Bmp180 (w/ pca9306 level shifter) interfacing with i2c-0 on db410c

Hey Folks,

I am impressed with all the discussions and support for the mini projects.

Recently, I am playing around with my dragonboard. Trying to interface with i2c and bmp180 sensor.

I hooked up stuff on breadboard and measure voltages reaching 3.3 v with bread board setup.

I have custom debian build.

I could not get my driver to read the registers of the i2c device at 0x77 (bmp180)

I did create a DT entry under i2c0 as:

27 i2c@78b6000 {
26 /* On Low speed expansion /
25 label = “LS-I2C0”;
24 status = “okay”;
23
22 /
test - temp, alti, press sensor driver */
21 tap_sensor: bmp180@77 {
20 status = “okay”;
19 compatible = “test,bmp180”;
18 reg = <0x77>;
17 };
16 };

I could see a device node enumerated under /sys/bus/iio/devices directory.
Am I missing something. please help.

/aisri

Hi @Sreekanth_Boga,

I could not get my driver to read the registers of the i2c device at 0x77 (bmp180)

Were you able to see the i2c device using i2cdetect command?

I could see a device node enumerated under /sys/bus/iio/devices directory.

This means your IIO device got registered but this doesn’t mean that your sensor is working. I would suggest you to identify the device by i2cdetect first.

Thanks,
Mani

Additionally:

  1. Don’t assume LS-I2S0 will appear as /dev/i2c-0; the DB410C has a lot of I2C buses IIRC the i2c mezzanine pins end up allocated a fairly high number (but you can run i2cdetect to find out which one has your sensor).
  2. A regular i2cdetect scan won’t work on DB410C because the controller doesn’t support quick writes. You will need to do i2cdetect -r to scan using receive byte instead.

BTW you don’t need to worry too much about all the warning that i2cdetect can crash your buses… The warnings are real but they are more to stop reckless sys admins from risking their 99.9% uptime.

bmp180 is compatible with 1.8v. Why are you running a level shifter?

bmp180 is compatible with 1.8v. Why are you running a level shifter?

Many of the carrier boards have an on-board regulator (to allow it to be
powered by 5v Arduino). I’m not sure such boards can be powered at 1v8
without a bit of hacking.

Having said that I just put “try to desolder the power supply of my BMP280
module” on my TODO list (although I admit that it is far enough down it
may never be reached).

@Mani,
Yup I am aware of that, I mentioned that since, I want to confirm that my DeviceTree entry is good, since it is registered well, (wanted to rule out the DT as the problematic entity).

I did run i2cdetect on the board with the command i2cdetect -y -r 0, I still could not see it enumerated w/o driver loading up.
When the driver loads up & takes control of 0x77 device I do see UU being displayed with i2cdetect command.

There are many bmp180 pcb boards out there in market. I got this one: https://www.amazon.com/JBtek-Barometric-Pressure-Temperature-Altitude/dp/B00UUS12PO

The description says that it is soldered to 3.3v pcb. So i used a level shifter from 5V to 3.3V.

Product features:

Measure temperature, pressure, and altitude
Perfect for your Arduino project
Requires soldering of header pins

Product description

This precision sensor is the best low-cost sensing solution for measuring barometric pressure and temperature. Because pressure changes with altitude you can also use it as an altimeter.
The sensor is soldered onto a PCB with a 3.3V regulator, I2C level shifter and pull-up resistors on the I2C pins.
Using the sensor is easy. If you’re using an Arduino, simply connect the VIN pin to the 5V voltage pin, GND to ground, SCL to I2C Clock (Analog 5) and SDA to I2C Data (Analog 4). Download the BMP180 Arduino library and example code for temperature, pressure and altitude calculation. Immediately you’ll have precision temperature, pressure and altitude data.

I will try to directly hook up the board to the sensor and try it out.

Any other ideas are welcome.

The JBtech board has an onboard regulator which takes the 5V supply and reglates it down to 3.3V. They then run the BMP180 at 3.3V, this includes the BMP180 I/O at 3.3V. Although the BMP180 is capable of operation with 1.8V I/O, in this case it is set up for 3.3V I/O.

You should supply 5V to the JBtech board. You are correct that you need level shifters between the 410c and the BMP180 board. The 410c side of the level shifters should be powered by 1.8v. the BMP180 side of the level shifters should be powered by 3.3V.

I’m not sure what items you connected to the 5V side of the level shifters, but you may have permanently damaged something, or maybe you will get away with it.

Hopefully when you get everything thing correctly connected, it will work.

A few years ago I did connect a BMP180 to a 410c, but I used a board that could be configured for 1.8V I/O, so no level shifters were required.

-Lawrence-

I did run i2cdetect on the board with the command i2cdetect -y -r 0, I still could not see it enumerated w/o driver loading up.
When the driver loads up & takes control of 0x77 device I do see UU being displayed with i2cdetect command.

This means, the device not visible on the bus. But since the driver explicitly says that it has occupied the device, 0x77 is shown as UU after driver load. This scenario happens when the connection between the sensor and board is not correct so sensor is not detected but driver has occupied the particular address.

The description says that it is soldered to 3.3v pcb. So i used a level shifter from 5V to 3.3V.

Not sure what you mean here. As said by @ljking, you need to attach a 1.8v to 3.3v regulator between DB410c and sensor module and power it as per his suggestion.

Thanks,
Mani