Hello, I have some experience with arduino, and today I tried to work simultaneously with a barometric presure sensor and a real time module. Thei links:
Bots sensor work flawlessly when they are alone connecte to arduino. However, when I connect both of them (GND-GND, SDA-A4, SCL-A5,
BMP Vcc-3.3V, RTC Vcc-5V) and set the time of the real time module it does not store it after a system reboot.
All codes are tested alone and work perfect at the arduino UNO R3.
When both modules are connected everything works but this. Is there any solution to the problem?
Is there any problem of connection a 3.3V and a 5V device at the i2c? Has anyone achieved to use RTC with a 3.3V i2c device?
I also have an 9dof IMU sticj and a temperture sensor (links: SparkFun 9 Degrees of Freedom - Sensor Stick - SEN-10724 - SparkFun Electronics , SparkFun Digital Temperature Sensor Breakout - TMP102 - SEN-13314 - SparkFun Electronics).
Try putting 4k7 pull ups from SCL and SDA to +3V3 only. This might get things working. But it relies on all the 5V devices having a low enough VIH to recognise 3.3V as HIGH. If not you could also add extra 15k pull ups to +5V thus pulling the lines up to about 3.7V (which should be just OK for the 3.3V device).
OK, the barometric pressure finally worked without using any resistor or logic level sifters.
The same did the temperature sensor. These work with no problem with the real time module.
The problem is now with the 9dof IMU stick. When the real time module runs and just prints
the current time, I connect the SDA and SCL of the stick and the transfer freezes.
If I reset the board it sends me back some other time and when I disconnect the IMU the right time
comes back again.
Has anyone worked with these two modules? Any suggestion to look for?
Mixing 3V3 and 5V devices on the same 5V I2C bus is not going to work. If you see it functioning then you are killing the lower voltage device.
What you need is an analogue switch to swap over between the two busses with your pull up on the device side and an I2C libary that does not enable the internal pull up resistors.
Is there any way to do it just with resistors (pull up/down)?
Can I have different SDA/SCL pins for the real time module (for instance A2,A3)
and use A4 and A5 for the 3V3 sensors?