LDR Object Counter

by yhtomitsy in Circuits > Arduino

18777 Views, 18 Favorites, 0 Comments

LDR Object Counter

IMG_20140926_122533.jpg

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.

Controlling an LED

LDR LED blinking.PNG

To get started i controlled an LED using analog input from the LDR.

The setup included:

· Light dependent resistor (LDR)

· 22k resistor

· Led

· Arduino uno

You can view the video here.

Video

LDR + LED + Arduino

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.

Requirements

· LDR

· 22k resistor

· Arduino uno

· WS2812b neopixel matrix

Setup

IMG_20140926_194029.jpg

The setup is as shown in the photo. You can learn how to connect the neopixel matrix to the arduino board here.

The rest of the setup is similar to the one shown here or the one for LED control using the LDR with the exception of the LED. The full tutorial, including the set up, and code can be found here.

Video

LDR Object Counter