Si7021 sensor HUMIDITY problem.

Hi, my first post: using Si7021 for a project with 'Adafruit Si7021 library; displays correct humidity but 128.87 for temperature. The same result with Adafruit Si7021 example, when sensors used on Si7021 example they display correct readings for humidity and temperature. My project will not compile if I change library. Please help I am new to Arduino. Thank you.

Please provide your code and schematics

Thank you for responding. Sorry I can't locate the schematic but the sensor is just vin to 3.3v gnd. to gnd. scl to scl and sda to sda. As I said it does not display humidity on the Adafruit Arduino example but does on the Si7021 Arduino example.

#include <VirtualWire.h>
#include <Wire.h>
#include "SPI.h" // Is it really neaded for BMP280 SPI?
#include "Adafruit_Si7021.h"

Adafruit_Si7021 sensor = Adafruit_Si7021();
#include "LowPower.h"

int ledPin = 13;
char Msg[30];// The string that we are going to send trought rf transmitter

void setup()
{
Serial.begin(9600);

sensor.begin();

pinMode(ledPin,OUTPUT); // Set LED at D13 as output

// VirtualWire setup
vw_setup(2000); // Bits per sec for RF
vw_set_tx_pin(12);// Set the Tx pin. Default is 12
}

void loop() {

// si7021 Read and store values
float humidity_float = sensor.readHumidity();
float temp_float = sensor.readTemperature();

// For debugging
Serial.println("VALUES READ:");
Serial.print("Temperature: ");
Serial.print(temp_float);
Serial.println("C");
Serial.print("Humidity: ");
Serial.print(humidity_float);
Serial.println("%");
Serial.println();

// Convert si7021 float values to integers to be send by RF with 2 decimal point precision

temp_float = temp_float * 100; // Multiply by 100 for 2 decimal point precision
int b = int(temp_float); // Math.round in Arduino - Programming Questions - Arduino Forum
int temperature = round(b); // Round float number to nearest integer

humidity_float = humidity_float * 100; // Multiply by 100 for 2 decimal point precision
int a = int(humidity_float); // Math.round in Arduino - Programming Questions - Arduino Forum
int humidity = round(a); // Round float number to nearest integer

// Send message through RF
sprintf(Msg, "%d,%d", humidity,temperature);
// Turn on a light to show transmitting
Serial.println("Read Values OK!");
digitalWrite(ledPin, HIGH);
delay(1000);
vw_send((uint8_t *)Msg, strlen(Msg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(ledPin, LOW); // Turn off a light after transmission

// Lowpower library supports max sleep time of 8s
// use loop as many times as needed to achieve longer sleep
//30 * 8s = 240s
for(int i=0;i<30;i++) // sleep for 4 minutes
{
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); }

}

Sorry, last message should have said temperature not displayed!

Hello Farnworth,
First of all, Please use Code tags while adding your code in the comment box.

Are you using any wireless links to transfer and receive data.? and have you purchased the sensor from official website.? does it have pull-up resistors.?

You need to carefully read this complete official tutorial by Sparkfun if purchased officially on the Si7021 sensor board

Hello again, You really are most kind to respond like this, I really am new to this and at 79 years "teaching old dogs new tricks etc."
I am using wireless links but when these are disconnected it gives the same result. No on purchase, I just bought them on ebay. I am using 10k resistors on sda scl and have tried several different values. I have looked at the link you posted but will give it more attention. What I find so confusing and frustrating is the two Arduino examples One giving correct result but the incorrect temperature reading for the Adafruit. Once more thanks, best regards.

Solved! The sensors though marked Si702 were HTU21D, changed library and working 100%. Thank you for help.