I want the same with high sensitivity, I mean It should work for any movement take place with a distance as much as 30-40 feet from the sensor. Thanks for your projects , you deserve more viewers.
@@boobaljanakiramulu7277in which part of the code can I adjust the distance. First example I want the distance of buzzer beeping from 3 feet to the closesest. So, what number should I put in the code & which part of the code
//Tech Trends Razis //Object Detection Alarm // Define pins numbers const int trigPin = 13; //Connect Trig pin in Ultrasonic Sensor to Arduino Pin 13 const int echoPin = 12; //Connect Echo pin in Ultrasonic Sensor to Arduino Pin 13 const int buzzer = 11; //Connect Positive pin of Buzzer to Arduino Pin 11 const int ledPin = 10; //Connect Positive pin of LED to Arduino Pin 10 // Define variables long duration; int distance; int safetyDistance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input pinMode(buzzer, OUTPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); // Starts the serial communication } void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 15 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(15); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculate the distance distance= duration*0.034/2; safetyDistance = distance; if (safetyDistance
mam your project is too good i tried this but i can't able to select the port in the tools can you please help me... i have to submit this project tomorrow plzzz help me mam....
project code
//Security Alarm with Ultrasonic Sensor//
#define trigPin 6
#define echoPin 5
#define buzzer 2
float new_delay;
void setup()
{
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzer,OUTPUT);
}
void loop()
{
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
new_delay= (distance *3) +30;
Serial.print(distance);
Serial.println(" cm");
if (distance < 50)
{
digitalWrite(buzzer,HIGH);
delay(new_delay);
digitalWrite(buzzer,LOW);
}
else
{
digitalWrite(buzzer,LOW);
}
delay(200);
}
Thank you
I want the same with high sensitivity, I mean It should work for any movement take place with a distance as much as 30-40 feet from the sensor. Thanks for your projects , you deserve more viewers.
You can adjust the distance in the coding
@@boobaljanakiramulu7277in which part of the code can I adjust the distance. First example I want the distance of buzzer beeping from 3 feet to the closesest. So, what number should I put in the code & which part of the code
HII TYSMM I DIDNT PAY ATTNETION IN CLASS HAHA AND I DID THIS LAST MINUTE AND GOT GOT MARKS THANKS AGAIN
😂
It is working but my buzzer is making less sound how to fix it
Works fine for me Thank you for uploading!!!
Did you use 7v or 9v?
Also, some of the comments said that the code is not working, how does it work with you? Please help me
yo what is after else function in line 38
I can't find it in the video. Also there are many bugs in the code
something is wrong with the code. The buzzer wont top beeping even when nothing is in front of the sensor. Check the code
Same...did u do any changes...pls let me know if u hv
Dude the sensor is detecting another object nearby .so remove any objects nearby
Just kidding it did not work for me as well
Can you add screen on it
//Tech Trends Razis
//Object Detection Alarm
// Define pins numbers
const int trigPin = 13; //Connect Trig pin in Ultrasonic Sensor to Arduino Pin 13
const int echoPin = 12; //Connect Echo pin in Ultrasonic Sensor to Arduino Pin 13
const int buzzer = 11; //Connect Positive pin of Buzzer to Arduino Pin 11
const int ledPin = 10; //Connect Positive pin of LED to Arduino Pin 10
// Define variables
long duration;
int distance;
int safetyDistance;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(buzzer, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 15 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(15);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculate the distance
distance= duration*0.034/2;
safetyDistance = distance;
if (safetyDistance
Did you use 7v or 9v battery?
Please answer me I have a project and the deadline after 5 days
Did anyone do it with scratch 4 arduino? Because I would like some help with the code s4a. It's for elementary school class
Thnk u thnk u so much it's working
Coding in coment 😢
i do not have a buzzer...is it still possible to make this?
you can LED lights instead
mam your project is too good i tried this but i can't able to select the port in the tools can you please help me... i have to submit this project tomorrow plzzz help me mam....
tells me that there is a stray # in it but doesnt work pls help
How to make in this program
Thankyou so much!! Worked well for me❤
it says these errors :Compilation error: a function-definition is not allowed here before '{' token
anyone pls help me fix it
thank you but my buzzer is super quiet what could i do to fix this?
Amplify it, use a transistor circuit
Is there barcoding for the device too?
While I upload the coding itself the buzzer starts to sound I done all thinks as per the circuit diagram why it's happening
when finally uploading the coding to the board add the buzzer then it's alright
Library file choosen is needed or not
PARABENS POR DEIXAR O CODIGO NOS COMENTAROS, BEIJOS
thank you...🤓👍
GOOD JOB MAM.
what volt of buzzer are used in this project?
I don't know 😅
does this projeft use battery 9v?
I used 7V
Can I replace the beeper with 5V pump?
Yes
@@n_tech3861 could you tell where to connect battery to audrino uno
@@mdtameem324just connect the wire of the battery to :
Black wire gnd
Red wire to vin
How many voltage inpute
9 V to arduino
The voice is quite what should I do
Yesss
Hi, i have a project on Arduino , can u help me plz?
can you upload the link coding ?
hyyy i am getting an error
Check your wires
Hi please check your code, your code has some error. please go in ur code and verify it please thx and reply fast thx
Hey can you please mention where exactly is it going wrong because I am unable to find it
@@n_tech3861 Hi, so when i run the code it said something like "can have definition variable before '{' token" something like that
@@shuttyskenzin9237 you may have missed an opening or a closing bracket
Please who has the correct code
Mam please please please 🙏 send the code in my comments
#define trigPin 6
#define echoPin 5
#define buzzer 2
float new_delay;
void setup()
{
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzer,OUTPUT);
}
void loop()
{
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
new_delay= (distance *3) +30;
Serial.print(distance);
Serial.println(" cm");
if (distance < 50)
{
digitalWrite(buzzer,HIGH);
delay(new_delay);
digitalWrite(buzzer,LOW);
}
else
{
digitalWrite(buzzer,LOW);
}
delay(200);
}
Jjj
Saan po yung code
😂😂