LabVIEW Interface for Arduino Blog

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW/Arduino/SparkFun Color Light Sensor

ChristopherS
Member

This is my first blog post/code share so please don't hesitate to let me know if it can be improved.

I was tasked with validating an LCD screen brightness and RGB quality. Fortunately Sparkfun has a color light sensor http://www.sparkfun.com/products/10701.

I followed the connection instructions found in the Arduino example sketch and made a few minor modifications to the example code (sketch with my edits can be found on the block diagram of the VI, make sure you have the Wire library installed in your IDE) so that the Arduino outputs the RGB and light values about every 200 ms instead of on request.

  • This VI (LV2012) reads CSV from the port, converts them to 8 bit numbers, renders the values in a color box and records the values in an array of clusters. 

  • There is also an offset/tuning adjustment for each color, RED, GREEN, BLUE that are fun to play with.

  • The "CLEAR" value is supposed to be a light measurement but I haven't tried to convert it to Lumens yet. Right now it's expressed as an 8 bit number like the RGB values.

  • The original sketch has a calibration function and I've bypassed it, if you're trying to make very fine measurements you may want to begin with the original sketch and go from there. I'm just performing a rough validation of RED, GREEN, and BLUE

One more thing: Don't bother connecting the LED pin on the sensor board, it is so close to the sensor that everything gets washed out and only "white" is returned.

ReadColorLightSensorp.png

Comments