My attempt to determine the linearity of the sensor with a pwm’d led failed… I assumed the integration time of the sensor would be much longer than the frequency of my pulses, but it’s apparently not long enough. My readings are all spikey and useless.
I took a cue from Maxx and tried testing some Rosco gray gels that were marked 25%, 40%, 50%, and 70%. The result for the clear channel was nothing like what you’d expect for the given markings, but after I thought about it for a while I noticed that all the Rosco gray gels (which have their frequency responses labeled nicely!) have spikes in transmittance near 700nm. So the clear channel reading is pretty much always going to be different than the percentage rating on the gel, because its frequency response also peaks at 700nm, tapering off toward 400nm. If its frequency response were flat, or if the gel’s response were flat, you could take the rating and measurement at face value.
So, since I couldn’t be bothered to do multiplication of frequency responses functions just to for this experiment, I just looked at the Blue channel readings instead, because the response of the sensor is <20% for the top half of the spectrum, and for the bottom half of the spectrum the Rosco gels are more-or-less flat-ish.
The result?? The blue and green sensors were just a few percent off from linear, when tested with these gels. The red might be too, but I can’t tell because I don’t have any test input I know enough about.
I’m hoping that increasing my led pwm frequency with a 20mhz crystal on my sad little PIC should be enough to get a reliable input for testing.
I tried using my monitor to display varying hues just for kicks and found that the sensor picked up its flicker as well. But I would not want to use the monitor as test input anyway, because its output has been gamma corrected by some unknowable amount (?) and doesn’t show linear intensities when given linear grays to display (true/false??)
I have new respect for the folks who design digital cameras and copiers/printers…
I’d been trying to make the Avago-based color sensor working at least, connected to my Diecimila without knowing the logic-level adjustment(5v-3.3v) is a must.
Therefore, I’ve just purchased the Skinny(3.3v logic, SFE) to avoid the logic level mismatch of the Arduino Diecimila. However, I still have hard time uploading the program to the Skinny using Arduin USB Mini v03.
I understand your Freeduino works fine for color data acquisition.
I’ll appreciate it how you have connected the Freeduino to the evalution board, if you don’t mind.
I have a quick question – I’ve noticed the footprint of the Avago color sensor is greatly increased by all the regulators and passives to interface with 3.3v. While the datasheet lists 2.6v as typical, the range is from 2.5v to 3.6v. Has anyone yet tried this with just straight 3.3v?
Also, I’m curious if having multiple regulators significantly lowers noise more than, say, using a couple of different small-valued capacitors?
(The board I’m designing is very tiny, and every part counts, so I’m trying to see if I can safely remove some of the extra hardware).
From my experience a linear regulator will suppress all the noise on the input voltage, at least for me this is hard to achieve with only caps.
And of course, this sensor is sensitive to noise. Initially I was using only 1 reg for the analog, digital, and on board led, this gave really poor results.
Doing anything with the led made the output data get a lot of noise. Moving the led out of this improved a lot the noise level, getting 2 regs for analog and digital improved a tiny bit more the noise level.
I also found the sensor to be very sensitive to noise. I have had no success with caps so I was about to alter the design of my project so that everything shuts off except for the mcu that reads the sensor data, then switches back on when it’s done… :-/
Though it is really cool to plot the rgb data in a 3d cube and see the noise as little poufs of points for each physical color sample… heh
rfordh:
First of all, the SFE Skinny should be perfect for running this sensor. You would need no level conversion since you can run them both at 3.3V.
When using the SFE skinny or wee, are pins 4 and 5 still used to communicate with I2C sensors? If not is there anything different that needs to be done?
The data represents thirty or forty samples per color square. I sampled the first two while the circuit powered some other stuff, note the really cool oscillations about the real color point. The rest were taken after I unhooked the rest of the circuit heh. The data still has a tiny bit of noise (which is why there are little dots instead of just lines).
The kewl thing is that the data makes a circle-ish spiral-ish shape, which it should since the first nine colors are just different hues, and the next nine are the same hues but less saturated.
well I have been trying to get this going for two days now and I still can’t get my head around it. I can get my red, green and clear targets near 1000 but no luck with blue and that piddly led.
My theoy may be wrong as to what I should be doing so here is my process.
Set the caps, set the int place the sensor on a white piece of paper (I am using it for reflective) set the registers and check the values. Im aiming for 800 now as I can’t get anything higher for blue.
Use these cap and int values set the trim. These change each time so must be working.
What is the purpose of offset adjustment? I was under the impression that after you did the calibration the sensor would read 0 for what I used for a white reference but it just gives me the same values as step one. If I put the sensor over a red object the value for the red channel drops is this what it is supposed to do?