Introduction of the Project
Get your DIY on and safeguard your space with our Arduino Smoke Detector With LED! This innovative project allows you to build a custom smoke detector with the power of Arduino technology, complete with a bright LED to alert you to potential danger. Keep your home or office safe and stylish with this must-have gadget that’s sure to impress.
In this Arduino project, we will glow a red colored LED if the gas sensor detects the smoke. This is a mini reflection of the fire safety system.
Supplies
In order to make an Arduino Smoke Detector with LED, we will require the following components: To build physical projects, you can purchase the components online or from any electronics center. For online projects, we are using the TinkerCad website.
Components
- Arduino Uno R3
- 1 LED
- 1 Gas Sensor
- 1 Small Breadboard
- 2 Resistors
- Connecting Wires
Circuit Diagram
Steps To Make An Arduino Smoke Detector With LED
Step 1: First, we must collect all the components on the Digital Board or Physical Table.
LED:
Step 2: Connect the Cathode terminal of it to the GND pin of the Arduino.
Step 3: Connect the Anode terminal of it to the 5-number pin of the Arduino through a resistor, as shown in the circuit.
Gas Sensor:
Step 4: Connect the B1, H2, and B2 terminals of it to the 5V pin of the Arduino.
Step 5: Connect the H1 & A1 terminal of it to the GND pin of the Arduino.
Step 6: Connect the A2 terminal of it to the A0 number pin of the Arduino.
Source Code
int led = 5; int sensor = A0; void setup() { pinMode(5, OUTPUT); pinMode(A0, INPUT); } void loop() { int sensorValue; digitalWrite(led, LOW); sensorValue = analogRead(sensor); if(sensorValue >= 100) digitalWrite(led, HIGH); delay(2000); }
Explanation of the Code
1. In the beginning, we initialized two variables to which the respective component is connected to their respective Arduino pin number.
2. In the setup function, we have configured the pins of the Arduino for input and output purposes.
3. In the loop function, we have declared a variable to store the value of the gas sensor. After this, we are reading the value from the sensor.
4. If the value is greater than 100, we are glowing the LED else. It will not glow.
5. In the end, we used a delay function, which takes time in milliseconds.
Output
Once you have successfully run the source code, you will get the result as shown below.
On starting the simulation, the LED will glow if the Smoke’s value detected using the Gas sensor is greater than 100.

Cisco Ramon is an American software engineer who has experience in several popular and commercially successful programming languages and development tools. He has been writing content since last 5 years. He is a Senior Manager at Rude Labs Pvt. Ltd.
0 Comments