@@nidhi661 #include int output1Value = 0; int sen1Value = 0; int sen2Value = 0; int const gas_sensor = A1; int const LDR = A0; int limit = 400; long readUltrasonicDistance(int triggerPin, int echoPin) { pinMode(triggerPin, OUTPUT); // Clear the trigger digitalWrite(triggerPin, LOW); delayMicroseconds(2); // Sets the trigger pin to HIGH state for 10 microseconds digitalWrite(triggerPin, HIGH); delayMicroseconds(10); digitalWrite(triggerPin, LOW); pinMode(echoPin, INPUT); // Reads the echo pin, and returns the sound wave travel time in microseconds return pulseIn(echoPin, HIGH); } Servo servo_7; void setup() { Serial.begin(9600); //initialize serial communication pinMode(A0, INPUT); //LDR pinMode(A1,INPUT); //gas sensor pinMode(13, OUTPUT); //connected to relay servo_7.attach(7, 500, 2500); //servo motor pinMode(8,OUTPUT); //signal to piezo buzzer pinMode(9, INPUT); //signal to PIR pinMode(10, OUTPUT); //signal to npn as switch pinMode(4, OUTPUT); //Red LED pinMode(3, OUTPUT); //Green LED
} void loop() {
//------light intensity control------// //-------------------------------------------------------------- int val1 = analogRead(LDR); if (val1 > 500) { digitalWrite(13, LOW); Serial.print("Bulb ON = "); Serial.print(val1); } else { digitalWrite(13, HIGH); Serial.print("Bulb OFF = "); Serial.print(val1); } //-------------------------------------------------------------- //------ light & fan control --------// //-------------------------------------------------------------- sen2Value = digitalRead(9); if (sen2Value == 0) { digitalWrite(10, LOW); //npn as switch OFF digitalWrite(4, HIGH); // Red LED ON,indicating no motion digitalWrite(3, LOW); //Green LED OFF, since no Motion detected Serial.print(" || NO Motion Detected " ); }
if (sen2Value == 1) { digitalWrite(10, HIGH);//npn as switch ON delay(3000); digitalWrite(4, LOW); // RED LED OFF digitalWrite(3, HIGH);//GREEN LED ON , indicating motion detected Serial.print(" || Motion Detected! " ); } delay(300);
//--------------------------------------------------------------- // ------- Gas Sensor --------// //--------------------------------------------------------------- int val = analogRead(gas_sensor); //read sensor value Serial.print("|| Gas Sensor Value = "); Serial.print(val); //Printing in serial monitor //val = map(val, 300, 750, 0, 100); if (val > limit) { tone(8, 650); } delay(300); noTone(8); //-------------------------------------------------------------- //------- servo motor ---------// //------------------------------------------------------------- sen1Value = 0.01723 * readUltrasonicDistance(6, 6); if (sen1Value < 100) { servo_7.write(90); Serial.print(" || Door Open! ; Distance = "); Serial.print(sen1Value); Serial.print(" ");
} else { servo_7.write(0); Serial.print(" || Door Closed! ; Distance = "); Serial.print(sen1Value); Serial.print(" "); } delay(10); // Delay a little bit to improve simulation performance }
Hello thanks for feedback. Please don't copy the circuit please do this by your end as per instructions and copy the code given in discription. This will work perfectly. 👍
bro which code you have given is not opening its throwing error sketches are not created for this file. pls help only coding part is left in my project
Thank you so much for your lovely comment! 🙏 I'm really glad to hear that my video was helpful to you, 😊 It means a lot to know that I could assist you in some way...
Use this Link For Simulation
www.tinkercad.com/things/eprJv0vDKHU
Plzz share the code again
Sir how I can get program code
@@nidhi661
#include
int output1Value = 0;
int sen1Value = 0;
int sen2Value = 0;
int const gas_sensor = A1;
int const LDR = A0;
int limit = 400;
long readUltrasonicDistance(int triggerPin, int echoPin)
{
pinMode(triggerPin, OUTPUT); // Clear the trigger
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
// Sets the trigger pin to HIGH state for 10 microseconds
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
// Reads the echo pin, and returns the sound wave travel time in microseconds
return pulseIn(echoPin, HIGH);
}
Servo servo_7;
void setup()
{
Serial.begin(9600); //initialize serial communication
pinMode(A0, INPUT); //LDR
pinMode(A1,INPUT); //gas sensor
pinMode(13, OUTPUT); //connected to relay
servo_7.attach(7, 500, 2500); //servo motor
pinMode(8,OUTPUT); //signal to piezo buzzer
pinMode(9, INPUT); //signal to PIR
pinMode(10, OUTPUT); //signal to npn as switch
pinMode(4, OUTPUT); //Red LED
pinMode(3, OUTPUT); //Green LED
}
void loop()
{
//------light intensity control------//
//--------------------------------------------------------------
int val1 = analogRead(LDR);
if (val1 > 500)
{
digitalWrite(13, LOW);
Serial.print("Bulb ON = ");
Serial.print(val1);
}
else
{
digitalWrite(13, HIGH);
Serial.print("Bulb OFF = ");
Serial.print(val1);
}
//--------------------------------------------------------------
//------ light & fan control --------//
//--------------------------------------------------------------
sen2Value = digitalRead(9);
if (sen2Value == 0)
{
digitalWrite(10, LOW); //npn as switch OFF
digitalWrite(4, HIGH); // Red LED ON,indicating no motion
digitalWrite(3, LOW); //Green LED OFF, since no Motion detected
Serial.print(" || NO Motion Detected " );
}
if (sen2Value == 1)
{
digitalWrite(10, HIGH);//npn as switch ON
delay(3000);
digitalWrite(4, LOW); // RED LED OFF
digitalWrite(3, HIGH);//GREEN LED ON , indicating motion detected
Serial.print(" || Motion Detected! " );
}
delay(300);
//---------------------------------------------------------------
// ------- Gas Sensor --------//
//---------------------------------------------------------------
int val = analogRead(gas_sensor); //read sensor value
Serial.print("|| Gas Sensor Value = ");
Serial.print(val); //Printing in serial monitor
//val = map(val, 300, 750, 0, 100);
if (val > limit)
{
tone(8, 650);
}
delay(300);
noTone(8);
//--------------------------------------------------------------
//------- servo motor ---------//
//-------------------------------------------------------------
sen1Value = 0.01723 * readUltrasonicDistance(6, 6);
if (sen1Value < 100)
{
servo_7.write(90);
Serial.print(" || Door Open! ; Distance = ");
Serial.print(sen1Value);
Serial.print("
");
}
else
{
servo_7.write(0);
Serial.print(" || Door Closed! ; Distance = ");
Serial.print(sen1Value);
Serial.print("
");
}
delay(10); // Delay a little bit to improve simulation performance
}
Bro your videos are awesome but please do explanation part too..
Keep going 🤗👌👌👌👍
Hey , the bulbs aren’t turning on and even the buzzer won’t stop making the sound what should we do ? Could u suggest anything please
Hello thanks for feedback. Please don't copy the circuit please do this by your end as per instructions and copy the code given in discription. This will work perfectly. 👍
i had the same problem then double checked the circuit diagram and find the problem. You need to connect buzzer + pin to digital 8 pin
Can you give the code in blocks and text
Acabamos de sacar 10 en un parcial por usted master se le agradece
Encantada de aquí, sigue pensando 〽️
Bro program code google drive not working plzzz send me the link
My LDR is working in opposite. Couldn't find the error kindly tell me how to solve it
Change Relay Connection from NO to NC of Light Relay !!
Can l get the link of this model so that l can copy and paste in my tinkering because of science exhibition
I'll provide the link
Sir can you send the description of code
Nice bro very good 👍👍
Thank you so much 😀
Bro can u please tell me how to connect it to the Node-red
Hi can you give en exlpanation of the Code please
hi. Can you please share the tinkercad link of this project ? Seems like the link in google drive is not working. Thanks !
www.tinkercad.com/things/eprJv0vDKHU
@@technicalshubham789 Big thanks!
@@technicalshubham789 Idk why when i opened it and start the simulation, they're not working. Is it okay on your side ??
www.tinkercad.com/things/l1o1qR2IUKv
please refer these link. it works properly
@@technicalshubham789 This one's great. The simulation working properly. Thank you btw
thanks, friend very helpful
🙏🏻
@samara sekhar is the code opening with you?
isme fire alarm add krke bhi can u make the modification?
Ok thanks For suggestion i work according to that ..
Can you make same circuit diagram by using HC-SR04 ultrasonic distance sensor
Which process you want to add into this ..
my bulb doesnt light up vice versa. pls fix
www.tinkercad.com/things/eprJv0vDKHU
@@technicalshubham789 i mean, how to make sure the bulb goes vice versa? How to do it?
Sir can we add keypad to control one one
Yes u can ..
Then it leads to changes in the code... Sir please suggest code in this project
Tried doing it....but it's showing errors.
Try to share the code the way you did for the previous videos.
drive.google.com/file/d/1AnxBSMwRUaTy3TuM1R1ChswztVfl164h/view?usp=sharing
Hi
Could you please share the code.
It would be a great help.
drive.google.com/drive/folders/1L4k32xHWZN4V36wPNUJlqvdey0bd-aJc?usp=sharing
bro which code you have given is not opening its throwing error sketches are not created for this file.
pls help only coding part is left in my project
Use this Link For Simulation
www.tinkercad.com/things/eprJv0vDKHU
Can u share us Circuit diagram of this project ?
It is in discription check out ...
Sir can u send code
Create a sketch bol raha hai kya kare
if u new at the thinkercad then 1st watch te tutorial videos
Sir how I can get program code
Thanks for communicate. The link for code is available in description please check.
Bro you help me a lot so thankyou
Thank you so much for your lovely comment! 🙏 I'm really glad to hear that my video was helpful to you, 😊 It means a lot to know that I could assist you in some way...
Bhai code upload nahi ho raha hai
ok i will upload it again
drive.google.com/drive/folders/1L4k32xHWZN4V36wPNUJlqvdey0bd-aJc?usp=sharing
Hello…. Can you send PPT or Report of this project,
+1
Nice broo
Thank youuuuuuu...
can u send me the report of this project
Instead of music in bg you should explain how things works that would be helpful
Name of this theme and sub theme is
This is a simple Home automation or Automation Without any Microcontroller and coding .
we followed the whole video, but the light is not turning off according to the light intensity
If the Relay doesn't Work connect the power supply +ve to Relay terminal 2 .
many wires are missed compare the final circuit and circuit at 8:21
you need to connect relay terminal 8 to pin 13
terminal 5*
Thanks!
God bless you
how we should connect display sensor to this board
I uploaded an another video version 3
hello..where the code
Check Pin Comments
Bro unable to access your codes please share it
yeah same problem with me
Are you both get the Code ?
Check again
Please Open tinkercad site where u can find code also simulation.
🔥
Bro can you please update your link
Sure
@@technicalshubham789 please send it fast 🤠 please brother
www.tinkercad.com/things/eprJv0vDKHU
код можно не открываеться
BHAI YRR TERE SE EK CODE NHI SHARE KIY JAA RHA HY BTA
The schematic and ino code is in discription . Please check it🙏🏻
@@technicalshubham789 bro that code is not opening
Awesome work may I have your Gmail account please