I have a project. The project comprises an RGB LED, a light tight tube, and a photo resistor at the other end. There is a slot in the tube, into which I can put Photographers filters
Here is the filter book
each filter comes with a graph, showing the transmission of light (100% to 0%) over a range of wavelengths, (300 to 800 nm, which can be considered blue through to red to all intense purposes)
here is the setup (there is a hole vertically though the wooden block)
Upon button press, the LED scrolls through its colour range. I did this by starting fully blue, fade green up, then once green is 100%, fade blue down, and once blue is at 0%, fade red up, followed lastly by fading green back down again.
the sketch fades "5" of the "255" per cycle of the processor.
on each cycle it prints the PR resistance to the serial port.
there is a 20ms delay on each cycle to let the LED and PR settle (and so one can observe the colour change)
Now on this here graph, (Y axis Analog read from the PR, X axis is sketch cycle).
No filter, is self explanatory, no filter. I kind of expected it to be a bit rough, as the PR has limitations in detection, and the LED certainly wont output pure light
OP (Opaque) is the dark line at the bottom, and involved placing black card in slot, effectively darkening the PR completely.
Now the colour graphs are "OK" upon comparison to the provided filter graphs, but in the loosest sense. The basic form is there, but little more.
Can some one please provide a suggestion as to where the spikes on the OP line are coming from please ?
I think if i can eliminate this "noise" i will get much better results.
FYI, The PR is set up with one side wired to the A2, and Ground, and the other to +5V via a 10k ohm resistor
Maybe i can eliminate the spikes with some mods to the sketch, or is it more likely to be a physical thing?