Smoke Detector.
Hi, my name is Junaid, and today, I'm going to present to you my Tinkerkad which is basically a play on an alarm that you commonly see on like a fire engine of some sort. The idea of this circuit is to replicate a fire alarm of like a fire engine or even a fire in like a building. The alarm can be a warning. The equipment's are going to be mentioned later on in the instructable so stay tuned for that.
The Equipments Required to Make This Circuit.
1 Arduino: $34.99 CAD
Piezo (Buzzer): $14.19 CAD
One Red LED: $10.00 CAD
Gas Sensor: $25.99 CAD
2 resistors each 220 OHMS: $8.37 CAD
Potentiometer: $12.49 CAD
PIR Sensor: $11.99 CAD
LCD (Liquid Crystal Display): $14.58 CAD
2 Mini Breadboards: $18.90 CAD
Step 2
Here's where the juicy part strikes. It's where you're going to put the equipment's on the breadboard so the code can make perfect sense when you put in the pin numbers, etc... The hard part is in step 3 which will be explained shortly. Hint, hint, it's connecting the wires of the Arduino with the equipment's.
Step 3: Wiring (The Tough Part)
As mentioned before, this step is going to be probably the 2nd hardest to do because with the quantity of wires that's going to be used. This took me at least 1 hour to wire the whole circuit up, but I was doing it from scratch, so you guys can probably just easily copy off from my circuit, and do it way quicker than me.
Step 4: Connecting the Wires to the LCD
Make a black wire (negative wire), and connect it from the negative ground to the LCD's, ground. (The dot all the way to the left)
Make a red wire (positive wire), and connect it from the positive ground to the LCD's power. (The second dot).
Make a wire, and connect it two columns below of the Potentiometer's viper, and connect that wire to the contrast of the LCD.
Make a wire starting from Pin 12 in the Arduino, and connect it with the register/select supply on the LCD.
Make a black wire (negative wire), and connect it from the negative ground to the LCD's Read/Write supply.
Make a wire starting from Pin 11 in the Arduino, and connect it with the Enable supply on the LCD.
Make a wire starting from Pin 5 in the Arduino, and connect it with the DB4 supply on the LCD.
Make a wire starting from Pin 4 in the Arduino, and connect it with the DB5 supply on the LCD.
Make a wire starting from Pin 3 in the Arduino, and connect it with the DB6 supply on the LCD.
Make a wire starting from Pin 2 in the Audinho, and connect it with the DB7 supply on the LCD.
Make a wire starting from one column right above the terminal 2 of the resistor, and connect it with the LED Anode of the LCD.
Make a black wire (negative wire), and connect it with the LED Cathode of the LCD.
Step 6: the Code of the Whole Circuit.
#include <LiquidCrystal.h>
int pir =2;
int buzz =3;
int pinLed =12;
LiquidCrystal lcd (12, 11, 5, 4, 3, 2);
void setup()
{
Serial.begin(9600);
lcd,begin(16, 2);
lcd.print("Any word of your choice.");
pinMode(pir.INPUT);
pinMode(9, OUTPUT);
pinMode(buzz, OUTPUT);
}
void buzzer ( int onOff){
digitalWrite(buzz, onOff);}
void loop()
{
if (digitalRead(pir) == 1){
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0)
lcd,setCursor(0, 1);
// print the number of seconds since reset:
lcd,print(millis() / 1000);
digitalWrite(pinLed, HIGH);
Serial.println("Motion Detected");
buzzer(1);}
else {
Serial.print("No motion"):
buzzer(0);)
}