natmendes
Posts: 6
Joined: Thu Jan 11, 2018 2:19 pm

i2c problem - two slaves with same address

Fri Mar 02, 2018 7:50 pm

Hi everyone! Im trying to use two infrared temperature sensor mlx90615. They use i2c communication.
My ideia is to get one temperature by second. But, as they are the same device, they have the same address, so i can not recognize from which sensor RPi is getting temperature.
I dont know how to separate them to say in code 'first get this one, and then get the other one'.
Im using bcm2835.
Can anyone help me?

Thank you!

User avatar
joan
Posts: 13412
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: i2c problem - two slaves with same address

Fri Mar 02, 2018 9:28 pm

You have a number of choices. The two easiest are probably

Buy a multiplexer chip such as the TCA9548A to choose between the devices.

Create a software I2C bus on a couple of spare GPIO and connect one device to the hardware bus and the other to the software bus.

Search through /boot/overlays/README for some information on these options.

dgordon42
Posts: 741
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: i2c problem - two slaves with same address

Fri Mar 02, 2018 10:12 pm

The mlx90615 device stores it's I2c address in it's EEPROM, and so you can change it to allow multiple mlx90615 devices on a single I2c Bus.
Details on page 9 of the datasheet

Hope this helps,
Dave.

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

Who is online

Users browsing this forum: No registered users and 14 guests