hola muy buenas tardes desde argentina, soy muy reciente en el foro y necesito un pequeño empujón, estuve leyendo las normas del foro por lo que espero no equivocarme, pero ante cualquier error por favor avisarme así lo corrijo de ser posible.
bueno la pregunta en cuestión es que camino debo seguir para poder sacar el promedio entre múltiples sensores "DHT11" así tener una lectura mas precisa del ambiente. a través de lo que leí en la red no entendí bien como usar la formula también vi en la galería de librerías de mi arduino ide 1.6.11 BasiclinearAlgebra con unas funciones muy copadas para llevar esto acabo, pero la verdad que el ingles me cuesta, uso el traductor de google pero a veces necesita el toque humano una traducción para que adquiera una coherencia por lo cual no lo comprendí.
la lectura del sensor no me fue problema . Uso una librería "adafruit DHT unified"
ahora estoy integrando la librería "timealarmars" para correr el código y un "reloj ds1307".
el código que dejo a continuación es un un simple ejemplo de como quiero que me lea los sensores.
hello good afternoon from Argentina, I am very new in the forum and I need a little push,
I was reading the forum rules so I hope I'm not wrong, but for any errors
please let me know so I correct if possible.
good in question is the question that way I ought to take the average of multiple
sensors "DHT11" and have a more accurate reading of ambientea through what I read on the net was not
I understood how to use the formula
I also saw in the gallery of my arduino ide libraries 1.6.11 BasiclinearAlgebra with some functions
very copadas to carry this over, but the fact that the English costs me, I use google translator
but sometimes needs the human touch to acquire a translation consistency so
I did not understand
the sensor reading was not me problem. Use a library "adafruit DHT unified"
I am now integrating the library "timealarmars" to run the code and a "clock ds1307".
I leave the code below is a simple example of how I want you to read the sensors.
////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#include <TimeAlarms.h>
#include <TimeLib.h>
#include <Wire.h>
#include <DS1307RTC.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 5
#define DHTTYPE DHT11
DHT_Unified dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
while (!Serial) ;
setSyncProvider(RTC.get);
dht.begin();
Serial.println("DHTxx Unified Sensor Example");
sensor_t sensor;
dht.temperature().getSensor(&sensor);
Serial.println("------------------------------------");
Serial.println("Temperature");
Serial.print ("Sensor: "); Serial.println(sensor.name);
Serial.print ("Driver Ver: "); Serial.println(sensor.version);
Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id);
Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" *C");
Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" *C");
Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" *C");
Serial.println("------------------------------------");
dht.humidity().getSensor(&sensor);
Serial.println("------------------------------------");
Serial.println("Humidity");
Serial.print ("Sensor: "); Serial.println(sensor.name);
Serial.print ("Driver Ver: "); Serial.println(sensor.version);
Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id);
Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println("%");
Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println("%");
Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println("%");
Serial.println("------------------------------------");
Alarm.timerRepeat(15, Repeats);
}
void loop() {
digitalClockDisplay();
Alarm.delay(60000);
}
void Repeats() {
sensors_event_t event;
dht.temperature().getEvent(&event);
if (isnan(event.temperature)) {
Serial.println("Error reading temperature!");
}
else {
Serial.print("Temperature: ");
Serial.print(event.temperature);
Serial.println(" *C");
}
dht.humidity().getEvent(&event);
if (isnan(event.relative_humidity)) {
Serial.println("Error reading humidity!");
}
else {
Serial.print("Humidity: ");
Serial.print(event.relative_humidity);
Serial.println("%");
}
}
void digitalClockDisplay() {
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");
Serial.print(day());
Serial.print(" ");
Serial.print(month());
Serial.print(" ");
Serial.print(year());
Serial.println();
}
void printDigits(int digits) {
Serial.print(":");
if (digits < 10)
Serial.print('0');
Serial.print(digits);
}
bueno por si no me explique bien ¡que debo hacer si agrego mas sensores como voy a sacarles el promedio?
explicado con otras palabras quiero que cada 15 segundos lea dos sensores dht11 correspondientes a un mismo ambiente he imprima en el serial monitor el promedio de temperatura y humedad. lo mismo para otros dos sensores de otro ambiente.
desde ya muchas gracias
good if I do not explain good¡ should I do if I add more sensors as I will extract the average?
explained in other words I want every 15 seconds DHT11 read two corresponding sensors to the same environment I've printed on the serial monitor the average temperature and humidity. the same for two other environment sensors.
From already thank you very much