BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Help with pin settings

#25

Yes but they had a R1 that didn’t last long and then an R2. Pins are slightly different on a R1 to an R2 and I don’t know how you know which one it is by looking at it.

How long have you had it? Did you buy it from WeMos?

R1 disappeared a “long” time ago.

0 Likes

#26

This is a genuine D1 R2 so you either have a knock off or the R1.

https://www.wemos.cc/product/d1.html

0 Likes

#27

Yours is a D1 R1 from this picture.

You should select “WeMos D1 (retired)” from the ESP8266 boards list.

0 Likes

#28

LINK i found the link where i bought it from its from its a ESP-12E WeMos D1 WiFi uno based ESP8266 i think i can just use the wemos d1 right? so how do i plug in the moisture sensor?

0 Likes

#29

Your knock off (R1 / R2) looks to be about 3 times the price of the genuine R2.

Let me just check to see if I can establish if yours is R1 or R2.

0 Likes

#30

I would say yours is the retired version from looking at all the pictures.

0 Likes

#31

soo how do i connect the humidity sensor and moisture sensor to the esp?

0 Likes

#32

The humidity sensor (and temperature btw) can be connected to any digital pin. Use the DHT library (available in Arduino via Library management I think) to read it.

edit- that is the data pin ofcourse … + and gnd need to go on there :slight_smile:

0 Likes

#33

Let’s deal with the digital humidity sensor first.

It’s your lucky day, there is a full sketch available for the DHT11 and Blynk at https://github.com/blynkkk/blynk-library/blob/master/examples/More/DHT11/DHT11.ino but it needs converting from an Ethernet connection to an ESP connection.

Connect data pin to pin 2 as that is what is used in the sketch.

Set up a project, get a token, add a couple of value displays on V5 and V6 as per the sketch.

I’ll send you the ESP connection version for the DHT11 shortly.

0 Likes

#34

@UtaMask if you have the WeMos set up correctly and all the libraries correctly installed including DHT.h then this should compile for you. Enter yout token, SSID and pwd in lines 39 to 41.

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example shows how value can be pushed from Arduino to
 * the Blynk App.
 *
 * WARNING :
 * For this example you'll need SimpleTimer library:
 *   https://github.com/jfturcot/SimpleTimer
 * and Adafruit DHT sensor library:
 *   https://github.com/adafruit/DHT-sensor-library
 *
 * App project setup:
 *   Value Display widget attached to V5
 *   Value Display widget attached to V6
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <DHT.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

#define DHTPIN 2          // What digital pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11     // DHT 11
//#define DHTTYPE DHT22   // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21   // DHT 21, AM2301

DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
}

void setup()
{
  Serial.begin(115200); // See the connection status in Serial Monitor
  Blynk.begin(auth, ssid, pass);
  while (Blynk.connect() == false) {      
    // Wait until connected              
  }      
  dht.begin();
  // Setup a function to be called every second
  timer.setInterval(1000L, sendSensor);
}

void loop()
{
  Blynk.run(); // Initiates Blynk
  timer.run(); // Initiates SimpleTimer
}
0 Likes

#35

Just be careful with the pin numbering.

The 2 that is referred to in the sketch is GPIO 2 for the ESP and NOT D2 on your board.

This is the pinout for the R2 and you should try to find a pinout for the R1.
https://www.wemos.cc/product/d1.html

Based on the R2 GPIO 2 is D4 on the WeMos. So the data pin of the DHT11 would be connected to D4.

0 Likes

#36

WeMos removed all reference to R1’s so getting the pinout is not so easy but based on this image from http://www.esp8266.com/viewtopic.php?f=32&t=7344&start=4

then GPIO 2 is D9 on your board.

It might be better to change the 2 in the sketch to 4 as this ties to GPIO4 AND D4, plus it doesn’t have the 10K pullup on the pin.

Let us know how you get on.

0 Likes

#37

@jamin tried your link again today and got:

Access Denied

You don’t have permission to access “http://www.banggood.com/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html” on this server.
Reference #18.95451502.1476437721.1b10a45a

Entering the url a second time was fine.

0 Likes

#38

can i just have a way to put the pins in the arduino i mean the humidity sensor because iam having a hard time using it and it looks complex i just tried using the led with blynk and iam amazed asf

0 Likes

#39

i dont get this part and also the sensor only has a + out - and i dont know what that means iam super confused its my first time doing these stuff T_T

0 Likes

#40

Arduino: 1.6.12 (Windows 8.1), Board: “WeMos D1(Retired), 80 MHz, 921600, 4M (3M SPIFFS)”

\sketch_oct14a\sketch_oct14a.ino:35:17: fatal error: DHT.h: No such file or directory

#include <DHT.h>

             ^

compilation terminated.

Multiple libraries were found for “BlynkSimpleEsp8266.h”
Used: C:\Users\Documents\Arduino\libraries\Blynk
Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
Not used: C:\Program Files (x86)\Arduino\libraries\Blynk
exit status 1
Error compiling for board WeMos D1(Retired).

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

0 Likes

#41

also got that error

0 Likes

#42

from the wemos when uploading

0 Likes

#43

The image at the link you provided clearly shows 3 pins for the DHT11 with the -ve on the right in the picture.

This image looks like yours and shows +ve is center pin and left is data (Signal) pin.

0 Likes

#44

You haven’t installed the DHT library or if you have, not correctly.

0 Likes