-->
Page 1 of 1

ESP8266/NodeMCU, Arduino IDE & SHT71 temp&humid sensor ...

PostPosted: Thu Feb 02, 2017 2:54 pm
by gad
Hi
I just got my NodeMCU and tried to get an Arduino sketch i have to run on it
Im using SHT71 temperature & humidity sensor that is working fine on my Arduino Pro mini (Leonardo)

I'm using same pin layout and get all zeros in NudeMCU

any ideas ?


this is the code, simple from their example

#include <Sensirion.h>
// library from https://github.com/spease/Sensirion

const uint8_t dataPin = 4;
const uint8_t clockPin = 5;

float temperature;
float humidity;
float dewpoint;

Sensirion tempSensor = Sensirion(dataPin, clockPin);

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

void loop()
{
tempSensor.measure(&temperature, &humidity, &dewpoint);
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" C, Humidity: ");
Serial.println(humidity);
// Serial.print(" %, Dewpoint: ");
// Serial.print(dewpoint);
// Serial.println(" C");
delay(2000);
}

Thanks,

Re: ESP8266/NodeMCU, Arduino IDE & SHT71 temp&humid sensor .

PostPosted: Fri Feb 03, 2017 12:32 am
by gdsports
See the section on pin mapping that applies to NodeMCU boards 0.9 and 1.0.

http://esp8266.github.io/Arduino/versio ... odemcu-0-9

Re: ESP8266/NodeMCU, Arduino IDE & SHT71 temp&humid sensor .

PostPosted: Fri Feb 03, 2017 1:37 am
by gad
Thamks for the suggestion, already seen this mapping and confirmed the pins im using with Blink sketch

gdsports wrote:See the section on pin mapping that applies to NodeMCU boards 0.9 and 1.0.

http://esp8266.github.io/Arduino/versio ... odemcu-0-9



any other idea ?

Re: ESP8266/NodeMCU, Arduino IDE & SHT71 temp&humid sensor .

PostPosted: Fri Feb 03, 2017 2:13 am
by gad
Oh, stupid me... I see now, I tried calling them with the PIN number.. changed it to D1/D2 and it didnt work there so I moved to D3/D4 PINs and it work there (not sure with the others did not ..)

//const uint8_t dataPin = 4;
//const uint8_t clockPin = 5;

Sensirion tempSensor = Sensirion(D3, D4);

Thanks ! :)

gdsports wrote:See the section on pin mapping that applies to NodeMCU boards 0.9 and 1.0.

http://esp8266.github.io/Arduino/versio ... odemcu-0-9