Follows most of this through to the end. This was my first "programming" if you will and boy am I proud of the results. Your tutorial was one of the most satisfying I've ever had. Only thing different for me was that I used set pin 11 and I had a 3 prong photoresistor module. With a little experimentation and wire swapping I was able to figure it out. Thanks a bunch man!
This is probably the best video I've watched on this subject! Thank you!! I was driving myself crazy using gpiozero LightSensor value output with a 10 uF capactor (all I had). You've explained it in some really great detail!!!!
im using this in a project, it works so well (thanks for that i couldnt find anyone else who could actually do it) but on its first reading i keep getting massive spikes on the reading when i first press run, its fine after that but it messes with the rest if my code, how do i fix that?
Hey, this should work with various wavelengths. As for the question about getting absolute readings from the capacitor, I am not sure about how to go about this.
As far as I know, not with this approach because in this video we calculate how long it takes to charge the capacitor. However, you can create a photocell using the photoresistor by connecting it directly to analog input. Here's a link with more information about it, learn.adafruit.com/photocells?view=all. Keep in mind though that this is for Arduino but the process is very similar for Raspberry Pi.
@@Flopperam I read a comment and checked the wiring. Watched your video multiple times but in my opinion the wiring is like yours. If I plug the capacitor into the breadboard the python file is printing nothing. Not 0’s but nothing and then when I unplug it again there are some numbers showing up. I really don’t know what’s wrong there but thanks for your reply even though the video is years old.
Sometimes the legs of certain parts like capacitors can be switched, for e.g. longer leg could be positive or it could be negative. And last thing I would suggest is double checking the code of course. Just throwing possibilities out there.
Hey, the reason we set it to GPIO.LOW is because we are measuring the time it takes to become GPIO.HIGH. Naturally, with light, the resistor will reach GPIO.HIGH.
@@Flopperam Okay, I get that, but how come in the while loop you put if GPIO.input(...) == GPIO.LOW? Wouldn't you do if (Gpio.input(resistorPin) == GPIO.HIGH)?
@@Dnsx_plus The reason is that we are waiting for GPIO.input(...) to be equal to GPIO.HIGH so that we can see how long it took to become GPIO.HIGH. If we replaced the condition like you said, then the while loop would most likely be skipped over at the first check every time since it will take at least some time for the photoresistor to charge.
@@Flopperam ahhh, but the thing is, by the time the if condition is true, we can do the time subtraction, right? I'm sorry, I'm confused, but I kind of get what your saying.
Follows most of this through to the end. This was my first "programming" if you will and boy am I proud of the results. Your tutorial was one of the most satisfying I've ever had. Only thing different for me was that I used set pin 11 and I had a 3 prong photoresistor module. With a little experimentation and wire swapping I was able to figure it out. Thanks a bunch man!
This is probably the best video I've watched on this subject! Thank you!! I was driving myself crazy using gpiozero LightSensor value output with a 10 uF capactor (all I had). You've explained it in some really great detail!!!!
im using this in a project, it works so well (thanks for that i couldnt find anyone else who could actually do it) but on its first reading i keep getting massive spikes on the reading when i first press run, its fine after that but it messes with the rest if my code, how do i fix that?
Sorry for the late response but I would double check that you don't have a faulty photoresistor or transistor as well as any loose connections.
Great tutorial !
Hi I did everything you said to do in the video but when I run it, it comes up with an error saying theres "No module named 'RPi'"
Try running "sudo apt-get install python3-dev python3-rpi.gpio"
Can you code some type of timelapse camera shutter option that is synchronized with the LDR sensor?
Sorry for the late reply but I believe you should be able to do that.
Great video. How do I get absolute values [W/cm^2] from the readings of the capacitor? Does this work with all wavelengths?
Hey, this should work with various wavelengths. As for the question about getting absolute readings from the capacitor, I am not sure about how to go about this.
Hey, i wanted to ask what unit are the numbers that the sensor is giving?
Seconds, since the program just reads how long it takes for the capacitor to be charged.
can you use a battery instead of a capacitator?
I think for this, technically yes, but don't quote me on it.
@@Flopperam if so, how do you? also thank u for the reply :)
I'm not too sure as I wouldn't recommend a battery for this use case.
Dude, is it possible to configure this LDR sensor without a capacitor and still identify the value in the terminal?
As far as I know, not with this approach because in this video we calculate how long it takes to charge the capacitor. However, you can create a photocell using the photoresistor by connecting it directly to analog input. Here's a link with more information about it, learn.adafruit.com/photocells?view=all. Keep in mind though that this is for Arduino but the process is very similar for Raspberry Pi.
Thanks 🤜🤛
what if i change the capacitor into mcp3008?
Sorry for the late response. Don't quote me on this but it should be fine.
What is the unit of the values coming from the sensor?
In this case it's just seconds or maybe milliseconds since we're just measuring how long it takes for the photoresistor to detect sufficient light.
@@Flopperam thanks
hey would you be open to make a tutorial on request?
Can i replace raspberry pi with arduino uno with same coding’s ?
Not with the exact same code since I used Python here but probably similar yes. Wiring should also be similar
Nice intro
beste videeo it workked ze firsté time
When are your plans to go over match making? and quieing and adding friends to a game
this is about the ue4 gamelift tutrial
Thanks
all I get as output is 0, what did I wrong?
Hey, I would suggest double checking your wiring setup.
@@Flopperam I read a comment and checked the wiring. Watched your video multiple times but in my opinion the wiring is like yours. If I plug the capacitor into the breadboard the python file is printing nothing. Not 0’s but nothing and then when I unplug it again there are some numbers showing up. I really don’t know what’s wrong there but thanks for your reply even though the video is years old.
Sometimes the legs of certain parts like capacitors can be switched, for e.g. longer leg could be positive or it could be negative. And last thing I would suggest is double checking the code of course. Just throwing possibilities out there.
Did u solve it? Please help me
AT 6:03, how come the resistor pin has to be GPIO.LOW for it to be charged? Wouldn't it have to be GPIO.HIGH
Hey, the reason we set it to GPIO.LOW is because we are measuring the time it takes to become GPIO.HIGH. Naturally, with light, the resistor will reach GPIO.HIGH.
@@Flopperam Okay, I get that, but how come in the while loop you put if GPIO.input(...) == GPIO.LOW? Wouldn't you do if (Gpio.input(resistorPin) == GPIO.HIGH)?
@@Dnsx_plus The reason is that we are waiting for GPIO.input(...) to be equal to GPIO.HIGH so that we can see how long it took to become GPIO.HIGH. If we replaced the condition like you said, then the while loop would most likely be skipped over at the first check every time since it will take at least some time for the photoresistor to charge.
@@Flopperam ahhh, but the thing is, by the time the if condition is true, we can do the time subtraction, right? I'm sorry, I'm confused, but I kind of get what your saying.
That's a good point, you could do the time subtraction after the while loop instead of inside the while loop.
I'm only getting 0's
Hey, can you double check your wiring? If the wiring matches the diagram linked in the description then please let us know.
I am getting 0s too, have you solved your problem?
Did u solve it? Please help me
First