Wemos D1 mini & Wemos DHT shield


Hello, I try to setup my Wemos D1 mini with a Wemos DHT shield (temp/hum). Is there a sample project with these components? I am a little bit lost with all that different libraries for all that different sensors.

It get it working with Wemos D1 mini and a DS18B20, at least.



first connect your wemos using this Adding a New Device using MQTT
and for DSB18B20 Converting Cayenne Arduino LIbrary sketches to Cayenne MQTT Arduino


Thank you.
But that is already working. Withe the DSB18B20.

I don’t get it working with the Wemos DHT shield.


can you post the code.


This works for the DSB18B20.
But how can I address the DHT12 shield?
I have to include the #include <WEMOS_DHT12.h> library.
But I don’t now how to read the values and send it to cayenne.

#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS D4

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

// WiFi network info.
char ssid[] = “";
char wifiPassword[] = "

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = “*";
char password[] = "
char clientID[] = “***********”;

unsigned long lastMillis = 0;

void setup() {
Cayenne.begin(username, password, clientID, ssid, wifiPassword);


void loop() {

// Default function for sending sensor data at intervals to Cayenne.
// You can also use functions for specific channels, e.g CAYENNE_OUT(1) for sending channel 1 data.
// Write data to Cayenne here. This example just sends the current uptime in milliseconds on virtual channel 0.
//Cayenne.virtualWrite(0, millis());
// Some examples of other functions you can use to send data.
Cayenne.celsiusWrite(1, sensors.getTempCByIndex(0));
//Cayenne.luxWrite(2, 700);
//Cayenne.virtualWrite(3, 50, TYPE_PROXIMITY, UNIT_CENTIMETER);

// Default function for processing actuator commands from the Cayenne Dashboard.
// You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_LOG(“Channel %u, value %s”, request.channel, getValue.asString());
//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError(“Error message”);


Hello, any ideas?


i have not worked with this shield and if you have any documentation about it we can try to solve the problem.


If you have the time, it would be cool to have a look here:


Are you able to get reading from the shield?


No. Sorry.
I tried a more easy setup.
Raspberry Pi 3 and the shield, but I don’t get it running.


try with wemos. it should work.


Hello Shramik, I used the WEMOS sketch and it works. I can read the values in the serial output.

#include <WEMOS_DHT12.h>

DHT12 dht12;

void setup() {



void loop() {

Serial.print("Temperature in Celsius : ");
Serial.print("Temperature in Fahrenheit : ");
Serial.print("Relative Humidity : ");


But how can I pass the variables to Cayenne?



I used this:

Cayenne.celsiusWrite(1, dht12.cTemp);
Cayenne.virtualWrite(2, dht12.fTemp);
Cayenne.virtualWrite(3, dht12.humidity);

and it is working!

Thank you.