need this in beginner arduino coding (simple )
You require following parts
1-ARDUINO BOARD (uno)
2-LM35 TEMPERATURE SENSOR
3-USB CABLE
4-COMPUTER WITH ARDUINO SOFTWERE
5-LED
6- Piezo Speaker
7- 100 ohm and 150 ohm resistors
8- servo motor SG-90
Arduino code:-
#include <Servo.h>
int val;
int tempPin = 1;
int Ledpin=2;
int sound=3;
int servoPin = 5;
// Create a servo object
Servo Servo1;
void setup()
{
Serial.begin(9600);
pinMode(Ledpin, OUTPUT);
pinMode(sound, OUTPUT);
Servo1.attach(servoPin);
}
void loop()
{
val = analogRead(tempPin);
float mv = ( val/1024.0)*5000;
float cel = mv/10;
if(cel > 35)
{
digitalWrite(Ledpin, HIGH); // turn the LED on (HIGH is the voltage
level)
digitalWrite(sound, HIGH); // turn the LED on (HIGH is the voltage
level)
// Make servo go to 180 degrees
Servo1.write(180);
delay(1000);
}
digitalWrite(Ledpin, LOW); // turn the LED off by making the
voltage LOW
digitalWrite(sound, LOW); // turn the LED off by making the voltage
LOW
// Make servo go to 0 degrees
Servo1.write(0);
delay(1000);
Serial.print("TEMPRATURE = ");
Serial.print(cel);
Serial.print("*C");
Serial.println();
}
compiling without errors:-
conclusion:-
This project is used for detect the fire and alerts the people by using buzzer (beep sound) and light (visual). The main advantage of this project is the people who cannot hear the sound properly, they can be notified by the light
and the people who cannot see properly can be notified by the sound and opens the door for them...
need this in beginner arduino coding (simple ) ARDUINO 1. Complete the following problem using Arduino...