Showing posts with label temperature sensor. Show all posts
Showing posts with label temperature sensor. Show all posts

Monday, June 6, 2016

Temperature sensor robot with arduino

Temperature sensor  robot

This robot sense where the heat is more and goes near it  when the temperature crosses the default temperature  it stops and plays a siren/buzzes . I have given it 30 degrees Celsius as the default temperature  .Where ever it senses heat /fire it goes there . This can be used by the fire fighters.

Tools needed -

  • Arduino board
  • bread board 
  • lm35
  • wires
  • buzzer
  • A motor driver circuit 
  • 12v battery


You can make the robot in your own design

The temperature sensor looks likes this

We can use IC L293D  for the motor driver

these are the connections for the L293D

The program for the robot is -


int ml=5;
int mr=4;
int sl=A0;
int sr=A1;
int buzz=3;
int ldata;
int rdata;
int temp=27 ;


void setup() {
 Serial.begin (9600);
 pinMode(ml,OUTPUT);
 pinMode(mr,OUTPUT);
 pinMode(buzz,OUTPUT);
}


void loop() 
{
   int lsense=analogRead(sl)*5/10;
   int rsense=analogRead(sr)*5/10;
   Serial.println(rsense);
   Serial.println(lsense);

   delay(1000);
 if (temp>=lsense && temp>=rsense){
  digitalWrite(ml,HIGH);
  digitalWrite(mr,HIGH);
  digitalWrite(buzz,LOW);  
}

else if (temp < lsense && temp >= rsense){
  digitalWrite(ml,HIGH);
  digitalWrite(mr,LOW);
  digitalWrite(buzz,LOW);  
}
else if (temp >= lsense && temp < rsense){
    digitalWrite(ml,LOW);
    digitalWrite(mr,HIGH);
    digitalWrite(buzz,LOW);    
}
else if (temp < lsense && temp < rsense){
  digitalWrite(ml,LOW);
  digitalWrite(mr,LOW);
  digitalWrite(buzz,HIGH); 
}
}

Sunday, April 3, 2016

Arduino Micro controller for Robotics Workshop

WORKING WITH ARDUINO BOARD





Me at swecha
ME AT SWECHA


This weekend I've attended the Arduino Opensource Robotic workshop. It was really wonderful.

I met the people who already working on Arduino.
I also saw an obstacle avoiding Robot out of the Arduino.
Swecha is the Indian National Opensource programmers community organized the two days event.









first arduino program
First program with Arduino

Programming

The software can be found on arduino.cc .
It is free software, we can download.
And the hardware is an open hardware

I used the Arduino UNO, but you can use any type of Arduino

First Arduino Program ... Experimenting with LED (RGB combination... many more colors ... one after the Other ).


The program for the RGB sensor is


int redPin = 11;
int greenPin = 10;
int bluePin = 9; 
//uncomment this line if using a Common Anode LED
//#define COMMON_ANODE 
void setup(){  pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);
  }
 void loop()
{  setColor(255, 0, 0);  // red 
 delay(1000);  setColor(0, 255, 0);  // green 
 delay(1000);  setColor(0, 0, 255);  // blue  
delay(1000);  setColor(255, 255, 0);  // yellow  
delay(1000);    setColor(80, 0, 80);  // purple  
delay(1000);  setColor(0, 255, 255);  // aqua  
delay(1000); 
//we can make many more colors by changing the numbers . we can make rainbow colors 
}
 void setColor(i
nt red, int green, int blue)
{  
#ifdef COMMON_ANODE    
red = 255 - red;    
green = 255 - green;    
blue = 255 - blue;  
#endif  analogWrite(redPin, red);  
analogWrite(greenPin, green);  
analogWrite(bluePin, blue);  
}


RGB lights
Working with RGB lights

Then I've written a program for the temperature sensor, (which senses the temperature of the area/room).

program for temperature sensor is :
int val;
int tempPin = 9;
void setup ()
{
Serial.begin(9600);
}

void loop ()
{
val = analogRead(tempPin);
float mv = ( val/1024.0)*5000; 
float cel = mv/10;
float farh = (cel*9)/5 + 32;

Serial.print("TEMPRATURE = ");
Serial.print(cel);
Serial.print("*C");
Serial.println();
delay(1000);

Serial.print("TEMPRATURE = ");
Serial.print(farh);
Serial.print("*F");
Serial.println();


}


I've also written a program for the LDR sensor, (which senses the amount of light present in the area/room).

program for LDR sensor is :


 int sensorPin = 9;
 int sensorValue = 0;
 
 void setup() 
 {
 Serial.begin(9600);
 }
 void loop() 
 {
 sensorValue = analogRead(sensorPin);
 Serial.println(sensorValue);
 delay(100);
 }




Popular Posts