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!!
for those who dont know the code const int trig = 12; const int echo = 13; int duration = 0; int distance = 0; void setup() { pinMode(trig , OUTPUT); pinMode(echo , INPUT);
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
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.
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
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.
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, 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
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✔💙
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.
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
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?
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
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.
@@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.
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.
ruclips.net/video/L90WS-ptnvI/видео.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.
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
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?
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.
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.
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?
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!!
for those who dont know the code
const int trig = 12;
const int echo = 13;
int duration = 0;
int distance = 0;
void setup()
{
pinMode(trig , OUTPUT);
pinMode(echo , INPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(trig , HIGH);
delayMicroseconds(1000);
digitalWrite(trig , LOW);
duration = pulseIn(echo , HIGH);
distance = (duration/2) / 29.1 ;
Serial.println(distance);
}
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
Thank you so much
Welcome 🤗
Amazing video, highly recommend, well explained and works perfectly. Thanks a lot
Thanks for watching 😊😊💖💙
thank you sir you saved my life sir my project is super otherwise proffesor will angry at me sir appreciate it
Im glad to hear it ❣️
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.
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
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
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.
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
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
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.
awesome man!!!!!!!!
very good idea
Thank you! Cheers!💖
does it work outdoor if theres sunlight?
Can you add buzzer and lcd on it
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.
when i do the first part without led the distance = 0 why ?
I think your ultrasonic sensor is not working.
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
You deserve a like my guy
Thanks man💖💙 and don't forget to subscribe to my channel✔.
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.
Will it sense only mobile phone or anything that comes closer
Its worked with other things as well
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✔💙
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.
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
Sweet...first if/else statement project complete! Thanks
Thanks for watching 💙💙
& don't forget to subscribe👍👍
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 ?
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.
Hi
I have a question, please can i know how to do this project but with soldering machine
@@MrDestinyproduction yes you can do it, contact me on instagram
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.🔌
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.
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
thank you very much everything is great
Glad you like it!
Thank you so much this really helped ❤️
Glad it helped!
What letter is after print
I am not getting it?
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
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.
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.
thanks sir
this is the first project which code is in working condition.
Ohh thanks💖💖
Do subscribe😊😊
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
Why when it come to hardware, my led become dim?
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.
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 to upload the code
or a better qestion where is the code
NEVER MIND 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
bro i want all the code please
Please check description for code link
Thank you bro@@MrElectroUino
Should I do coding first on arduino? or make the complete circuit then do coding on arduino
Make the circuit and upload the code.
Very Good...
👌👌👌👌
Thanks😊😊
@@MrElectroUino Welcome, Please see my videos also
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.
Really thank you so much
you saved my life
You are most welcome
What is the resistance of the resistors?
It's a 220ohm resistor.
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!!
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 = ).
Thank you sir you help me a lot
I glad to help you 😊👍.❤️
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.
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.
Able to do with piezo buzzer?
yes Its possible, if you want the code send me your Gmail address.
good video thanks for you
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
Q: does the sensor works if pointed upwards ?
Yes its work but you have to change the sensor direction in upwards.
Can I use 480ohm resistor?
Yes, you can but the bright of the leds is low.
@@MrElectroUino Ok thanks
from where did you get com 6
On Arduino IDE Goto Tool -> port and select your COM port. By the way COM Port should be different for you.
Nice info, thanks for sharing it :)
Welcome 🤗
Thanks for this video... 😀..
Hello if I want to do the same thing using RaspberryPi and in python programming give me suggestions!!
ruclips.net/video/L90WS-ptnvI/видео.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 : )
Thank you ❤❤❤❤
Welcome 💜
Welcome 🤗
sir for me first 3 led are are not turn on
Make sure that your connection is right.
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.
can i also have the code with the 7 led attached already? i really need it
Please check out website for code
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.
Can you put it a lcd display to show the results on screen
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.
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
Can we do this on esp8266
Yes, it is possible.
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
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
Can I get the full code to this project please, thanks!
Check the description for code☺.
@@MrElectroUino sv p code
Can i use 1k ohm resistor
Yes you can but the brightness of LEDs is less.
only 1st two led is blinking.others are not evening lighting
Did you follow all the steps?
the selected serial port _
does not exist or your board is not connected
............. I got this error what will be the solution?
Just install the arduino driver. IF you getting any problem contact me on instagram _mr_electrouino_
@@MrElectroUino Please bro can you share a code coz in the last moment you swipe quickly so I can't see the code perfectly
@@prempanchal7721 check out the description you find a code link. Do subscribe😊
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
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:-
ruclips.net/video/setjiVH0_IY/видео.html
is there any way to do this without a breadboard? we wanna make a tree with leds attatched to it
Use copper wire to build this project.
Can I change tha digital pin for tha led
Yes you can but you have to define the pin in code to.
DON'T FORGET TO SUBSCRIBE 💙💖
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.
the first 2 LED's arent turning on, pls help
Make sure that the LED is connected right or it not damaged.
Can I have the complete code sir
Check the video description for code or visit mrelectrouino.com
how I am find out its coding for upload in aurdino
Check out the video description for code.
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.
mine colors echo as orange and does not work
Have you checked the serial monitor for the output?
What is the colour code for the resistors?
It's a 220 ohm four band resistor. The color is RED, RED, BROWN, and GOLD.
Thanks a lot
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💖✌
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
Howcome it only senses from 1m and not 4m?
In hc-sr04 data sheet is showing 4m of sensor detection.
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
Hi .In ur code the distance is messured in cm?
yes👍
can i get code and circuit including buzzer?
Send me your email address.
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
Best in whole RUclips i did it
Ohh thank you 💕💕
@@MrElectroUino 😋😋