Components Required:
- Arduino with USB Cable
- A PC or Laptop with Arduino software with drivers installed for programming the Arduino
- LM35 Temperature Sensor
- Piezo Buzzer
- Bread Board
- Connecting Wires
Code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
============================================ | |
The MIT License (MIT) | |
Copyright (c) 2013 Jayakarthigeyan Prabakar | |
Fire Alarm Using LM35 and Piezo Buzzer with Arduino sketch is the Arduino sketch used in the project shown at https://www.youtube.com/watch?v=XC3xZ-cWDaY | |
Created on 19th February 2013 by Jayakarthigeyan Prabakar <jayakarthigeyan@gmail.com> | |
Updates should (hopefully) always be available at https://github.com/jayakarthigeyan/Fire-Alarm-Using-LM35-Temperature-Sensor-and-Piezo-Buzzer-with-Arduino/ | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
SOFTWARE. | |
=============================================== | |
*/ | |
void setup() | |
{ | |
} | |
void loop() | |
{ | |
float temp = (5.0 * analogRead(A0) * 100.0) / 1024; | |
if(temp>32) | |
{ | |
t(); | |
} | |
else | |
{ | |
if(temp>30) | |
{ | |
t1(); | |
} | |
if(temp<30); | |
{ | |
noTone(7); | |
} | |
} | |
} | |
void t() | |
{ | |
tone(7, 494, 500); | |
delay(1000); | |
} | |
void t1() | |
{ | |
tone(7, 494, 500); | |
delay(2000); | |
} |
i have done coding it continue to make sound its not turning off
ReplyDeleteWhat kind of wires you use? Female-female, male-female, or male-male?
ReplyDeleteBetway Casino & Hotel Review - JT Hub
ReplyDeleteA detailed 경상북도 출장안마 review of Betway Casino & 경상북도 출장안마 Hotel, as 충청북도 출장안마 well as its casino 의정부 출장샵 section. Find the 천안 출장마사지 latest offers, games, bonuses, customer service and more here.