Тёмный

Arduino Light Sensor Tutorial: Learn to Setup a Photoresistor 

Arduino My Life Up
Подписаться 2,1 тыс.
Просмотров 138 тыс.
50% 1

In this video I go through the steps on how to setup an Arduino light sensor circuit and the code to make it come alive. This electronics part is extremely handy if you need to make a project that needs to be able to detect changes in light.
Full Tutorial: arduinomylifeup.com/arduino-l...
The parts that you will need are basic and come in most electronics starter kits so you’re likely to already have them. If not, you can pick up all the parts for pretty cheap with the exception of the Arduino Uno.
The circuit is incredibly simple so you shouldn’t have many issues putting it together. If you do find it a little hard to follow, then be sure to check out the full circuit diagram over at the website linked above. It shows you exactly where parts can be placed and the correct connections.
If you have never heard of a photoresistor it is small part that changes its resistance depending on how much light is on it. For example, if it is dark then the part will have a very high resistance, typically up to about 10 megohms. In the light it has a very low resistance of only just a few hundred ohms.
The code is very easy to follow and much like the circuit shouldn’t be too hard to get working. We simply get the value from the light sensor input and then compare it to a static value. It is likely you will need to update these static values depending on the environment you will have your setup in. For example, inside or outside.
If you’re having trouble setting it up correctly be sure to take a look at setting up some debugging and monitoring the code using the serial monitor. This should be able to help you pinpoint the problem you’re likely having.
I hope that you have been able to set up this Arduino light sensor without too many problems. If you have an issue, I have got something wrong, have feedback or anything else then please feel free to leave a comment below or over at arduinomylifeup.com

Наука

Опубликовано:

 

