primera aproximacion al juego de sensores, mas punto de rocio

leyendo en el sensor de temperatura SEN118A2B,

y escribiendo el estado en la pantalla LCD.

calcular el punto de rocio es relativamente sencillo.

con un transformador que saca 1A bajamos la temperatura de la zona fria desde 27 a 19 grados, con un ventilador y un disipador de CPU pequeño. Sin disipador el lado caliente sube hasta 70 grados, por lo menos. Sin disipador, la zona fria apenas baja 2 grados: el calor de la zona caliente se desborda. Es imprescindible ventilar, refrigerar la zona caliente.

el sketch que controla sensor y pantalla es:

// LCD
#include <Wire.h>
#include <MatrixOrbitali2c.h>
#include <stdlib.h>
MatrixOrbitali2c lcd(0x2B);

// sensor de temperatura
#include <math.h>
#define ThermistorPIN 0  // Analog Pin 0
float vcc = 4.91; 
float pad = 46000; 
float thermr = 10000; 
float Thermistor(int RawADC) {
  long Resistance;  
  float Temp;  // Dual-Purpose variable to save space.
  Resistance=((1024 * pad / RawADC) - pad); 
  Temp = log(Resistance); 
  Temp = 1 / (0.001129148 + (0.000234125 * Temp) + 
         (0.0000000876741 * Temp * Temp * Temp));
  Temp = Temp - 273.15;  // Convert Kelvin to Celsius                      
  return Temp;    // Devolver temperatura
}

// sensor de humedad y temperatura
#include <DHT.h>
#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT11   // DHT 11
DHT dht(DHTPIN, DHTTYPE);
float tF;
float dP;
float dPF;

void setup() {
  Serial.begin(9600);
  lcd.begin(4,20);
  dht.begin();
}

void loop() {

  float h = dht.readHumidity();
  float t = dht.readTemperature();
  if (isnan(t) || isnan(h)) {
//    Serial.println("Failed to read from DHT");
  } else {
//    Serial.print("Humidity: ");
//    Serial.print(h);
//    Serial.print(" %\t");
//    Serial.print("Temperature: ");
//     Serial.print(t);
//     Serial.print(" *C ");
    tF=((t*9)/5)+32;
//    Serial.print(tF);
//    Serial.print(" *F ");
//    Serial.print(" \t"); 
//    Serial.print("Dew Point: ");
//    Serial.print(dewPointFast(t, h));
//    Serial.print(" *C ");
  dP=(dewPointFast(t, h));
  dPF=((dP*9)/5)+32;
//  Serial.print(dPF);
//  Serial.print(" *F");
//  Serial.print(" \t");
//  Serial.print("Heat Index: ");
//  Serial.print(heatIndex(tF,h));
//  Serial.println(" *F");
  }  
  float temp;
  float celsius;
  celsius = Thermistor(analogRead(ThermistorPIN)); 
//  Serial.print("Celsius: "); 
//  Serial.print(celsius,1);  // display Celsius        
//  Serial.println("LCD Clear");
  lcd.clear();
//  Serial.println("Hello World");
  lcd.print("Temp sonda: ");
  lcd.print(celsius);
  lcd.print("\n");
  lcd.print("Temp aire: ");
  lcd.print(t);
  lcd.print("\n");
  lcd.print("Hum aire: ");
  lcd.print(h);
  lcd.print("\n");
  lcd.print("DewPoint: ");
  lcd.print(dewPointFast(t, h));
  lcd.print("\n");
  delay(1000);
}

// delta max = 0.6544 wrt dewPoint()
// 6.9 x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
 double a = 17.271;
 double b = 237.7;
 double temp = (a * celsius) / (b + celsius) + log(humidity*0.01);
 double Td = (b * temp) / (a - temp);
 return Td;
}
double heatIndex(double tempF, double humidity)
{
  double c1 = -42.38, c2 = 2.049, c3 = 10.14, c4 = -0.2248, c5= -6.838e-3, c6=-5.482e-2, c7=1.228e-3, c8=8.528e-4, c9=-1.99e-6  ;
  double T = tempF;
  double R = humidity;
  double A = (( c5 * T) + c2) * T + c1;
  double B = ((c7 * T) + c4) * T + c3;
  double C = ((c9 * T) + c8) * T + c6;
  double rv = (C * R + B) * R + A;
  return rv;
}