Это видео недоступно.
Сожалеем об этом.
Automatic Night Lamp using LDR | Tinkercad | Beginner Arduino Project 1
HTML-код
- Опубликовано: 21 июн 2021
- Hello and Welcome to Learn It Easily. In this video, you will learn to make Automatic Night Lamp Arduino Project Using LDR in Step by Step manner.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Automatic Night Lamp Arduino Project Using LDR
Requirements:
1 x Mini Breadboard
1 x Arduino UNO R3
1 x LDR ( Photoresistor) Sensor
2 x 1 kΩ resistors
1 x Red LED
Website Used:
www.tinkercad.com
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
I hope you enjoyed this tutorial. I'll see you in the next one.
Thanks for watching it.
#Arduino #programming #electronics #tutorials #projects #makerspace #coding #DIY #c++ #python #Robotics #Automation #IoT #CircuitDesign #Prototyping #sensors #english #best
You all can post your doubts here !!!
I will definitely answer all your comments.
thx man u really helpd me
You're welcome!!!
Happy to hear it was useful.
Hy sir
Can i still add morning alarm to this project?
Yes, you can add an alarm clock to this project.
Sir which software are you using to build cct. Please reply
I am using this website:
www.tinkercad.com/
Also the design can be implemented in a real Arduino device. The website provides a virtual simulation environment for Arduino for free.
@@learniteasily321 thank you so much
Sir, can you tell me the app that you used?
Sure. I am using this website:
www.tinkercad.com/
Also the design can be implemented in a real Arduino device. The website provides a free virtual simulation environment for Arduino.
Sir it should be if(c>500) then led low ... right? Led should turn on when its dark right?
Actually when their will be dark, the resistance of LDR will increase. I googled the same and found this:
When the light level decreases, the resistance of the LDR increases. As this resistance increases in relation to the other Resistor, which has a fixed resistance, it causes the voltage dropped across the LDR to also increase.
So at night, value of c will increase because c stores resistance. I wrote in the code:
if(c
Tell me if you want to know anything more !!!
sir, can I know what the function of "Serial.begin(9600);" and "Serial.println(c) ;" in the coding part. And also the 500 represent for what in this part "if(c
hope you can reply ASAP, I need to explain it for my presentation on this project in next 2 weeks
@@muhdwalid7949
1. Serial.begin(9600) is used to start communication between board and photoresistor/LED. 9600 represents the speed of data to be sent. You can also change the value
2. c = here we have stored the value of analogRead(A0) in c. analogRead will tell us the value of Voltage at A0. I am finding voltage of A0 because you can see the photoresistor/LDR is connected to A0 using red wire.
3. Serial.println(C) = It is used to convert the voltage value you stored in previous step to human readable form. It converts to ASCII so that it can be compared in the next step.
4. c
my led is switched on even in light
please help
i have to submit the project tomorrow
This is not possible. You have to make sure that all the connections are made correctly. The light only turns ON whenever there is dark. If you click on LDR, you will get a slider which can be moved to left or right. Moving to right means increasing brightness. If brightness is increased, LED turns OFF.
Please verify all the connections from this circuit diagram:
www.tinkercad.com/embed/kbwURvVLI0R?editbtn=1
Also make sure you copied the exact code:
drive.google.com/file/d/1wf7UQyFO9yLvidfwUr0pyKmcVwTLlvC6/view
Sir how to add 3 to 4 leds in the circuit pls reply
I have developed a modified code for you to add 4 leds into the circuit:
void setup() {
Serial.begin(9600);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT); // Set pin 8 as output for LED 2
pinMode(9, OUTPUT); // Set pin 9 as output for LED 3
pinMode(10, OUTPUT); // Set pin 10 as output for LED 4
}
void loop() {
int ldrValue = analogRead(A0);
Serial.println(ldrValue);
if (ldrValue < 500) {
digitalWrite(7, LOW); // Turn off all LEDs
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
} else {
digitalWrite(7, HIGH); // Turn on all LEDs
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
}
}
For connecting the leds, you need to do this:
Connect the long leg (the positive one) of each LED to a different digital pin. Pick pins 8, 9, 10, and so on. Attach a resistor before each LED's long leg to keep the current safe. Finally, connect the short leg (negative) of each LED to the ground on your breadboard.
Tell me if you want to know anything more !!!
Thank you sir ❤
What does int c actually give the resistance or light intensity reading?
For ldr when light falls on it resistance decreases right?
int c = analogRead(A0);
c is a variable which stores the resistance. You can also see the red wire is connected to LDR to AO whose value we are storing in c.
And yes light falling is inversely proportional to resistance. In simple terms, If Light increases then resistance decreases and vice versa.
When the light level decreases, the resistance of the LDR increases. As this resistance increases in relation to the other Resistor, which has a fixed resistance, it causes the voltage dropped across the LDR to also increase.
When this voltage is large enough, it will cause the Transistor to turn on. The value of the fixed resistor will depend on the LDR used, the transistor used and the supply voltage.
Tell me if you want to know anything more !!!
Sir if it becomes dark it's resistance decreases and lamp turns on rigth but the resistance will again increase from the light of the lamp right? then how to overcome this?
Actually when their will be dark, the resistance of LDR will increase. I googled the same and found this:
When the light level decreases, the resistance of the LDR increases. As this resistance increases in relation to the other Resistor, which has a fixed resistance, it causes the voltage dropped across the LDR to also increase.
When this voltage is large enough, it will cause the Transistor to turn on. The value of the fixed resistor will depend on the LDR used, the transistor used and the supply voltage.
@@learniteasily321 thank you.
Tell me if you want to know anything more !!!
@@learniteasily321 Sure sir thanks.
@@learniteasily321 Actually I just had some toggling issue like when It is dark the light tuned on and the LDR took the input and the light was again turned off, so light was getting on and off within short period of time, so I just added timer for taking the readings and it pretty much solved the issue.
how can we do the same thing but with 2 ldr with gm90?
I think there is no need to use 2 ldrs while designing automatic night lamp.
Also I have never heard of gm90. Maybe you wanted to write "SG90" which is SG90 Servo Motor?
Tell me if you want to know anything more !!!
Sir can u plz tell the code how to set timer to led so that it should after certain time
These might help you
create.arduino.cc/projecthub/user16726/control-your-lights-with-arduino-and-a-relay-3dcfc0
create.arduino.cc/projecthub/nexsus/blinking-of-two-leds-with-the-delay-of-0-5-sec-19b76d
forum.arduino.cc/t/switch-on-a-led-for-5-sec-and-turn-off/112548/5
@@learniteasily321 Thank you brooo