Arduino Fire Alarm System with Tinkercad
In the digital era, Arduino has emerged as a powerful tool enabling enthusiasts, makers, and hobbyists to create interactive electronic projects. One of the most critical applications of Arduino is in the development of safety systems, notably fire alarm systems. Integrating Arduino with Tinkercad, a browser-based circuit simulator, provides an accessible and intuitive platform for prototyping these life-saving devices.
Arduino's simplicity, flexibility, and low cost make it an ideal choice for DIY fire alarm systems. Moreover, Tinkercad's user-friendly interface streamlines the process of circuit design and simulation, allowing users to test and iterate their projects with ease. This article will guide you through the process of creating a basic fire alarm system using Arduino and Tinkercad.
Understanding the Components
Before diving into the project, let's understand the key components:
- Arduino Board: The brain of our fire alarm system.
- Temperature Sensor: Detects elevated temperatures indicative of a fire (e.g., LM35, DHT11).
- Smoke Sensor: Detects smoke particles in the air (e.g., MQ2, MH-S711).
- Buzzer: Alerts inhabitants with a loud audio signal.
- LED: Provides a visual indication of the alarm's activation.
Combining temperature and smoke sensors enhances the fire alarm's reliability by reducing false alarms.
Temperature Sensor (LM35)
LM35 is an affordable and easy-to-use temperature sensor that provides a voltage output corresponding to the temperature in Celsius. Place it in an area prone to heat buildup, such as near electrical appliances or heating systems.
Here's an Arduino sketch for reading LM35 temperature readings: 'const int tempPin = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
int tempReading = analogRead(tempPin);
float tempCel = (tempReading * 500.0) / 1023.0;
Serial.print(tempCel); Serial.println(" *C");
delay(1000);
}
Smoke Sensor (MQ2)
MQ2 is a semi-conductor metal-oxide gas detector that detects the presence of smoke. Connect it to your Arduino board along with a 10kOhm pull-down resistor to measure changes in resistance due to smoke particles.
Use this Arduino sketch to read MQ2 sensor values:'const int smokePin = A0;
void setup() {
Serial.begin(9600);
pinMode(smokePin, INPUT);
}
void loop() {
int smokeReading = analogRead(smokePin);
Serial.print(smokeReading); Serial.println(" PPM");
delay(1000);
}
Creating the Circuit in Tinkercad
Tinkercad simplifies creating and testing circuits by providing a virtual breadboard and components. To design your fire alarm circuit, follow these steps:
- Drag and drop the Arduino, temperature, smoke, buzzer, and LED components onto the breadboard.
- Connect the temperature sensor to the Arduino (GND - GND, VCC - 5V, and DO - Analog Pin 0).
- Connect the smoke sensor to the Arduino (GND - GND, VCC - 5V, and DO - Analog Pin 1).
- Connect the buzzer (GND - GND and DO - Digital Pin 2).
- Connect the LED (GND - GND and DO - Digital Pin 3).
Arduino Code for the Fire Alarm System
Combine the temperature and smoke sensor readings to activate the alarm. Use these thresholds:
- Temperature: Above 60°C (140°F)
- Smoke: Above 500 PPM
Here's the complete Arduino sketch: 'const int tempPin = 0;
const int smokePin = 1;
const int buzzerPin = 2;
const int ledPin = 3;
void setup() {
Serial.begin(9600);
pinMode(buzzerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
int tempReading = analogRead(tempPin);
int smokeReading = analogRead(smokePin);
float tempCel = (tempReading * 500.0) / 1023.0;
Serial.print("Temperature: "); Serial.print(tempCel); Serial.print(" *C, Smoke: "); Serial.print(smokeReading); Serial.println(" PPM");
if (tempCel > 60 || smokeReading > 500) {
tone(buzzerPin, 1000);
digitalWrite(ledPin, HIGH);
} else {
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
}
delay(1000);
}
With this project, you've successfully created a simple fire alarm system using Arduino and Tinkercad. Enhance the system further by adding motion sensors, integrated displays, or wireless modules to remotely alert users in case of an emergency. Regularly test and maintain your fire alarm system to ensure optimal performance.