IanRobinson
Posts: 4
Joined: Thu Nov 22, 2018 11:10 pm

i2c RTC and second sensor problems

Thu Nov 22, 2018 11:21 pm

Hi Folks - any thoughts on this probelm.
I am using a PI3B to read and plot data from an DVLR i2c pressure sensor as part of an Infrasound project (http://www.starfishprime.co.uk/projects ... sound.html).

No problems reading from the 5V i2c sensor.

I now add an Adafruit DS3231 RTC fed from the same 5V line as the other sensor (following instructions at https://pimylifeup.com/raspberry-pi-rtc/) - kernel rtc module loaded - interfaces with RTC no problems.

However, when I have both the pressure sensor and the RTC connected together on the i2c line only the RTC can be read from? Yanking either from the breadboard means the other works. They are at different addresses btw.

I am hoping that this is a capacitance problem, though the lines are only some 20cm long. Any thoughts on where I can go from here?

Thanks

ian

ghp
Posts: 1517
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: i2c RTC and second sensor problems

Sun Nov 25, 2018 12:00 pm

Some 20cm long wires should not be a problem.
Perhaps you could provide a sketch of the wiring? Could be that the combination of 3.3V and 5V devices causes a problem with the different pullup on the I2C lines. Pi uses 2.2k pullup to 3.3V, the adafruit clock board uses 10k to VCC which is according to the tutorial you cite 3.3V, but could also be 5V? The pressure sensor is not known. How is its interface to i2c, pullup, levels, which chip ?

IanRobinson
Posts: 4
Joined: Thu Nov 22, 2018 11:10 pm

Re: i2c RTC and second sensor problems

Sun Nov 25, 2018 1:08 pm

Good point about the pullups.

Both the DVLR pressure sensor (DLVR-L01D-E2NS-C-NI5F ) and the Adafruit DS3231 are fed from the 5V supply on the PI, ADAfruit state that the RTC can run at either 3.3 or 5V. (https://shop.pimoroni.com/products/adaf ... gI6DvD_BwE. )


The sensors are connected in parallel to VCC (5V), GND, SDA & SCL on the PI without pullups or capacitors.

I assumed that neither needed pullups as the PI has them ... but I am seeing that this may be the problem.. Any thoughts on how to tackle this?

Cheers

Ian

ghp
Posts: 1517
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: i2c RTC and second sensor problems

Sun Nov 25, 2018 4:04 pm

The idea is to separate 5-V-domain from 3.3V-domain.
See https://playground.arduino.cc/Main/I2CB ... velShifter
Think something like http://www.adafruit.com/products/757 could help solving the problem.

IanRobinson
Posts: 4
Joined: Thu Nov 22, 2018 11:10 pm

Re: i2c RTC and second sensor problems

Sun Nov 25, 2018 5:50 pm

Thanks for the advice on the logic convertor - In retrospect I should have chosen the 3V version of the pressure sensor. I've ordered a convertor and will post back if it is successful

Thanks again

Ian

IanRobinson
Posts: 4
Joined: Thu Nov 22, 2018 11:10 pm

Re: i2c RTC and second sensor problems

Fri Dec 14, 2018 12:29 pm

You were correct. The PI can read via i2c from the 5V sensor and also the 3V RTC but not concurrently. I used a logic level convertor and now both read correctly

Thanks

ian

Return to “Interfacing (DSI, CSI, I2C, etc.)”