I had several LDRs lying around in my room so i decided to do a simple project with one of them. I made an LDR object counter. By the way for those who do not know, LDR stands for light-dependent resistor. If you have never used it before, take a few minutes to learn how to connect and use it with an arduino. Moreover, your knowledge of voltage dividers will come in handy when working with the LDR.
Step 1: Controlling an LED
Step 2: Video
Step 3: LDR Counter
The LDR counter was a little bit complex than the led control setup. This is because i used a neopixel matrix to display the number of objects that had passed through.
The setup works on a simple principle. The LDR's resistance increases when there is no incident light shining on it. So, every time an object passes by and blocks light to the LDR we get a lower reading on the analog pin. Every time this happens the counter increases by one, just as shown in the video.
Step 4: Requirements
· 22k resistor
· Arduino uno
· WS2812b neopixel matrix
Step 5: Setup
The setup is as shown in the photo. You can learn how to connect the neopixel matrix to the arduino board here.