I have tried quite a lot of stuff to configure MAX30205 which is attached with my Artemis nano board via QWIIC connector, But couldn’t make the sensor work.
All physical connections are fine, I2C address is properly working, (tested if i put wrong address(0x48 working one), or remove any of the four I2C wire from sensor end it gives “error reading sensor”)
I have tried ProtoCentral libs and other libs but no luck.
It is giving my negative values
”
20:49:38.326 -> -38.39'c
20:49:38.452 -> -38.38'c
”
Anybody has any solution or any secret configuration I am missing.
When you remove one of the wires you get what is expected. They put 4 wires there because that is what is needed. SCL is the clock, SDA is the return data, Ground is the common reference point and of course it does not harvest energy from the air so the + powers it. Now looking at the schematic you forgot to post and comparing it to the non posted code you are using I have determined I cannot figure out your problem either. Keep guessing you may get lucky.
This is a 3V3 logic board. The docs in the ProtoCentral library says their breakout board default is 5V and need a solder jumper change to work on 3V3. It’s a guess, but as already said, that’s all we can do without code and schematics…
If bit 5 of the configuration register is set, the "extended" temperature range is enabled, which uses the sign bit. In that case the library code might make a conversion error.
After reading the "How to get the best out of this forum" post (linked at the head of every forum category), post the required information.
#include <Wire.h>
#include "Protocentral_MAX30205.h"
MAX30205 tempSensor;
void setup() {
Serial.begin(9600);
Wire.begin();
//scan for temperature in every 30 sec untill a sensor is found. Scan for both addresses 0x48 and 0x49
while(!tempSensor.scanAvailableSensors()){
Serial.println("Couldn't find the temperature sensor, please connect the sensor." );
delay(30000);
}
Serial.print("sensorAddress is:");
Serial.println(tempSensor.sensorAddress);
tempSensor.begin(); // set continuos mode, active mode
delay(100);
}
void loop() {
float temp = tempSensor.getTemperature(); // read temperature for every 100ms
Serial.print(temp ,2);
Serial.println("'c" );
delay(100);
}
It works but with a twist.
I am forced to use extended mode D5=1. And according to spec you have to add 64’c with the temperature value. Which somehow is giving me the accurate results.
This problem has not been solved, it's just been worked around with the above mentioned "use extended mode and add 64.0 to the intermediate result".
What the datasheet does not say is that in normal data format mode the high order two bits are set but should be ignored. If after creating the 16 bit integer you mask the high order two bits when in normal mode with something like "raw = raw & 0x3fff" then cast to float and multiply the remaining value by 0.00390625 you will see the correct temperature. I'll see if I can get a message to Analog Devices requesting an update to their datasheet. In my opinion they don't have any defense for setting these two high bits in normal data format mode, but I expect them to tell me something like "Well we say in normal mode the range is 0 to 50C, so neither the sign bit nor the next bit signifying 64C can have any meaning!" So I'll beg for them to be merciful. :-)