How to Use a Photoresistor (Light Sensor) with Arduino (Lesson #27)

preview_player
Показать описание
Photoresistors, also called photocells or light dependent resistors (LDRs), make great light sensors for Arduino projects where you only need a coarse measurement of light levels. Learn how to use one in this video.

0:00 introduction
0:49 sensor overview
2:07 circuit
3:58 code

#STEM #sciencebuddies #arduino #electronics #programming
*******************************
Connect with Science Buddies:

Рекомендации по теме
Комментарии
Автор

Finally, a tutorial in perfect english and instructions easy to understand (but sometimes a little too fast ).

ajdm
Автор

Literally the best videos on Arduino, I always come here first

TateIsaacs
Автор

Finally! after years of searching a fluent english language rushing through my ears! 😭 What a nice surprise!

rndmplay
Автор

Great video, thank you so much! I built that exact circuit and it's working wonderfully!

tmichlovitch
Автор

Thanks, I modified the code and wiring a bit to make a nightlught with high light level LEDS when it is dark. Automatically turn off when photo cell detects light.

zain
Автор

Good video, I would like to know what is the meaning of the sensor value (dimension and unit), thank you

thehypex
Автор

Thank you this is very helpful. I'm sending this to someone for. It's over my head. Basically what I am trying to get someone to create it to have a circuit that went so much light is hitting it. The circuit comes on. Definitely need to measure the light. Here is my application. I'm trying to solve and if it exist please point me in that right direction. We're building a home off grid and there are some appliances such as my deep freeze, that does not run all that often and if it is off for one to three days, it would be OK. I'm only wanting it to come on when it is fully sunny outside, so it does not run at night and it does not run on rainy days. There are other devices that I'm wanting to do the same with yet. This is the easiest application to speak to.

MartyHuie
Автор

I did exactly same and exactly same code, it doesn't work :( is there some kind of convention setting in ThinkerCAD for negative/positive etc. ?

isk
Автор

Thank you, its about time I find a guy who i can understand😭

y-it
Автор

The vilos ultimate starter kit has the resistor on the 5 volt (+) side which i also think is not intuitive . Thanks

yungrut
Автор

What can we do if we want to use the photoresistor as a button that turns the light on when pressed once and then turns it off when pressed again? I have such a night lamp and I want to make one myself.

deliciousredmango
Автор

int greenLedPin = 2;
int yellowLedPin = 3;
int redLedPin = 4;

int lightSensorPin = A0;
int analogValue = 0;

void setup() {
pinMode (greenLedPin, OUTPUT);
pinMode (yellowLedPin, OUTPUT);
pinMode (redLedPin, OUTPUT);
}

void loop() {
analogValue = analogRead (lightSensorPin);
if (analogValue < 50) {
digitalWrite (redLedPin, LOW);

}
else if (analogValue >= 50 && analogValue <=100){

}
else {
digitalWrite (greenLedPin, LOW);
}
delay (200);
digitalWrite (greenLedPin, HIGH);
digitalWrite (yellowLedPin, HIGH);
digitalWrite (redLedPin, HIGH);
}

delacruzmarianfayeagra
Автор

Please do a model for electromeric effect

venikavenkatesan
Автор

Hello. I have a similar setup but I have a problem. The photoresistor measures the outside light and when the light level is around the threshold value and the light starts to flicker. The photoresistor values vary over and under the threshold value. I trayed adding a 1 second delay but now the flicker is every second. What should I add to the code so this doesn't happen any more?

GeorgePantel
Автор

Thank you so much. I appreciate u brother

mwvqoji
Автор

Could you make a video using opt 101? Or refer me to some videos showing its working....i am using it but the value Fluctuates so much i dont know what to do

nohing
Автор

if it doesnt work try switching the HIGH with the LOW and the LOW with the HIGH

AyeshaKhurram-tuow
Автор

I built this project using a MEGA 2560.

ReDoG
welcome to shbcf.ru