Arduino

Páginas: 3 (521 palabras) Publicado: 26 de septiembre de 2014
Termometro digital con Arduino y LCD!!

La lista de componentes:
- placa Arduino
- LCD 16 x 2 Pantalla
- 10K potenciómetro
- Temperatura LM35 sensor
- Puentes de conexión
Este sensor captala temperatura externa y la convierte en un valor de tensión correspondiente. En este circuito, se conecta la salida Vo del sensor a la Arduino ’s pin A0, lo que lo convierte en un valor flotante detemperatura y, a continuación, se exhibe en la pantalla LCD. El potenciómetro de 10K ajusta el contraste de la pantalla.
Ahora, configure el circuito de abajo con el Arduino y el resto de componentes: 

Y luego, abrir el IDE de Arduino y escriba el siguiente código:
 
#include // Include the library to use a LCD display

#define sensor 0 // Define the A0 pin as “sensor”

int Vin; //Variable to read the value from the Arduino’s pin

float Temperature; // Variable that receives the converted voltage value to T

float TF; // Variable to receive the converted value fromºC to ºF

LiquidCrystal lcd (12, 11, 5, 4, 3, 2);

/* The function above declares which Arduino’s pins will be used for controlling the LCD */

void setup()
{
lcd.begin(16, 2); // Ittells the Arduino that the display is a 16x2 type
lcd.print("Temperature: "); // Send the text to the screen of the display.
}
void loop()
{
Vin = analogRead (sensor); // Tells the Arduinoto read the pin and
// stores the value in “Vin”
Temperature=(500*Vin)/1023; // Converts the voltage value into temperature
// andstores it into the “Temperature” variable (in ºC)
TF = ((9*Temperature)/5)+32; // Converts ºC to ºF
lcd.setCursor(0, 1); // Moves the cursor of the display to the next line
lcd.print(TF);// Exhibits the value of the temperature on the display
lcd.print(" F"); // Writes “F” to indicate that it is in Fahrenheit scale.
delay(1000); // Waits for a second to read the pin...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Arduino
  • Que es arduino
  • Arduinos
  • ARDUINO
  • Arduino
  • Arduino UNO
  • Arduino
  • arduino

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS