thank you so much for this video, Mr. ElectroUino! you're literally a lifesaver. now, I can use this as a guide for my upcoming Arduino project. thank you again and have a nice day!!
thank you! I found out that taking the absolute value of the "duration" making it works much better. for some reason negative values pop out randomly in my setup
Very good tutorial and project! I was able to follow your directions and got it to work properly. I was trying to add a function where the LED would turn off after 30 seconds of no movement and then reset/loop back but having trouble. I can get the LED to turn off after no movement for 30 seconds but I can't turn it back on when the sensor detects movement. I would appreciate any feedback.
duration = pulseIn(echo , HIGH); distance = (duration/2) / 28.5 ; Serial.println(distance); Hi Sir. Above code are taken from your arduino program. May i know what is 28.5 means? Thanks.
Visit my website for detail code explanation and don't forget to subscribe to my channel✔💙. Link👇 mrelectrouino.blogspot.com/2020/07/arduino-ultrasonic-sensor-with-leds.html?m=1
please I need your help ! What if you want to make it with one Led that works when you place your hand in front of it at what distance(without distance measure)? how is the circuit and codes? And do I need a relay module? knowing that it takes its energy from a solar cell not a battery.
Hi, loved your work Am trying it but My led won't stop blinking. It's blinking every second it takes reading. Apparent from that its working fine Can you please help.
BROOOO THANK UUU SOOO MUCHH i was trying 2 do this but it never worked cuz the coding was wrong and the ppl on utube, ur the 1st person to make me get successful with this, i nearly threw away this perfectly good sensor cuz i never got it 2 work
Hi brother Its a very good project. But I want to do some modification like I want to add two sensor and differnt light for another sensor. Can u pls help me out. I would really appreciate it. Again thanks for the idea and I also subscribed to ur channel
Hellooo, I hope you'll notice this comment. I was wondering why my components are blinking when I copied your code, but in the video it isn't. Have I done something wrong? Your reply would be greatly appreciated ^-^
Can you send the serial monitor, I think your sensor might not work. I need more information to point out the issue. Contact me on instagram _mr_electrouino
Yes, you can do that, but the resistor is used for protecting the LEDs. Without a resistor, the LED draws too much current and burns out. You can easily found a resistor in some old electronics components but make sure the values and don't forget to subscribe to my channel✔💙
Thank you for this video !! can you give me the coding and diagram for ultrasonic sensor led project? because i want use this as a guide for my final exam ..
5mm size and Round Red, Green, Blue, Yellow, White Color. It requires 2 to 3V dc power supply. For more information and buy visit this link: www.banggood.in/custlink/m3vD4vsnhu For the speaker connection, connect a positive terminal of speaker to Arduino pin 11 and negative terminal to Arduino pin ground(GND) and update the code and upload it. #subscribe it for more video...... if you getting any problem you can also contact me on Instagram: instagram.com/_mr_electrouino_/?igshid=isb2pw365odq
@@MrElectroUino its a device that can interact with spirits. I chase EVP, Electronic Voice Phenomenon, ITC is Instrumental Trans-Communication. I recently built a Rem Pod too.
@@littleengineer8496 Relay is a electrical switch. It's use for high current appliances. arduino only supply 5v, So we can use a relay to switch between 230v bulb AC.
Too good but the problem is the last part of your code for leds passes quickly moreover "upload the code" those words causes obstruction i can see clearly. Where can i get clean code?
Hi, I’m not sure if you are still looking at the comment but I’m doing a project like this but making it work with a dmx light. The ultrasonic sensor was not powerful enough to detect someone from a range so I’m going to be using a vl530x. I’m wondering how I can do the same project able to control the light power depending on distance with the vl530x
@@MrElectroUino hi I got to making the sensor work on its own now I’m just trying to figure out how to make the dmx shield and the vl530x work together. If
Is there a reason why , when I change the power source from the blue wire to the 9v battery it no longer functions like it's supposed to ? It only glows
Hi Sir,I will make this project. code was working,led was was showing distances.but one problem,all led was blinking I will put obstacle opposite of senser led was not blink.what is the problem of blinking?
Hey there, Resistor is use for protecting the leds.Without resistor the LED draws too much current and burns out. You can easy found a resistor in some old electronics component but make sure the values.
I just need it so when you go close up, It'll have a red light, and when the sensor senses nothing, it has a green light. Can you tell me how to do that, please?
I am doing the same thing with one led light, so when the sensor will find a object placed within less than 10 cm then it will turn on the light bt when i am connecting the circuit the led is glowing and when i am putting a object in front of the sensor the led is turned off why? But i have distance written "if(distance
th-cam.com/video/L90WS-ptnvI/w-d-xo.html Visit this link for get the distance of an object after that use if loop for comparing the distance and turn on/off the led.
why my serial monitor not showing the distance? it keep showing 0 value. i follow all your instructions and your coding but still not get it. even i try only the sensor.
That's because the echo pin of HC-SR04 receives a pulse of very short duration,a pulse that has a value of 5v. Its not possible to get a pulse with analog pin.
Is there anyone here getting this error code here? Arduino: 1.8.13 (Windows 7), Board: "Arduino Uno" Sketch uses 3234 bytes (10%) of program storage space. Maximum is 32256 bytes. Global variables use 190 bytes (9%) of dynamic memory, leaving 1858 bytes for local variables. Maximum is 2048 bytes. An error occurred while uploading the sketch avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
The first step is to verify the Uno is presented on COM3. Remove the Uno. Start Device Manager. What serial ports are listed? Insert the Uno. Wait a few seconds. What serial ports are listed?
Thanks for video. But I have a question . How Can I do this project with use active buzzer? How should be the circuit diagram and code?
if you want circuit diagram and code so send your Gmail id and do subscribe to my channel💖.
Shahrozgandapur@gmail.com
Send the code
@@shahrozKhan4u Check your email i have sent the code and circuit.
dikawirasaputra@gmail.com :) please gift me code.
thank you so much for this video, Mr. ElectroUino! you're literally a lifesaver. now, I can use this as a guide for my upcoming Arduino project. thank you again and have a nice day!!
thank you!
I found out that taking the absolute value of the "duration" making it works much better. for some reason negative values pop out randomly in my setup
Excellent!
@@MrElectroUino Mr ElectroUino Can you Send me The code and diagram please? . I need the code urgently
Amazing video, highly recommend, well explained and works perfectly. Thanks a lot
Thanks for watching 😊😊💖💙
Very good tutorial and project! I was able to follow your directions and got it to work properly. I was trying to add a function where the LED would turn off after 30 seconds of no movement and then reset/loop back but having trouble. I can get the LED to turn off after no movement for 30 seconds but I can't turn it back on when the sensor detects movement. I would appreciate any feedback.
Glad it helped!, can you contact me on Instagram: _mr_electrouino
Nice Video! if let's say I want to add on the Active buzzer, can you show me the circuit diagram and code?
Send your email address.
duration = pulseIn(echo , HIGH);
distance = (duration/2) / 28.5 ;
Serial.println(distance);
Hi Sir. Above code are taken from your arduino program. May i know what is 28.5 means? Thanks.
Visit my website for detail code explanation and don't forget to subscribe to my channel✔💙. Link👇
mrelectrouino.blogspot.com/2020/07/arduino-ultrasonic-sensor-with-leds.html?m=1
J
please I need your help !
What if you want to make it with one Led that works when you place your hand in front of it at what distance(without distance measure)? how is the circuit and codes? And do I need a relay module? knowing that it takes its energy from a solar cell not a battery.
Can you give me the code for using and OLED i2c Display to show distance with this project, It will be very helpful.
Great Video Anyways!!
you're the kind of teacher that I want which always come to the point without wasting our time 🥰 thankyou for this video
i'm glad to hear that 💙😊💚
@@MrElectroUino I need a code
I need a code please
Hi, loved your work
Am trying it but My led won't stop blinking. It's blinking every second it takes reading.
Apparent from that its working fine
Can you please help.
You deserve a like my guy
Thanks man💖💙 and don't forget to subscribe to my channel✔.
Can you give the code for per distance 30 cm... please...means the led will glow after every 30 cm
For that just set the if statement to distance > 30.
@@MrElectroUino you mean if ( distance
BROOOO THANK UUU SOOO MUCHH i was trying 2 do this but it never worked cuz the coding was wrong and the ppl on utube, ur the 1st person to make me get successful with this, i nearly threw away this perfectly good sensor cuz i never got it 2 work
Glad I could help
my code is not uploading the same code i have used
@@saminaalam2416 really?
Yes kindly help
@@saminaalam2416 im a bit unsure since a year ago ive been programming with arduino and now i havent done much with it
If we want a buzzer also to buzz and a single light will only glow , then what will be the circute diagram and the code ?
awesome man!!!!!!!!
very good idea
Thank you! Cheers!💖
does it work outdoor if theres sunlight?
Sweet...first if/else statement project complete! Thanks
Thanks for watching 💙💙
& don't forget to subscribe👍👍
Great video! I would like to ask if I don’t have the male to male jumper wire can i use the general purpose wire?
yeah you can use any wire
Thanks bro
Really...it was helpful for me.....Please sir could u share the code....it's very urgent...Tomorrow is the last date for project submission
Can you please check the video description for code link
in the second arduino screen did you only add those commands shown in the video? very cool the project, thanks for upload it
Yes, correct
Thank you man, it work 100%
DO you have any idea how to insert displey on board and read the value , it's about LED DISPLAY MAX7219?
Will make a video on max7219
@@MrElectroUino Great , i will appreciate that
Can I get the full code to this project please, thanks!
Check the description for code☺.
@@MrElectroUino sv p code
Hello, nice video. I am from Mexico, I would like to know the code of the project with the buzzer and the LEDs
Ohh Thanks. Can you send me the email address.
Hi brother Its a very good project. But I want to do some modification like I want to add two sensor and differnt light for another sensor. Can u pls help me out. I would really appreciate it. Again thanks for the idea and I also subscribed to ur channel
The same way you can do it. Just duplicate the code and change the pin defination.
Can u add code for both parts in description, which would help better and y is buzzer used
Kindly check the description for code link.
Is it possible if you don't use a breadboard, but use a decoder? and the lights use a 10 segment graph LED bar ?
Yes you can do.
Can you tell me the abstract and future enhancement of 2nd project?
2 project?
I mean distance measure with glowing LED
Yes
@@hammadkhan2926 Send your gmail id.
hammadkh789@gmail.com
thank you very much everything is great
Glad you like it!
thanks sir
this is the first project which code is in working condition.
Ohh thanks💖💖
Do subscribe😊😊
good video thanks for you
Hellooo, I hope you'll notice this comment. I was wondering why my components are blinking when I copied your code, but in the video it isn't. Have I done something wrong? Your reply would be greatly appreciated ^-^
Can you send the serial monitor, I think your sensor might not work. I need more information to point out the issue.
Contact me on instagram _mr_electrouino
Will it sense only mobile phone or anything that comes closer
Its worked with other things as well
Amazing making many vido
Really thank you so much
you saved my life
You are most welcome
can we do the same without resistors?
Yes, you can do that, but the resistor is used for protecting the LEDs. Without a resistor, the LED draws too much current and burns out. You can easily found a resistor in some old electronics components but make sure the values and don't forget to subscribe to my channel✔💙
Thank you for this video !! can you give me the coding and diagram for ultrasonic sensor led project? because i want use this as a guide for my final exam ..
Hello, I’m glad to here it. For code, check out the video description.
when i do the first part without led the distance = 0 why ?
I think your ultrasonic sensor is not working.
Thank you it was truly very fun to make and helps learn coding arduino
Glad you liked it!
@@MrElectroUino I used this project's circuit set up to help me make another one I called "Traffic Lights". This really helped me make it = ).
Can you put it a lcd display to show the results on screen
Thnkx for the vedio but can u plz share the circuit diagram and code
Check out my website for code and circuit diagram. www.mrelectrouino.com
What colour and size LEDs did you use? What was their voltage? How easy to add arduino speaker module into this project?
5mm size and Round Red, Green, Blue, Yellow, White Color. It requires 2 to 3V dc power supply. For more information and buy visit this link: www.banggood.in/custlink/m3vD4vsnhu
For the speaker connection, connect a positive terminal of speaker to Arduino pin 11 and negative terminal to Arduino pin ground(GND) and update the code and upload it. #subscribe it for more video......
if you getting any problem you can also contact me on Instagram:
instagram.com/_mr_electrouino_/?igshid=isb2pw365odq
@@MrElectroUino I only asked as I am currently ordering the parts to build one. I am going to use it as an ITC device if I can.
Okk
First tell me what is the meaning of ITC device
@@MrElectroUino its a device that can interact with spirits. I chase EVP, Electronic Voice Phenomenon, ITC is Instrumental Trans-Communication. I recently built a Rem Pod too.
Watch this video:-
th-cam.com/video/setjiVH0_IY/w-d-xo.html
Can we use led bulb instead of Buzer❔❓❔
Yes You can, but you have to add a relay for the bulb.
@@MrElectroUino ok thanks 😎👍🏻
@@MrElectroUino I am making this using home made cirkut can I use 3 led bulbs
@@MrElectroUino relay means the base you used❔❓❔
@@littleengineer8496 Relay is a electrical switch. It's use for high current appliances.
arduino only supply 5v, So we can use a relay to switch between 230v bulb AC.
You are doing a lot of experiments well and you have to do lot of projects for everyone
Yaa I'm working on it😊😊
Thanks
Thanks for this video... 😀..
Should I do coding first on arduino? or make the complete circuit then do coding on arduino
Make the circuit and upload the code.
Too good but the problem is the last part of your code for leds passes quickly moreover "upload the code" those words causes obstruction i can see clearly. Where can i get clean code?
yyeeesss thank uuuuu
FOUND IT
const int trig = 12;
const int echo = 13;
const int LED1 = 8;
const int LED2 = 7;
const int LED3 = 6;
const int LED4 = 5;
const int LED5 = 4;
const int LED6 = 3;
const int LED7 = 2;
int duration = 0;
int distance = 0;
void setup()
{
pinMode(trig , OUTPUT);
pinMode(echo , INPUT);
pinMode(LED1 , OUTPUT);
pinMode(LED2 , OUTPUT);
pinMode(LED3 , OUTPUT);
pinMode(LED4 , OUTPUT);
pinMode(LED5 , OUTPUT);
pinMode(LED6 , OUTPUT);
pinMode(LED7 , OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(trig , HIGH);
delayMicroseconds(1000);
digitalWrite(trig , LOW);
duration = pulseIn(echo , HIGH);
distance = (duration/2) / 28.5 ;
Serial.println(distance);
if ( distance
Nice
Sir i have a doubt
Can i use arduino nano instead of uno??
Isn't both same???
Does this same code works on nano also???
Yes it will work same for arduino nano.
Hi, I’m not sure if you are still looking at the comment but I’m doing a project like this but making it work with a dmx light.
The ultrasonic sensor was not powerful enough to detect someone from a range so I’m going to be using a vl530x. I’m wondering how I can do the same project able to control the light power depending on distance with the vl530x
Hii, Yes you can do this project with this module. There is library for this sensor you need to use for do this project.
@@MrElectroUino hi I got to making the sensor work on its own now I’m just trying to figure out how to make the dmx shield and the vl530x work together. If
@@Fahimbkt sorry but I don't know much about dmx shield.
Thank you so much this really helped ❤️
Glad it helped!
It fails to upload what is the problem? + I can’t find the port COM5
Very Good...
👌👌👌👌
Thanks😊😊
@@MrElectroUino Welcome, Please see my videos also
Is there a reason why , when I change the power source from the blue wire to the 9v battery it no longer functions like it's supposed to ? It only glows
It depends on how would you connect 9v battery to Arduino.🔌
Thank you sir you help me a lot
I glad to help you 😊👍.❤️
Nice info, thanks for sharing it :)
Welcome 🤗
Great video 🤓🤓
I have a question, why did you divide by 28.5 ??
For getting the distance in cm.
Thanks for watching...💖😎
Why when it come to hardware, my led become dim?
bro please help it isnt working for me, only 5 LEDS are working and its just stationary it isnt blinking. It is just on and not moving
Contact me on instagram: _mr_electrouino
This project is great, but how can I get the code for this project ?
Check out the description for code.
Ok thanks😍
@@mohammadhammad6227 DO SUBSCRIBE 😍
i have a doubt what is the range 9600 is that mean the range of the serial monitor
that can tally?
Yes it's use for serial monitor to communicate with arduino uno.
how could i reeplace the leds with a 7 segment display?
Hello 👋
If you want to connect the lcd then check out my website. I already made a tutorial on it.
Bro can i ask you I follow you copy you code but why still wrong?
Have you getting any error?
you can contact me on instagram: _mr_electrouino
Hi Sir,I will make this project. code was working,led was was showing distances.but one problem,all led was blinking I will put obstacle opposite of senser led was not blink.what is the problem of blinking?
Contact me on instagram..._mr_electrouino_
what is that mean
Can I have the complete code sir
Check the video description for code or visit mrelectrouino.com
the 2nd one with leds are coded using hard coding, right? is it possible to code the same program using arrays, if statements and for loops?
Yaa it's possible with this...
@@MrElectroUino may i have insight to how that way of coding works. i tried but got confused halfway through the code, Thank you!
what if we dont use resistors? cz i dont have resistors
Hey there, Resistor is use for protecting the leds.Without resistor the LED draws too much current and burns out. You can easy found a resistor in some old electronics component but make sure the values.
I just need it so when you go close up, It'll have a red light, and when the sensor senses nothing, it has a green light. Can you tell me how to do that, please?
Just set the distance for leds. when to off and on.
in my serial monitor only "0" i bing diplayed repeatedly. What to do?
Maybe your sensor is broken or you did some thing wrong.
Check your circuit again.
maybe using rgb led saves some digitalPins ,becuz it can be green red blue or wahtever color in just one led
Yes you are right if you want to add more components else having multiple leds is good way to understand the distance between an object.
Hi Will This Work With 100 Ohm Resistors?
Yes It will work but it can be damage the led if led is turn on for long time. So I suggest you to use high ohm resistor.
I am doing the same thing with one led light, so when the sensor will find a object placed within less than 10 cm then it will turn on the light bt when i am connecting the circuit the led is glowing and when i am putting a object in front of the sensor the led is turned off why? But i have distance written "if(distance
Could you send me your code So First I have to check it.
Arduino Uno R3 able working this project ?
Yes it will work
Q: does the sensor works if pointed upwards ?
Yes its work but you have to change the sensor direction in upwards.
sir how we get the code and circuit diagram in which one buzzer is also active;
Check out my website. I have written a blog on it. There you will find code with circuit diagram
Brother can we use Mobile to give code. Is the code available in online?
Yes you can, You can use arduinoDroid app for upload the code. Its Avaliable on playstore.
The code link is onto my website.
Can I use 480ohm resistor?
Yes, you can but the bright of the leds is low.
@@MrElectroUino Ok thanks
2:14 I have an error shows "duration" was not declared in this scope. May I know what's the problem?
Plz copy full code from the link.
bro i want all the code please
Please check description for code link
Thank you bro@@MrElectroUino
I finished the code and uploaded but what app do you use to chck the sensor?
the same as the coding app?
Same arduino IDE used to check the sensor value.
For that Goto and click on serial monitor
Don't forget to subscribe💖✌
i keep getting zero for distance even though the wiring and coding is the same :( is my sensor broken???
Maybe your sensor is broken or you did some thing wrong.
Nice. How to control water tank level with motor output.
Hii, The same way you can use it as water level indicator.
Hello if I want to do the same thing using RaspberryPi and in python programming give me suggestions!!
th-cam.com/video/L90WS-ptnvI/w-d-xo.html
Visit this link for get the distance of an object after that use if loop for comparing the distance and turn on/off the led.
@@MrElectroUino can u just explain me the code!
@@Joshi_aarya How can i do that.
visit this link for understand the code.
pimylifeup.com/raspberry-pi-distance-sensor/
@@MrElectroUino explain means just write it down!! Btw now I got it thank you so much 👍
@@Joshi_aarya My pleasure : )
Fantastic bro
I'm glad you like it 😊❤️❤️
Wonderful but I can't get the code plz help me in code sir
Hey, Check out my website for the code.
I also want to add that LCD distance showing screen with this LED light structure can u help me with that
I already written a blog on this topic. So check out my website for code.
How much cost for all the material required in this
This whole project can be achieved with the elegoo arduino super starter kit. That is around $30-40 USD.
Can i get the programing it was not clear to me please🤗🤗i need it imidiatly...❤
Hi I am actually trying out this project but it ain’t working for me can u pls help😢
Yea sure... You can contact me on Instagram _mr_electrouino
Can you send me a program to this Project because i cant swe what is on your screen?
Thanks for watching.
Code link is in video description.
hi I have subscribed to your channel, can I get the Arduino code for this project please
Thanks for subscribe 💙💙💙
Check description for code you will find a link.
Thank you so much
Welcome 🤗
why my serial monitor not showing the distance? it keep showing 0 value. i follow all your instructions and your coding but still not get it. even i try only the sensor.
Check the circuit connection.
@@MrElectroUino i follow absolutely like yours. the simple circuit. not show the distance at my serial monitor.
Hi .In ur code the distance is messured in cm?
yes👍
sensor all the time returns 0, what can be wrong?
I want to ask why you put it on 13 and 12 pin and not in analog pin
That's because the echo pin of HC-SR04 receives a pulse of very short duration,a pulse that has a value of 5v. Its not possible to get a pulse with analog pin.
What letter is after print
I am not getting it?
Where is the code and circuit diagram ???
It's better to keep in description
The code is already in the description.
What is the resistance of the resistors?
It's a 220ohm resistor.
Is there anyone here getting this error code here?
Arduino: 1.8.13 (Windows 7), Board: "Arduino Uno"
Sketch uses 3234 bytes (10%) of program storage space. Maximum is 32256 bytes.
Global variables use 190 bytes (9%) of dynamic memory, leaving 1858 bytes for local variables. Maximum is 2048 bytes.
An error occurred while uploading the sketch
avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
The first step is to verify the Uno is presented on COM3. Remove the Uno. Start Device Manager. What serial ports are listed? Insert the Uno. Wait a few seconds. What serial ports are listed?
Hello! Can I ask a question?
Hello, yeah sure