Seeed-Studio / Grove_Temper_Humidity

Grove_Temper_Humidity based on TH02 & TH06
MIT License
9 stars 13 forks source link

SEnsor data stuck in T = 24 and H=50 #11

Closed xperateur closed 3 weeks ago

xperateur commented 1 year ago

Hello,

first of all I'm new in coding and in IOT stuff, sorry if ii do'nt use the right synthaxe.

I have an issue with this Sketch:

Arduino : 2.1.0 ( windows 10), Board : " Arduino MKR WIFI 1010"

here is the full sketch ( i use the exemple TH02_demo)

#include <TH02_dev.h>
#include "Arduino.h"
#include "Wire.h"
#include "THSensor_base.h"

#define ShowSerial Serial
#ifdef __AVR__
    #include <SoftwareSerial.h>
    SoftwareSerial SSerial(2, 3); // RX, TX
    #define COMSerial Serial
    #define ShowSerial Serial
    TH02_dev TH02;
#endif

#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
    #define COMSerial Serial1
    #define ShowSerial SerialUSB
    TH02_dev TH02;
#endif

#ifdef ARDUINO_ARCH_STM32F4
    #define COMSerial Serial
    #define ShowSerial SerialUSB
    TH02_dev TH02;
#endif

void setup() {
    ShowSerial.begin(9600);        // start serial for output

    ShowSerial.println("****TH02_dev demo by seeed studio****\n");
    /* Power up,delay 150ms,until voltage is stable */
    delay(150);
    /* Reset HP20x_dev */
    TH02.begin();
    delay(100);

    /* Determine TH02_dev is available or not */
    ShowSerial.println("TH02_dev is available.\n");
}

void loop() {
    float temper = TH02.ReadTemperature();
    ShowSerial.print("Temperature: ");
    ShowSerial.print(temper);
    ShowSerial.println("C\r\n");
    //Serial.print("%\t");

    float humidity = TH02.ReadHumidity();
    ShowSerial.print("Humidity: ");
    ShowSerial.print(humidity);
    ShowSerial.println("%\r\n");
    delay(1000);
}

my issue is : i always have the sames results, humidity = 24% ans Température = 50°C

and i still have there result if i unplug my sensor :/

I have try other code the results are the same.

For plug my sensor i have follow the documentation and connect

black --> GND RED--> 5V white--> SDA YEllow --> SCL

Thank in advance,

Lesords commented 1 month ago

Hello,

I'm very sorry to have kept you waiting so long.

Do you still have this problem now?

Lesords commented 3 weeks ago

Hello,

I\'m going to close this issue, feel free to re-open it if you have any other questions.

[Autocommentary]