Cómo Usar Módulo Temperatura en Arduino

Hola aquí les dejo el código que he hecho para hacer funcionar el módulo de Arduino con la temperatura:

    int Sensor = 0 ; // Prog_15_1
     int umbral = 25 ;
   
     void setup()
        {
            Serial.begin(9600);
            pinMode(11,OUTPUT);
        }
     void loop()
       {
            int lectura = analogRead(Sensor);
            float voltaje = 5.0 /1024 * lectura ; // Atencion aqui
             float temp = voltaje * 100;// ; para el LM35DZ
           // float temp = voltaje * 100 -50 ; Serial.println(temp) ;
         
           Serial.print(«On this room have temp of «);
           Serial.print(temp);
           Serial.print(«º n»);
            if (temp >= umbral)
                digitalWrite(11, HIGH) ;
            else digitalWrite(11,LOW);
                delay(1000);

}

Esto está basado en el tutorial de la página:

https://www.prometec.net/sensor-tmp36/

Gracias por visitar mi blog de informática, mi nombre es Tomás y soy formador y desarrollador web. Si quiere usted dejarme alguna sugerencia, ayuda o quiere un servicio de formación estoy escuchando ofertas en tomas.gonzalez@infogonzalez.com, en Facebook a https://www.facebook.com/Infogonzalez estoy deseando escucharle. Su duda o sugerencia NO molesta.

Tomas Gonzalez
Este sitio web utiliza cookies, si necesitas más información puedes visitar nuestra política de privacidad    Ver
Privacidad
Creative Commons License
Except where otherwise noted, the content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
A %d blogueros les gusta esto: