Project showcase
Arduino Robot with Temp, Ultrasonics, and Flammable Gas

Arduino Robot with Temp, Ultrasonics, and Flammable Gas © GPL3+

This robot checks humidity, temperature, gas and flame sensor in its environment. Could be used in life saving.

  • 752 views
  • 0 comments
  • 2 respects

Components and supplies

About this project

Background

Gas leakages and explosions have been major disasters for some years now. On January 2016, there was a gas explosion in Italy which killed five peoples. The gas explosion flattened a two-story building and damaged others in the town of Arnasco . Also on 4th June 2015, a fire explosion occurred in a filling station. The fire broke out late on Wednesday night in the Kwame Nkrumah Circle area of central Accra and is thought to have spread from a nearby lorry terminal. This disaster lead to the loss of over 70 Ghanaian lives. Over the years, ideas were brought up and a gas leakage detector was made. The gas detector was made to detect gas leakage. Most of the detectors that were invented are really good at detecting gas leakages but the problem is that, they are fixed. The detector being fixed means that, gas leakage will have to reach the detector before it gives an alert. This could take some long seconds. When it comes to safety of lives, every second counts and matters. With the Arduino robot, it will be placed in areas prone to gas leakages and also move around scanning and detecting flammable gas and smoke. The moment it gets a reading slightly above the limit of gas around the area or environment, it will give an alert. The robot can also get close to corners and detect flammable gas and smoke where the fixed ones won’t be able to do so.

In this project, a user friendly robot made up of Arduino with other sensors including flammable gas and smoke sensor, temperature and humidity sensor,

Aim of the project

A mobile Arduino robot to detect flammable gas, smoke, check temperature, humidity and obstacle avoidance.

Code

Code for the robotC/C++
Codes to make the robot fuction.
#include <dht.h>

dht DHT;

#define DHT11_PIN 5



const int trigPin = 2;

const int echoPin = 4;

const int sensorPin= 0;

const int buzzerPin= 13;

int smoke_level;



void setup() {
  
Serial.begin(9600);
 //sets the baud rate for data transfer in bits/second
  
pinMode(sensorPin, INPUT);//the smoke sensor will be an input to the arduino
  
pinMode(buzzerPin, OUTPUT);//the buzzer serves an output in the circuit
}


void loop()
{
  // establish variables for duration of the ping, 
  // and the distance result in inches and centimeters:
    int chk = DHT.read11(DHT11_PIN);
long duration, inches, cm;

  // The sensor is triggered by a HIGH pulse of 10 or more microseconds.
  
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  
pinMode(trigPin, OUTPUT);
 
 digitalWrite(trigPin, LOW);
 
 delayMicroseconds(2);
  
digitalWrite(trigPin, HIGH);
  
delayMicroseconds(10);
 
 digitalWrite(trigPin, LOW);

  // Read the signal from the sensor: a HIGH pulse whose
  // duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
 
 pinMode(echoPin, INPUT);
  
duration = pulseIn(echoPin, HIGH);

  // convert the time into a distance

  inches = microsecondsToInches(duration);

  cm = microsecondsToCentimeters(duration);
  
 
 smoke_level= analogRead(sensorPin); //arduino reads the value from the smoke sensor

Serial.println(smoke_level);//prints just for debugging purposes, to see what values the sensor is picking up
 
 
 Serial.print(inches);
 
 Serial.print("in, ");
 
 Serial.print(cm);
  
Serial.print("cm");
  
Serial.println();

   Serial.print("humidity = ");
  Serial.println(DHT.humidity,1);
  Serial.print("temperature = ");
  Serial.println(DHT.temperature,1);
  
 
 if(smoke_level > 170){ //if smoke level is greater than 170, the buzzer will go off
    
digitalWrite(buzzerPin, HIGH);
     }
   
else{
    
digitalWrite(buzzerPin, LOW);
   
 }
  
 
 delay(150);
}




/////////////////////////////////////////// FUNCTIONS ////////////////////////////////////////


long microsecondsToInches(long microseconds)

{
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}

Schematics

How the robot works
Img 3990
both.MOV
movement.MOV
detection.MOV

Comments

Author

Wp 20151105 22 53 49 pro
Fredinard Tengey Kwame
  • 0 projects
  • 3 followers

Additional contributors

  • Getting sensors,robot parts and codes. by Charles Jojo Vandyck,Micah Akati and Emmanuel Ani

Published on

March 31, 2016

Members who respect this project

DefaultDefault
See similar projects
you might like

Similar projects you might like

Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

  • 9,983 views
  • 0 comments
  • 54 respects

Control your Human-Like Robot from Anywhere you Are!

Project showcase by Team assemblypro

  • 3,620 views
  • 1 comment
  • 16 respects

Arduino Obstacle Avoidance Robot with Ultrasonic HC-SR04

Project showcase by Jorge Rancé

  • 26,187 views
  • 9 comments
  • 50 respects

Mini Firefighter Robot

Project in progress by Alberto Ben

  • 14,201 views
  • 22 comments
  • 48 respects

Ground-Based Obstacle Avoiding Robot

Project showcase by Xavier Tan

  • 10,466 views
  • 2 comments
  • 31 respects
Add projectSign up / Login