MAX30205 temperature sensor and Arduino YUN

Hi everyone.

I make the MAX30205 PCB by myself and when I MAX30205 to Arduino YUN,also I already use I2C scanner found my I2C.But it only shows"T=256.00C"...

The code what I have used is from github

The first code is max30205demo.ino,and the second one is ClosedCube_MAX30205.cpp

#include <Wire.h>
#include "ClosedCube_MAX30205.h"

ClosedCube_MAX30205 max30205;

void setup()
{
 Serial.begin(9600);
 Serial.println("ClosedCube MAX30205 Arduino Demo");

 max30205.begin(0x48);
}

void loop()
{
 Serial.print("T=");
 Serial.print(max30205.readTemperature());
 Serial.println("C");
 delay(300);
}
#include <Wire.h>
#include "ClosedCube_MAX30205.h"

ClosedCube_MAX30205::ClosedCube_MAX30205()
{
}

void ClosedCube_MAX30205::begin(uint8_t address) {
 _address = address;
 Wire.begin();

    /*
 Wire.beginTransmission(_address);
 Wire.write(CONFIGURATION);
 Wire.write(0x0);
 Wire.endTransmission();
    */
}

float ClosedCube_MAX30205::readT() {
 return readTemperature();
}

float ClosedCube_MAX30205::readTemperature() {
 uint16_t rawT = readData(TEMPERATURE);
 return (rawT * 0.00390625);
}

uint16_t ClosedCube_MAX30205::readData(uint8_t pointer) {
 Wire.beginTransmission(_address);
 Wire.write(pointer);
 Wire.endTransmission();

 delay(10);
 Wire.requestFrom(_address, (uint8_t)2);

 byte msb = Wire.read();
 byte lsb = Wire.read();

 return msb << 8 | lsb;
}

I think it shows 256 is because it only read my msb...but I am not really sure,because I am a novice in this part.

So do any senior have any idea that I can fix this problem?Thank you very much.

I make the MAX30205 PCB by myself and when I MAX30205 to Arduino YUN,also I already use I2C scanner found my I2C.But it only shows"T=256.00C"...

The Yun is a 5V device while the MAX30205 is operated at 3V3. Please post a link to the level converter you use.

Thank you for your reply.

I only use MAX300205 datasheet to make my PCB(in picture 1.jpg).

I saw the Yun had 3V3 socket so I didn't think about level converter. So I can't use MAX30205 connect to Yun's 3V3 socket directly?

I saw the Yun had 3V3 socket so I didn't think about level converter. So I can't use MAX30205 connect to Yun's 3V3 socket directly?

The Yun has a pin that provides 3V3 to devices that need that voltage. It's AVR processor is running on 5V though so all signal pins provide 5V in HIGH state. If you use the Arduino Wire library it activates the internal pull-ups that pull the SDA and SCL lines to 5V. Together with the resistors on your breakout board you may stay below the 4V the datasheet says is the absolute maximum rating. I would choose the safe way and use a level converter or at least modify the Wire library to disable the pull-ups.

According to the posted schematics you can connect the address lines to Vdd by 3 dip switches. The datasheet defines that the address lines must not be unconnected. So the only valid address with your breakout board would be all switches on resulting in 0x4f. As you chose 0x48 I assume you have all switches off. This may work some time but may fail at any time as a floating pin has an undefined state and may be recognized as any of the possible states. That may result in the scanner seeing the chip on address 0x48 but when you switched sketches it listens on 0x4A. As the library doesn't check result codes it will not detect the failure. The value displayed (256.00) equals a read raw value of 65535 which is all bits set, exactly what you get if the chip doesn't answer.

pylon:
The Yun has a pin that provides 3V3 to devices that need that voltage. It's AVR processor is running on 5V though so all signal pins provide 5V in HIGH state. If you use the Arduino Wire library it activates the internal pull-ups that pull the SDA and SCL lines to 5V. Together with the resistors on your breakout board you may stay below the 4V the datasheet says is the absolute maximum rating. I would choose the safe way and use a level converter or at least modify the Wire library to disable the pull-ups.

According to the posted schematics you can connect the address lines to Vdd by 3 dip switches. The datasheet defines that the address lines must not be unconnected. So the only valid address with your breakout board would be all switches on resulting in 0x4f. As you chose 0x48 I assume you have all switches off. This may work some time but may fail at any time as a floating pin has an undefined state and may be recognized as any of the possible states. That may result in the scanner seeing the chip on address 0x48 but when you switched sketches it listens on 0x4A. As the library doesn't check result codes it will not detect the failure. The value displayed (256.00) equals a read raw value of 65535 which is all bits set, exactly what you get if the chip doesn't answer.

I see,now I know my problem.
Thank you very much,pylon.\(^∀^)メ(^∀^)ノ

Hi,

I have the same issue, I am receiving "T=256.00C". Why the address is 0x48 if the datasheet says in table 1 for A0:A2 connected to GND set the address as 0x90h.

Could you please help with this?
Thanks

Why the address is 0x48 if the datasheet says in table 1 for A0:A2 connected to GND set the address as 0x90h.

No, it says "Slave Address Byte", the address byte consists of the slave address and the read/write bit. The higher 7bits are the address, the lowest bit is determining if it's a read or a write.