Kartik Desai
Published © GPL3+

Smoke Detection Sensor using Bolt IoT

Save yourself from fire with home made fire security system using Bolt IoT!!!

IntermediateFull instructions provided2 hours15
Smoke Detection Sensor using Bolt IoT

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Grove - Gas Sensor(MQ2)
Seeed Grove - Gas Sensor(MQ2)
×1
Breadboard (generic)
Breadboard (generic)
×1
LED (generic)
LED (generic)
×1
Buzzer
Buzzer
×1
Resistor 10k ohm
Resistor 10k ohm
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Jumper wires (generic)
Jumper wires (generic)
×7

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Bolt IoT Android App
Bolt IoT Android App

Story

Read more

Schematics

Schematic diagram for smoke detection sensor

Code

code for smoke detection sensor

JavaScript
{
    sensor_value=analogRead(A0);
b=setMaxValue(700);
setKey('{{ApiKey}}','{{Name}}');
setChartLibrary('google-chart');
setChartTitle('SMOKE DETECTION SENSOR');
setAxisName('time','smoke');
setCrosshair(true);
setChartType('lineGraph');
plotChart("time_stamp","fire_alarm");
if(sensor_value>=b)
{
digitalWrite(4,"HIGH");
}
else
{
digitalWrite(4,"LOW");
}
}
function newAnalogRead(A0) {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            var obj = JSON.parse(xmlhttp.responseText);
            if(obj.success=="1"){
                 callback_func(obj.value);
            }
        }
    };
    xmlhttp.open("GET",base_url+api_key+"/analogRead?pin="+pin+"&deviceName="+d_name,true);
    xmlhttp.send();
}

Credits

Kartik Desai

Kartik Desai

1 project • 0 followers

Comments

Add projectSign up / Login