openobject.org

S3200642 Colour Sensor Report - project 4

From Physical Programming

BEK CRAWFORD'S COLOUR SENSOR REPORT


How the device works

Colour sensors are designed to either detect the slightest variation of a colour or to detect specific colours .

Colour sensors use a white light emitting LED, as well as three RGB filter receivers to give accurate colour readings. It works by holding the object in front of the sensor, and the three LED's will shine onto the surface (“pulses'), one at a time and record the brightness values. The colours are then reflected back into the sensors and compared to the programmed colour values and the programmed responses. The more precise the colour sensors is, the more waves of pulses it will send.

For example, a blue object will read the highest value from the blue LED, but low values otherwise. To tell the difference between an orange object and a yellow object? The orange object is closer to red, than the yellow one is, so the orange will reflect more red light than the yellow one will.

While some colour sensors can be taught to recognise only one colour, other versions can be programmed for up to 10 separate colours to one sensor with an output for each colour.


What is the device typically used for?

  • Colour sensors are used to precisely match colours, to identify near colour matches on different surfaces. They can identify invisible markers on products, which is ideal for error proofing package lines.
  • Automotive carpet manufacturers use colour sensors to match carpets to car mats, where the naked eye may not be able to see any difference. Using colour sensors in this way ensures high assembly quality and and can save money by preventing a colour production error, which would lead to the entire batch being unusable and rejected.
  • A colour sensor can be a simple and inexpensive way to detect the presence of markings on a package.
  • Variously coloured lids on canisters (such as paint) are sorted using a colour sensor to send them to the appropriate packing station.
  • Colour sensors can be used to confirm the presence of pills or other products in clear blister packaging and to check their colours. If a pill is missing from a blister pocket, the colour sensor does not see the reflected colour response that was taught, and the package is flagged.

How can it be interfaced with the Arduino micro-controller?

(Referenced from http://itp.nyu.edu/physcomp/sensors/Reports/DIYColorSensor “DIY Colour Sensor Tutorial”)

To use a colour sensor to gain input and then perform an action (such as changing the colour of your screen background, or a graphic on the screen) you will need to wire together...

  • 1 bright RGB LED and 1 Photo Cell (type of resistor.)OR I colour sensor
  • 1 Breadboard (construction base for electronics)
  • Switches or buttons
    • 2 buttons, for setting the white (maximum) and black (minimum) balance values
    • 1 toggle switch, to tell Arduino to run the colour sensing function.
  • A piece of black foam (something that isn't reflective or shiny), for black balancing
  • A piece of white paper of foam board, for white balancing
  • An Arduino
  • Some resistors and wires
  • A small black box with a hole in it (not absolutely necessary but you'll get better results from the sensor if you block out ambient light with a black box.)

Method

1. Enter the code into the program you are using to operate the Arduino.

2. Plug your colour sensor into your breadboard.

3. Plug everything into the appropriate pins in Arduino.

  • Colour sensor into analogue pin 2.
  • Red, green, and blue pins of the LED into digital 4, 5, and 6.
  • White and black balance into digital 2 and 3, and sensor on/off switch into pin

4. Establish minimum (black) and maximum (white) colour values.

  • Hold the white piece of foam board above the photo cell and LED, being sure its completely covering both of them.
  • Hit the White Balance button. The red, green, and blue LEDs should quickly blink one after another. When this happens the values have been recorded.
  • Do the same thing with the Black Balance button and the piece of black foam.

5. Run the program!


Examples of interactive projects using this sensor technology

You can change the background colour of your screen by using the colour sensor. As you change the value of the analogue sensors (by placing an object in front of the sensor), the background colour will change: See http://www.arduino.cc/en/Tutorial/VirtualColorMixer

You can build a robot that uses a colour sensor to follow a particular coloured line. See http://www.societyofrobots.com/sensors_color.shtml

You can make your own colour sensor by following this tutorial: http://itp.nyu.edu/physcomp/sensors/Reports/DIYColorSensor


References

Society of Robots, 2005-2010, Colour Sensors Tutorial, viewed 13 August 2010 <http://www.societyofrobots.com/sensors_color.shtml>

Tom Draper Balluff Inc, 09 June 2008, How to Use Color Sensors to Improve Product Quality, Design World 2010, viewed 13 August 2010, <http://www.designworldonline.com/ArticleDetails.aspx?cid=221&id=2133>

Pepperl+Fuchs (Aust) Pty Ltd, 14 August 2009, Colourblind no more — contrast and colour sensors for packaging and converting applications, 2010 Westwick-Farrow Pty Ltd, viewed 13 August 2010, <http://www.processonline.com.au/articles/34258-Colourblind-no-more-contrast-and-colour-sensors-for-packaging-and-converting-applications->

ITP Sensor Workshop, Page last modified on 22 April 2008, DIY Color Sensor, ITP,viewed 13 August 2010, <http://itp.nyu.edu/physcomp/sensors/Reports/DIYColorSensor>

Arduino, 28 Juuly 2010, Arduino Virtual Colour Mixer, Arduino, viewed 13 August 2010, <http://www.arduino.cc/en/Tutorial/VirtualColorMixer>