Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Real-Time Monitoring with Arduino

Importance and Utility of Real-Time Monitoring

Real-time monitoring is a crucial aspect of many engineering and automation applications. It allows us to continuously track and analyze data in real-time, providing valuable insights and enabling timely decision-making. With the advent of microcontrollers like Arduino, real-time monitoring has become more accessible and affordable for hobbyists and professionals alike.

Project: Real-Time Temperature Monitoring System

In this project, we will create a real-time temperature monitoring system using Arduino. The objective is to continuously measure and display the temperature using a temperature sensor and an LCD display. The system will also sound an alarm if the temperature exceeds a certain threshold.

List of Components:

  1. Arduino Uno - 1x [Link: https://www.arduino.cc/en/Main/ArduinoBoardUno]

  2. Temperature Sensor (LM35) - 1x [Link: https://www.sparkfun.com/products/10988]

  3. LCD Display (16x2) - 1x [Link: https://www.sparkfun.com/products/255]

  4. Breadboard - 1x [Link: https://www.sparkfun.com/products/12615]

  5. Jumper Wires - As required [Link: https://www.sparkfun.com/products/127]

  6. Resistor (220Ω) - 1x [Link: https://www.sparkfun.com/products/8377]

Examples:

  1. Reading Temperature from LM35 Sensor:
const int temperaturePin = A0;  // Analog pin connected to LM35 sensor
float temperature;

void setup() {
  Serial.begin(9600);  // Initialize serial communication
}

void loop() {
  int rawValue = analogRead(temperaturePin);  // Read analog value from LM35 sensor
  temperature = (rawValue * 5.0) / 1023.0 * 100.0;  // Convert analog value to temperature in Celsius

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println("°C");

  delay(1000);  // Delay for 1 second
}

This code reads the analog value from the LM35 temperature sensor connected to pin A0 of the Arduino. It then converts the analog value to temperature in Celsius and prints it to the serial monitor.

  1. Displaying Temperature on LCD:
#include <LiquidCrystal.h>

const int temperaturePin = A0;  // Analog pin connected to LM35 sensor
float temperature;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  // Initialize LCD object

void setup() {
  lcd.begin(16, 2);  // Initialize LCD with 16 columns and 2 rows
}

void loop() {
  int rawValue = analogRead(temperaturePin);  // Read analog value from LM35 sensor
  temperature = (rawValue * 5.0) / 1023.0 * 100.0;  // Convert analog value to temperature in Celsius

  lcd.setCursor(0, 0);  // Set cursor to first column of first row
  lcd.print("Temperature: ");
  lcd.print(temperature);
  lcd.print("C");

  delay(1000);  // Delay for 1 second
}

This code displays the temperature on a 16x2 LCD display using the LiquidCrystal library. The temperature is read from the LM35 sensor and converted to Celsius before being displayed on the LCD.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.