Hello, I am looking into using an LDR sensor for distinguishing between different "patterns" of light blockage.
The LDR sensor will be obstructed by an object in a regular frequency, thus blocking the light at different intervals. I am considering to make a series of (tangible) objects that have different "gaps" in them revealing light to the sensor, and distinguishing between them based on the frequency of their patterns. I want to be able to identify each object.
Would it be possible to translate the patterns the LDR sensor detects into some sort of discrete value based on how many times and how often light is blocked in a given timeframe?
It's possible, but harder to do right than it seems at first glance unless everything is perfectly repeatable.
To get the data, you simply sample the LDR fast enough so you can catch the light/no light edges accurately enough (a photodiode would be a better choice, BTW). That's the easy part.
The hard part is comparing that signal to a set of reference signals to determine which part it is. If the part signals are very different, then it's not hard to do the comparison. If they are very similar, and/or the light scanning isn't always from the same angle or same distance, it will introduce variations that make matching to a reference much harder.
If you think about it the right way, it's basically a 1-dimensional Image Recognition problem.
The entire field of Pattern Recognition is based on techniques to do this.
To give out further details; I am working on an art installation for a college assignment, with this said, I am pretty new at Arduino so forgive my ignorance!
The device consists of a disc which will be placed on a 360 continuous servo.
My intent is to be able to tell which disc was placed on the servo, as there are multiple, and each of them need to have a different ID so I can have the proper feedback for each, in a way that is "immersive" and "mimetic" to a turntable device.
I figured a good way to recognise discs could be by a pattern, so I had the idea of cutting gaps into them, as to have light pass through and then be obstructed periodically, so I could use an LDR to track this. It would be placed on the platform underneath where the disc is placed, as to be obstructed by the disc.
Then, once the disc is placed it will begin spinning. I want to count how many times there was a gap (and count how many times the LDR sensor detected light) in a rotation, and thus assign an ID.
For example: 1 gap would be ID 1, 3 gaps would be ID 2. So on so forth.
The device of my installation closely resembles a turntable. I hope that clarifies it better.
Ah. That simplifies it considerably. You only need to be able to know when a revolution is complete. That can be done with a second sensor and a single, additional hole in the disk.
Or if the speed is constant enough, time how long it takes for a revolution and then just count how many pulses you see over that time interval.
Something I did for a science fair project when I was in 7th grade so figure maybe '63 or '64. I called SoC (Sound of Color) used a wheel with cut pieces of construction paper in multiple colors. I used a LDR and a small incandescent lamp. Light was reflected off different colors and the LDR was part of an oscillator so as colors changed the tone frequency changed. Colors could be distinguished by the tone frequency. I tried to have for example black and white side by side, I wanted big changes so as to be distinguishable. It got me to the finals where I did get 3rd place.
My guess is you only want/need Off or On as in the wheel is either transparent or not. You can use a reflective sensor. Then as mentioned rather than a LDR go with a photo transistor. You get pulses and count the pulses.
Thanks for the input Ron! That sounds pretty impressive to me for '64! I did not have phototransistors in my radar, I will look into considering that option. Much appreciated!