-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actualizando codigo ejemplo de proyecto sensor dth11
- Loading branch information
1 parent
c7535ca
commit d536468
Showing
8 changed files
with
167 additions
and
66 deletions.
There are no files selected for viewing
21 changes: 0 additions & 21 deletions
21
...11/arduino /Modulo_DTH11_Integrado_dentro_de_PCB/Modulo_DTH11_Integrado_dentro_de_PCB.ino
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
...dulo_DTH11_Integrado_dentro_de_PCB_ESP32s/Modulo_DTH11_Integrado_dentro_de_PCB_ESP32s.ino
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...lo_DTH11_Integrado_dentro_de_PCB_ESP8266/Modulo_DTH11_Integrado_dentro_de_PCB_ESP8266.ino
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
series/arduino/modulos/10_DHT11/arduino/Demo01_DTH11_PCB/Demo01_DTH11_PCB.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "DHT.h" | ||
#define PinSensor 2 | ||
#define Tipo DHT11 // Tipo de sensor Opciones DHT11, DHT22, DHT21 | ||
// DHT11 - Temperatura 0 a 50 c +- 2c Humedad 20 a 90% +- 4% | ||
// DTH22 - Temperatura -40 a 80 c +- 0.5c Humedad 0 a 100% +- 2% | ||
|
||
DHT dht(PinSensor, Tipo); | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
dht.begin(); | ||
} | ||
|
||
void loop() { | ||
delay(5000); // Mínimo 2000 | ||
float humedad = dht.readHumidity(); | ||
float temperatura = dht.readTemperature(); | ||
Serial.print("Humedad: "); | ||
Serial.print(humedad); | ||
Serial.println(" %"); | ||
Serial.print("Temperatura: "); | ||
Serial.print(temperatura); | ||
Serial.println(" *C"); | ||
} |
24 changes: 24 additions & 0 deletions
24
series/arduino/modulos/10_DHT11/arduino/Demo02_DTH11_PCB_ESP32/Demo02_DTH11_PCB_ESP32.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "DHT.h" | ||
#define PinSensor 4 | ||
#define Tipo DHT11 // Tipo de sensor Opciones DHT11, DHT22, DHT21 | ||
// DHT11 - Temperatura 0 a 50 c +- 2c Humedad 20 a 90% +- 4% | ||
// DTH22 - Temperatura -40 a 80 c +- 0.5c Humedad 0 a 100% +- 2% | ||
|
||
DHT dht(PinSensor, Tipo); | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
dht.begin(); | ||
} | ||
|
||
void loop() { | ||
delay(5000); // Mínimo 2000 | ||
float humedad = dht.readHumidity(); | ||
float temperatura = dht.readTemperature(); | ||
Serial.print("Humedad: "); | ||
Serial.print(humedad); | ||
Serial.println(" %"); | ||
Serial.print("Temperatura: "); | ||
Serial.print(temperatura); | ||
Serial.println(" *C"); | ||
} |
24 changes: 24 additions & 0 deletions
24
...es/arduino/modulos/10_DHT11/arduino/Demo03_DTH11_PCB_ESP8266/Demo03_DTH11_PCB_ESP8266.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "DHT.h" | ||
#define PinSensor 4 | ||
#define Tipo DHT11 // Tipo de sensor Opciones DHT11, DHT22, DHT21 | ||
// DHT11 - Temperatura 0 a 50 c +- 2c Humedad 20 a 90% +- 4% | ||
// DTH22 - Temperatura -40 a 80 c +- 0.5c Humedad 0 a 100% +- 2% | ||
|
||
DHT dht(PinSensor, Tipo); | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
dht.begin(); | ||
} | ||
|
||
void loop() { | ||
delay(5000); // Mínimo 2000 | ||
float humedad = dht.readHumidity(); | ||
float temperatura = dht.readTemperature(); | ||
Serial.print("Humedad: "); | ||
Serial.print(humedad); | ||
Serial.println(" %"); | ||
Serial.print("Temperatura: "); | ||
Serial.print(temperatura); | ||
Serial.println(" *C"); | ||
} |
60 changes: 60 additions & 0 deletions
60
series/arduino/modulos/10_DHT11/arduino/Demo04_DTH11_PCB/Demo04_DTH11_PCB.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#include <Adafruit_Sensor.h> | ||
#include <DHT.h> | ||
#include <DHT_U.h> | ||
|
||
#define PinSensor 2 | ||
#define Tipo DHT11 // Tipo de sensor Opciones DHT11, DHT22, DHT21 | ||
// DHT11 - Temperatura 0 a 50 c +- 2c Humedad 20 a 90% +- 4% | ||
// DTH22 - Temperatura -40 a 80 c +- 0.5c Humedad 0 a 100% +- 2% | ||
|
||
DHT_Unified dht(PinSensor, Tipo); | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
dht.begin(); | ||
|
||
Serial.println(F("Informacion del sensor DHTxx ")); | ||
|
||
sensor_t sensor; | ||
dht.temperature().getSensor(&sensor); | ||
Serial.println("------------------------------------"); | ||
Serial.println("Sensor Temperatura"); | ||
Serial.print("Tipo Sensor: "); | ||
Serial.println(sensor.name); | ||
Serial.print("Vercion: "); | ||
Serial.println(sensor.version); | ||
Serial.print("ID : "); | ||
Serial.println(sensor.sensor_id); | ||
Serial.print("Valor Maximo: "); | ||
Serial.print(sensor.max_value); | ||
Serial.println("°C"); | ||
Serial.print("Valor Minimo: "); | ||
Serial.print(sensor.min_value); | ||
Serial.println("°C"); | ||
Serial.print("Resolucion: "); | ||
Serial.print(sensor.resolution); | ||
Serial.println("°C"); | ||
Serial.println("------------------------------------"); | ||
dht.humidity().getSensor(&sensor); | ||
Serial.println("Sensor Humdad;"); | ||
Serial.print("Tipo Sensor: "); | ||
Serial.println(sensor.name); | ||
Serial.print("Vercion: "); | ||
Serial.println(sensor.version); | ||
Serial.print("ID : "); | ||
Serial.println(sensor.sensor_id); | ||
Serial.print("Valor Maximo: "); | ||
Serial.print(sensor.max_value); | ||
Serial.println(F("%")); | ||
Serial.print("Valor Minimo: "); | ||
Serial.print(sensor.min_value); | ||
Serial.println(F("%")); | ||
Serial.print("Resolucion: "); | ||
Serial.print(sensor.resolution); | ||
Serial.println(F("%")); | ||
Serial.println(F("------------------------------------")); | ||
} | ||
|
||
void loop() { | ||
delay(5000); | ||
} |
35 changes: 35 additions & 0 deletions
35
series/arduino/modulos/10_DHT11/arduino/Demo05_DTH11_PCB/Demo05_DTH11_PCB.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "DHT.h" | ||
#define PinSensor 2 | ||
#define Tipo DHT11 // Tipo de sensor Opciones DHT11, DHT22, DHT21 | ||
// DHT11 - Temperatura 0 a 50 c +- 2c Humedad 20 a 90% +- 4% | ||
// DTH22 - Temperatura -40 a 80 c +- 0.5c Humedad 0 a 100% +- 2% | ||
|
||
DHT dht(PinSensor, Tipo); | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
dht.begin(); | ||
} | ||
|
||
void loop() { | ||
delay(5000); // Mínimo 2000 | ||
float humedad = dht.readHumidity(); | ||
float temperatura = dht.readTemperature(); | ||
|
||
if (isnan(temperatura) || isnan(humedad)) { | ||
Serial.println("Error leyendo el sensor DHT"); | ||
return; | ||
} | ||
|
||
float sensacionTermica = dht.computeHeatIndex(temperatura, humedad, false); | ||
|
||
Serial.print("Humedad: "); | ||
Serial.print(humedad); | ||
Serial.println(" %"); | ||
Serial.print("Temperatura: "); | ||
Serial.print(temperatura); | ||
Serial.println(" *C"); | ||
Serial.print("Sensacion Termica: "); | ||
Serial.print(sensacionTermica); | ||
Serial.println(" *C"); | ||
} |