26 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@user-ed3se9bt9v
@user-ed3se9bt9v 3 месяца назад
Thanks, it worked for me. I used standard light sensor with 1K ohm resistor and 220 ohms resistors with LEDs.
@zeeshanhaider9741
@zeeshanhaider9741 3 года назад
Very helpful, thanks a lot gentlemen, and upload more about electronic.
@Paulzmusic
@Paulzmusic 8 лет назад
Keep making Videos!
@Bianchi77
@Bianchi77 2 года назад
Creative video, thanks for sharing :)
@ms.jeremypacillos7993
@ms.jeremypacillos7993 3 года назад
Nice video. Please add schematic diagram so beginners like me can easily follow. Thank you. 👍🏼
@melonate8781
@melonate8781 7 лет назад
Thanks works great
@HaraldNilsson
@HaraldNilsson 6 лет назад
nigga u just arduinoed my heckin life up
@oldguy8177able
@oldguy8177able 4 года назад
good job mate
@alexgomez-xx8pl
@alexgomez-xx8pl 3 года назад
Thank you mate
@CrazyCoupleDIY
@CrazyCoupleDIY 7 лет назад
Thanks a lot
@Ky13_
@Ky13_ 6 лет назад
So I recently bought a tiny Christmas tree for my room that came pre lit and wanted to add a light sensor to it. How would I go about this? The lights simply plug into an outlet in the wall and turn on I was thinking maybe adding an arduino somewhere in the mix I just don’t know exactly where to begin and what the code would look like?
@fuuastinnovatia2058
@fuuastinnovatia2058 7 лет назад
Hello! can you tell me why we use Analog value "50"??
@lukmanalghdamsi3189
@lukmanalghdamsi3189 Год назад
i am planning on using a light sensor with some pir motion sensors so they light up the stairs when someone walks in when it's dark. i am also thinking on making the light led strips on every step and it lights up with cool motion, like it when someone comes from downstairs it lights up from down to the top or if the someone comes from the top it lights from the top to the bottom.
@basavarajtamanagoudru579
@basavarajtamanagoudru579 6 лет назад
Is there any project which can sense both motion and light
@bronsonsihole2882
@bronsonsihole2882 4 года назад
Could u give a solution for the deadly shooting in sandy hook, stoneman Douglas high school, etc using arduino?
@samuelmunzer8950
@samuelmunzer8950 6 лет назад
if i wanted to code two of these light sensors on one board how could i duplicate this code
@adrianpineda2955
@adrianpineda2955 Год назад
Thankyou.
@Nuskeros
@Nuskeros 2 года назад
Connection with a laptop/PC is necessary only while coding right? I want to use light sensors outside, far from any connectivity, to measure direct sunlight (lux>32,000) Is it possible to set up the light sensor system with a battery for power and a memory device to store lux data? Also, once maximum luminosity is exceeded, will I keep receiving the maximum measurement or will it crash or something? Thank you.
@Therandomguyshorts
@Therandomguyshorts 5 месяцев назад
Yes they give u a batter that has 3 Aa batteries roque Dd and two wires red and black so with that battery they give u a big battery thing which has 2 pins on top and u can connect that to get power or if h don’t have that battery use the big battery thing with that 3 Aa Bettie’s inside connect the red wire into the left and black to right if that doesn’t work try switching g the wires black right and red left and connect that round port to the port on aurdino And it shall work u don’t need a memory card it already knows but don’t press the reset button and if h do u have to redo the code again NOTE: aurdino isn’t water proof so if it’s raining u might want to clean it up fast cuz if water goes in the ports pin holes it will not work
@charlese40187
@charlese40187 7 лет назад
Great video. Could you please not use music with the video or maybe turn the music down lower. subbing
@sushipackdushi1
@sushipackdushi1 Год назад
agreed haha
@weerobot
@weerobot 5 лет назад
Schematic would be easier...Good Video...
@N1tTROxUMP45
@N1tTROxUMP45 5 лет назад
got 'greenLedPin was not declared in this scope'?
@electronicsolutionindia3538
@electronicsolutionindia3538 5 лет назад
nice
@nqtiolandz8293
@nqtiolandz8293 3 года назад
in the part where it says else{ it tells me to add "if" at the start
@amitayamar
@amitayamar 7 лет назад
why in your program you wrote: if (analogValue
@deepshulpradeep2549
@deepshulpradeep2549 7 лет назад
Would a 270E resistor work properly for the photo resistor אמיתי עמר
@johnmummert8164
@johnmummert8164 7 лет назад
Looking forward to view your project of opening a chicken door in the morning using a photocell and motor
@emceha
@emceha 5 лет назад
This video would be so much better if you included diagrams, besides, great work.
@ShomiTheGreat
@ShomiTheGreat 7 лет назад
Wait, why not make a common cathode connection for 3 LEDs and put a single resistor between cathode node and gnd? That simplifies the circuit and you need just a single resistor for LEDs.
@caseylocke4474
@caseylocke4474 5 лет назад
As long as only one LED is on at a time, my (very limited) understanding is this would work just fine.
@lorenalima3833
@lorenalima3833 6 лет назад
which logic gates can i use in this circuit?
@johnjohn7379
@johnjohn7379 8 лет назад
Hey, I'm just confused about one thing. Why are we adding a resistor in series with the photoresistor? What's the purpose of this?
@fernandomolinamenor1840
@fernandomolinamenor1840 8 лет назад
The aim is to limit the current flowing through the photoresistor in order to avoid an overload.
@zvezdan__
@zvezdan__ 6 лет назад
It is not in series, it goes to the ground wire. It's a voltage divider.
@obtron
@obtron 5 лет назад
we are taking the voltage across the resistor connected to the ground, now this voltage is dependent on the resistance of the photoresistor by V = (Vin*R)/(R+PR)
@caribbeanchild
@caribbeanchild 4 года назад
voice boy!
@thescreamthescream
@thescreamthescream 6 лет назад
but the circuit will function just properly without declaring all of those variables ,we only need one to read the signal from the sensor, :)
@jamesspaulding7580
@jamesspaulding7580 3 года назад
Didn't work for me... I'm a beginner anyways, so I'm sure I'll get better!
@ThatOneRobloxDev
@ThatOneRobloxDev 2 года назад
i think i blew the photoresistor, i used it with a 100 ohm resistor, so yeah, i blew it, it stays on red forever :(
@incubatork
@incubatork 6 лет назад
Can you try slowing down your naration and take a breath now and again, would sound a bit more human rather than robotic
@beanapprentice1687
@beanapprentice1687 4 года назад
slow the speed of your video if you can't understand him
@shreyathakur1942
@shreyathakur1942 6 лет назад
Can someone help me with this ?
@janmartinsky9101
@janmartinsky9101 6 лет назад
Yes, just tell me your problem.
@Krazy0
@Krazy0 3 года назад
Yes, tell us the problem
@adrianpineda2955
@adrianpineda2955 Год назад
only 2 leds :
@caseylocke4474
@caseylocke4474 5 лет назад
1:44 - I do not understand the purpose of the 220 ohm resistor. I thought the photoresistor was acting as the resistor here? All I know is that's called a voltage divider and I cannot find ANYONE who can explain it where this beginner can understand it. Why can't you just push the 5V through one side of the photoresistor and measure the analog voltage coming out the other side of the resistor? 5V in will never exceed 5V out, so no damage to the ADR. I don't get it.
@hedikacem7674
@hedikacem7674 5 лет назад
the resistor is to extend result width of the photoresistor in arduino
@obtron
@obtron 5 лет назад
we are measuring the voltage across the 220 ohm resistor rather than the photoresistor because if we use the photoresistor alone then despite the resistance (which varies with light) the voltage measured across the photoresistor will be 5v (only current varies) , so we build a voltage divider and Vout=(Vin * R)/(R+P) now as P varies vout varies and we get analog values, by connecting a POT instead of 220ohm we can vary the sensitivity.
@vasanthvsj51
@vasanthvsj51 6 лет назад
chiii
@Zackckk
@Zackckk 7 лет назад
smell
@daviddavidsonn3578
@daviddavidsonn3578 6 лет назад
can someone translate this to English please?
@caseylocke4474
@caseylocke4474 5 лет назад
What is that supposed to mean? What language are you speaking right now? Pretty sure it's the same as he's speaking. ;)
Далее
Sensors - which one to use
17:06
Просмотров 1,3 млн
БАТЯ И ТЁЩА😂#shorts
00:58
Просмотров 2,1 млн
Она Может Остановить Дождь 😱
00:20
Arduino DS18B20 Temperature Sensor Tutorial
9:16
Просмотров 83 тыс.
Arduino Temperature Controlled Fan Speed
24:30
Просмотров 448 тыс.
LED Control with LDR (Photoresistor) and Arduino
4:22
Просмотров 424 тыс.
Coding Adventure: Boids
8:35
Просмотров 1,5 млн
MAKE THIS BUTTON BOX | 32 FUNCTION w ENCODERS
7:38
Просмотров 2,1 млн
Новодельный ноутбук Pocket386
1:16:17
Новые iPhone 16 и 16 Pro Max
0:42
Просмотров 1,2 млн
Ноутбук за 20\40\60 тысяч рублей
42:36