0
\$\begingroup\$

I've been trying to get something working for a project, getting 4 (just trying to get at least 2 working for the moment) MLX90614 IR sensors connected up to an Arduino UNO board.

I've followed the datasheet instructions and managed to get one working using the schematic provided (using the library here) and got a reading. However, as soon as I attach another one, again using the schematics on the datasheet, I get no response.

I am fairly certain the issue is with the library but I can't be sure. The schematic I followed for multiple sensors is:

schematic of serial board

(I have crossed out the parts of the schematic I removed, as the datasheet said they weren't necessary)

The pull up resistors are of a value of 4.7Kohms, and the caps are 0.1 micro.

Any assistance with getting this serial connection would be appropriated.

\$\endgroup\$
  • 3
    \$\begingroup\$ you cannot have two devices with the same address on the I2C bus \$\endgroup\$ – jsotola Feb 3 at 5:15
  • 1
    \$\begingroup\$ If you can spare the pins and the processor isn't too loaded with other work, your simplest solution may be software I2C on unique pins to each sensor. It may seem ugly, but it means no need to configure the sensors and no mixups in assembly... \$\endgroup\$ – Chris Stratton Feb 3 at 8:03
3
\$\begingroup\$

The MLX90614 can be setup to allow for many of them on one SMBus however they need to be configured first. The normal Slave Address that the device recognizes is programmed into one of the internal EEPROM registers as shown in the snippet taken from the Melexis datasheet for the part. If you do not set them up correctly and you have multiple devices all of them will be trying to respond to the same Slave Address and hose up operation of the bus.

enter image description here

One way to set this up is to make yourself a test fixture so that you just have one device socketed and connected to your MCU master SMBus device. Then program the SMBus address into register address 0x00E of the internal EEPROM. Do make sure to not set two devices destined for use on the same bus to the same SMBus address.

If you do not want to mess around with any special setup of the sensors you can consider adding an I2C MUX like the MAX7367 next to the MCU. This IC can provide a separate selectable SCL/SDA port for up to 4 sensors. The nice thing about this type solution is that it does not take any extra wires from the MCU because the software talks to the MUX chip to make the bus selection via the same master side SCL/SDA interface.

\$\endgroup\$
  • \$\begingroup\$ You can also program this on your board by driving VDD from a GPIO port. The first device always has VDD, the second and subsequent use a GPIO to drive their VDD. In your initialization code you simply check for a device on 0x5A with only the first one on. Reprogram that one and turn on the GPIO for device two ...program that away from 0x5A and then enable the next device etc, etc. \$\endgroup\$ – Jack Creasey Feb 3 at 17:11
  • 1
    \$\begingroup\$ @JackCreasey - I am not so sure this will work as you think. There is a warning in the data sheet as follows: "The MLX90614 has diode clamps SDA/SCL to Vdd so it is necessary to provide MLX90614 with power in order not to load the SMBus lines." Due to this all devices on the bus must be powered to prevent disturbing the SMBus operation. \$\endgroup\$ – Michael Karas Feb 3 at 17:25
  • \$\begingroup\$ I see that warning only in the Rev 005 datasheet it does not appear in later versions. The current version of the datasheet (Rev 11) is here: melexis.com/-/media/files/documents/datasheets/… \$\endgroup\$ – Jack Creasey Feb 3 at 18:28
  • \$\begingroup\$ @JackCreasey - The data sheet that you linked still has a statement on page 45 that says "For ESD protection there are clamp diodes between the Vss and Vdd and each of the other pins. This means that the MLX90614 might draw current from a bus in case the SCL and/or SDA is connected and the Vdd is lower than the bus pullups’ voltage." I would still not recommend the GPIO method to drive Vdd if it is desired to support multiple device Slave Address configuration on board. It would be better to follow the comment made by Chris Stratton or to find a way to MUX the SCL lines to multiple devices. \$\endgroup\$ – Michael Karas Feb 3 at 19:04
  • 1
    \$\begingroup\$ I am not so sure that creating separate software I2C ports for each camera is necessarily the only hope. To me it seems quite reasonable to consider adding an I2C MUX like the MAX7367 next to the MCU. This IC can provide a separate selectable SCL/SDA port for up to 4 sensors. The nice thing about this type solution is that it does not take any extra wires from the MCU because the software talks to the MUX chip to make the bus selection via the same master side SCL/SDA interface. \$\endgroup\$ – Michael Karas Feb 3 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.