Fire Alarm Circuit Using Aurdino
by Nishikutty in Circuits > Arduino
1264 Views, 2 Favorites, 0 Comments
Fire Alarm Circuit Using Aurdino
In this article, we are going to design a Fire Alarm circuit using a few electrical components like Temperature and Gas sensors using TinkerCad and interface it with Arduino. Let's start with the components we will require to build the circuit in the #TinkerCad software.
Hardware Requirements:
1. Arduino UNO Board.
2. LM-35 Temperature Sensor
3.Gas sensor
4. Resistors
5. Breadboard
6. LED
7. Piezo Buzzer
8. Jumper Wires
Software Requirement:
1.TinkerCad circuit simulation software
Circuit Connections
The circuit connections are as follows.
Firstly, we need to connect one line of the breadboard to the ground and the other to the power supply. This is done by connecting the 5V pin of the Arduino Board to one line of connection pins on the breadboard. The other line of the breadboard is connected to the ground terminal of the Arduino Board. These lines will be connected to other devices.
The Temperature sensor has three pins. Ground, Vout, and Vs (Supply). The Vs pin that has a range of 4-20V is connected to the power supply line of the breadboard. The Ground terminal of the sensor is connected to the ground line of the breadboard. The Vout terminal of the temperature sensor is connected to one of the Analog pins of the Arduino Board, A1.
Now let us learn how the connections are done with the Gas sensor. This sensor has 6 pins. 3 pins of the gas sensor are directly connected to the power supply line of the breadboard. Amongst the other 3 pins of the sensor, one pin is connected to one of the Analog pins of the Arduino Board, A0. The pin in the middle is connected to the ground line of the breadboard. The third pin of the sensor is connected to a resistor and then connected to the ground line.
The piezo buzzer is externally connected to the circuit. The ground pin of the #buzzer is connected to the ground line of the breadboard. Another pin of the buzzer is connected to the digital pin, PIN 7 of the Arduino Board.
Lastly, the LED is connected to the Arduino directly. The cathode of the LED is connected to the GND pin of Arduino and the anode of the LED is connected through a resistor to the digital pin 13 of the Arduino.
Arduino Programming
A floating-point variable "temp" is declared for the temperature value that is going to be taken as input from the temperature sensor.
Another floating-point variable "out" is declared to store the value of the output from the temperature sensor. The variable "vout1" is going to store the value of the output from the gas sensor. The value of the pin to which the LED is connected is store in the variable "LED". Integer variables for Gas-sensor and Piezo buzzer are declared.
The setup( ) function uses pinMode functions to assign the Mode for the pins declared. A0 pin is going the take the input from the Gas sensor, so it's assigned as input mode. The PIN A1 is going to take input from the Temperature sensor, so it is assigned as an input pin.
The #LED is going to be the output indicator for the Gas sensor hence declared as Output. The piezo buzzer indicates the output of the Temperature sensor, hence it is declared as output. The #Baudrate for serial transmission, 9600 is given to begin the execution of the code.
The variable "vout" will hold the value read from the analog pin A0 which is the input from the Gas sensor. analogRead( ) function uses to take the input. The vout1 holds the value based on "vout". The above expression in the code shows the same.
A set of if-else statements are used to assign values that could give the output. The first "if" condition checks if the input temperature is Greater than 80 C. If the temperature goes above 80, the LED is HIGH and it glows. Otherwise, the LED remains OFF (LOW). This function is done using digitalWrite( ) function.
The next set of "if" conditions check the input from the gas sensor. If the input value goes above 1000, the Piezo Buzzer buzzes (HIGH) and if the value is less than 1000, the value sent to the buzzer remains LOW
Output
Part 1: Temperature sensor and its output.
The Temperature sensor takes in input and when the temperature increases, the voltage increases, and hence the output initiates the functioning of the Buzzer. For every one degree increase in temperature, there is a 10mV increase in the voltage.
Part2: Gas sensor and its output.
A gas sensor is also used to detect smoke along with the concentration of gases. Based on the type of gas present in the atmosphere, a potential difference is developed by changing the Resistance of the material present inside the sensor and the same is measured as output.
The Concentration of the gas is measured in ppm and the output analog value is needed to be converted into digital which is done by the #ADC (Analog to Digital Converter) present in the sensor itself. Based on the condition given in the code, the LED glows or remains OFF.