Electrical – Using Multiple MLX90614 Sensors on Arduino Board

arduinosensorserial

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.

Best Answer

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.