SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By adammhaile
#199616
I seem to have the worst luck with temp/humidity sensors... I'm using the Si7021 breakout hooked up to a Particle Photon with the code below:
Code: Select all
#include "SparkFun_Si7021_Breakout_Library.h"

float humidity = 0;
float tempf = 0;

Weather sensor;

void setup() {
    sensor.begin();
    sensor.heaterOff();
    // sensor.changeResolution(0b10000001);
}

int c = 0;
void loop() {
    humidity = sensor.getRH();
    tempf = sensor.getTempF();
    Particle.publish("garage-temp", String(tempf));
    Particle.publish("garage-humidity", String(humidity));
    
    delay(20000);
}
At first I though it was just that it was inaccurate as the ambient temp is 77F and it was returning 84F. But then I just had the idea to check it with my IR thermometer and, sure enough, when holding it right over the sensor, it reads 84F. But the desk surface around it is 77F.
Note, as you can see I turned the heater off. I've tried with it on which does in fact increase the temp. (What is the heater even for??) And I've also tested introducing it to various heat/cold sources and it tracks but then is always above ambient. (Ambient checked by 3 different model digital home temp sensors I found around my house).

So... what's going on here? I don't think I have it hooked up wrong or anything. The sensor itself is about an inch or so away from the photon so there shouldn't be any huge issues with heat coming off the wifi chipset.

Thoughts?