Fire Alarm System

by 850386 in Circuits > Arduino

343 Views, 2 Favorites, 0 Comments

Fire Alarm System

Screen Shot 2021-06-22 at 8.30.02 AM.png

The Fire Alarm is a device that alerts the user if any smoke is detected. Further, it sounds a ‘siren’ if the smoke is within a certain distance of the device. The distance of the smoke can be estimated using the LED lights with green being safe, yellow being close by and finally red representing danger.

Required Supplies

Screen Shot 2021-06-18 at 10.00.19 AM.png

The following is a list of supplies, along with links to where to purchase each product:

220 ohm resistors (4)

3 LEDs (Recommended Colours: Red, Yellow, Green)

5V Buzzer or Piezo Buzzer (1)

Gas Sensor (1)

Arduino Uno (1)

Small Breadboard (1)

Jumper Wires

Note: The links to all the items have been attached (as of June 23,2021), the prices and availability could potentially change.

Understanding the Circuit

The following is not a step, so you may skip it if you like. These are just some basic descriptions of some of the components which are needed for this project.

A resistor is an electrical component that limits or regulates the flow of electrical current in a circuit. Resistors are used to reduce the amount of current flowing in a circuit, the material in a resistor is very thin, which forces the current to slow down to pass through, providing resistance to the circuit.

An LED also known as a light emitting diode is a semiconductor device that emits light when an electric current flows through it. The LEDs have an anode (power) and cathode (ground) side. Anode is the longer 'leg' of the LED while the cathode is the shorter one. Light is produced when the electrons combine together with the semiconductor material. Inside the semiconductor material of the LED, the electrons and holes are contained within energy bands. The separation of these bands determines the energy of the light particles also known as photons that are emitted by the LED.The photon energy determines the wavelength of the emitted light, and hence its colour. Different semiconductor materials with different band gaps produce different colours of light.

Buzzers are electric components which make a buzzing sound as its name suggests and they are used mostly to signal. The buzzer has two pins which allow it to attach to power and ground. Inside the buzzer, is a central ceramic disc surrounded by a metal vibration disc, when current is applied to the buzzer it causes the ceramic disk to contract or expand resulting in the surrounding disc vibrating. The vibration of the disk causes the buzzing sound.

Gas sensors also known as gas detectors are electronic devices that detect and identify different types of gases. The voltage that the sensor outputs changes accordingly to the smoke/gas level that exists in the atmosphere. The sensor outputs a voltage that is proportional to the concentration of smoke/gas.The greater the gas concentration, the greater the output voltage, the lower the gas concentration, the lower the output voltage.

A PWM pin on the Arduino is a pin with the ~ in front of it. These pins, also called pulse width moderation pins, recreate an analog or varying signal. The PWM pins can help with devices like an RGB LED or in terms of connecting the Trig pin in an Ultrasonic Distance Sensor.

Building the Circuit

Screen Shot 2021-06-22 at 9.48.07 AM.png
Screen Shot 2021-06-22 at 9.52.31 AM.png
Screen Shot 2021-06-22 at 9.52.48 AM.png

To start firstly make sure the breadboard is fully connected to both power and ground with the recommended red and black wires. (Red for power and Black for ground)

Then, place the gas sensor on the breadboard as shown in the diagram above and use the wires to make the proper connections to both power and ground. Pins B1, H2 and B2 should be connected to power while Pin H1 is to be connected to ground using the wires. Pin A2 should be connected to ground using a resistor and Pin A1 should be connected to an analog pin using a wire.

After the Gas Sensor is connected, place the three LEDs of choice on the breadboard and using a resistor connect the cathode of the LED to ground, as shown in the diagrams above. Using the wires make a connection from the anode of the LED to a digital pin on the Arduino, repeat for all 3 LEDs.

Lastly, place the buzzer on the breadboard, the buzzer will have 2 pins, one for power and the other for ground, make the connection to ground for one of the pins using the jumper wire. The second pin should be connected to a digital pin on the Arduino. Use the diagrams above for reference.

Things to Note:

Don't connect the power wire to the ground as this will result in creating a short circuit and diffuse a lot of the components on the breadboard.

Colour code your wires as best as possible. It is recommended to make direct connects to power using the red wires and direct connections to ground using the black. Colour coding will make navigating through the circuit easier.

Uploading the Code

Download the file below. This will allow you access to the code, although you would need the Arduino IDE software to be able to access this. As soon the code is download, your computer will add it into a file and then it will be accessible .

Within the code, you can change the names of the void 'smokeDistance' function, to your preference name as well as you can rename any variables and change the pins which have been declared to match your project.

Finished Project

Your project should look and work like above. And that is all, in 4 simple steps you have created your very own Fire Alarm System! You can have fun playing around with the code and that's it for now!

Bye!