Things used in this project

Hardware components:
Esp01
Everything ESP ESP8266 ESP-01
×1
10167 01
DHT22 Temperature Sensor
×1
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
Usb%20serial%20debug%20module
UDOO USB / Serial Debug Module
×1
A000066 iso both
Arduino UNO & Genuino UNO
×1

Schematics

DHT22_ESP8266 scheme
Wifidht22

Code

temphumwifi.inoArduino
#include <ThingSpeak.h>

/* DEVELOPER: hernando Bolanos - Colaborations - original code and libraries for wifi modules and code uploaded in GITHUB for send information to Thinhspeak-Libraries according to each author
 *  
 *  This code send to  Thingspeak DHT22 data each 20 seconds -using wifi 
 *  This program do not use arduino just use the GPIO2 to receive DHT22 sensor information and demux it. How to load directly to de esp8266 from arduino IDE is a chellenge- take a look to the "el profe garcia videos on youtube"
 */
#include <DHT.h> //cargamos la librera DHT
#define DHTPIN 2 //Seleccionamos el pin en el que se conectar el sensor
#define DHTTYPE DHT22 //Se selecciona el DHT22(hay otros DHT)
DHT dht(DHTPIN, DHTTYPE); //Se inicia una variable que ser usada por Arduino para comunicarse con el sensor
#include <ESP8266WiFi.h>

unsigned long myChannelNumber = 167319;
const char * myWriteAPIKey = "XXXP9V86RWR7R9Y";

const char* ssid = "XXXX ";
const char* password = "XXXX";

 WiFiClient  client;
// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);

void setup() {
  Serial.begin(115200);
  delay(10);
   dht.begin(); //Se inicia el sensor

 

 
  
  
  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");  
  
  // Start the server
 // server.begin();
 // Serial.println("Server started");
   
 

  // Print the IP address
  Serial.println(WiFi.localIP());

ThingSpeak.begin(client);
   
}

void loop() {

float h = dht.readHumidity(); //Se lee la humedad
  float t = dht.readTemperature(); //Se lee la temperatura
  //Se imprimen las variables
  Serial.println("Humedad: "); 
  Serial.println(h);
  Serial.println("Temperatura: ");
  Serial.println(t);
  delay(2000); //Se espera 2 segundos para seguir leyendo //datos
 

ThingSpeak.writeField(myChannelNumber, 1, h, myWriteAPIKey);
  delay(20000); 
  

ThingSpeak.writeField(myChannelNumber, 2, t, myWriteAPIKey);
  delay(20000); 
  
  


 
   }
 
    
  
  
 

Credits

Thanks to "el profe garcia" colombian youtuber and thingspeak .

Replications

Did you replicate this project? Share it!

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Offline Speech Processing
Intermediate
  • 2,235
  • 17

Protip

Create your very own hotwords like "Alexa," "Ok Google" and "Hey Cortana," and trigger events just by speaking... without the Internet.

A powerful Maritime Instrument & Display Controller
Intermediate
  • 9,662
  • 55

Work in progress

A powerful Maritime Instrument & Display Controller, based on UDOO Neo, acting as a navigator, chart plotter, wireless NMEA multiplexer & ?

UDOO Ubuntu LTS Guide
Intermediate
  • 1,147
  • 23

Full instructions

Building a Ubuntu LTS configuration for the UDOO Quad

myva-Home (Voice controlled home automation)
Intermediate
  • 3,733
  • 40

Full instructions

My Voice Activated/Controlled Home, Using the Linkit Smart and an Android with easy to use examples and libraries

UDOO Neo Automated Hematoogy Laboratory Tubes Unscramble
Intermediate
  • 1,343
  • 11

Full instructions

A device that reads a bar code placed on the tube and, based on it, moving two step motors to place the tube in the correct position.

Home Energy Monitor
Intermediate
  • 2,303
  • 12

A low cost, high performance energy meter for my home.

Add projectSign up / Login