rajesharihant
Posts: 1
Joined: Thu Jun 07, 2012 4:38 pm

Sensing of a fluid color.

Thu Jun 07, 2012 4:43 pm

Dear All,

I am looking for a budget/cheap solution for detecting color of a liquid flowing through a pipe.

This is required for generating Alarm based on liquid most probable color.

The probable colors of fluid is

a) colorless
b) yellowish
c) yellow
d) redish

accuracy required is moderate. mainly to generate alarms based on the color of the liquid.

Please suggest if you have any solution to this. with approximate price range.

Rajesh Jagadishchandra Kothari
Senior Project Engineer
Engineering Division

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Sensing of a fluid color.

Thu Jun 07, 2012 6:30 pm

Does this have anything to do with detecting ammonia and nitrates in water by any chance?

Ive got the idea that various types of photodiode or solar cell or even a photo resistor respond differently to different wavelengths. If you can guarantee the level of brightness of a white light emitter and the volume of the liquid is fixed you should in theory be able to determine what colour light is getting through the liquid to the detector. So in other words, pretty cheaply I would have thought.
Last edited by morphy_richards on Thu Jun 07, 2012 6:46 pm, edited 1 time in total.

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Sensing of a fluid color.

Thu Jun 07, 2012 6:32 pm

You could use a "color sensing" chip attached to a clear section of the pipe.

The TAOS TCS3200 color sensing chip is under $4 in unit quantities. You input the R,G,B,I selection and the output is a frequency proportional to the selected channel: red, green, blue and overall intensity. You'd have to design and build the board that it mounts on.
http://www.digikey.com/product-detail/e ... ND/3095267
http://media.digikey.com/PDF/Data%20She ... 00,210.pdf

Or for some more money, you can get a pre-built module, including white LEDs for illumination:
http://www.parallax.com/Store/Sensors/C ... roductName

User avatar
morphy_richards
Posts: 1603
Joined: Mon Mar 05, 2012 3:26 pm
Location: Epping Forest
Contact: Website

Re: Sensing of a fluid color.

Thu Jun 07, 2012 6:54 pm

that would be a good solution. Just out of interest , I've never tried this but how good are RGB LEDs at being able to emit an exact colour? If they can do that you could cycle through colours and see which are absorbed by the liquid (ie. Receiver detects nothing)

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Sensing of a fluid color.

Thu Jun 07, 2012 7:13 pm

this gets a little bit more detailed. R,G,B LEDs emit a relatively narrow band of wavelengths, so that type of color sensor would correspondingly be sensitive to just those specific wavelengths. The color sensor chip I mentioned uses color filters over a broadband sensor so it is selecting out a much wider portion of the spectrum in the R,G,B regions. For this reason it is more general-purpose, in case you want to detect some color feature that falls between the R,G,B wavelengths emitted by color LEDs. If you have broad spectral features in your color-of-interest, then either one would work.

The other drawback to RGB LED sensors is you have to control the illumination; ambient light will wash out your signal. But if you can do that, then it would work.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Sensing of a fluid color.

Fri Jun 08, 2012 8:27 am

A cheap option is to use a USB webcam with a white light source shining through a transparent pipe.

Use a program such as cheese to take a still picture every few seconds and analyse the average colour of the picture.

Phil Spiegel
Posts: 210
Joined: Tue Jan 17, 2012 8:17 am
Contact: Website

Re: Sensing of a fluid color.

Fri Jun 08, 2012 7:31 pm

As others have suggested: there are 2 basic approaches - but both could be optimised if the specific absorbtion spectra were known of the intended compounds; so as to use a suitable (range of) light sources:

Aproach 1 the 'camera' method: RELY on a continuous white light spectrum (eg a bulb not a White LED or fluorescent phosphors as these are discontinuous spectra - although there are some types with multiple phosphors to give a good 'daylight' effect). Then its a case of white-balance assessment in comparison to a reference area to avoid / compensate for drift. But a camera has sensors based around 3 colours, as well as an Infra-red response if not filtered out. - instead of the complexities of a camera imaging chip, 3 or more colour sensors could be used (as with Telecine machines for film transfer to TV ('Camera-telecine (USA) =area, line-array =CCD or spot (CRT))

Approach 2: The monochromatic light source which is 'switched' across the required range - eg from Infra Red (which can be very informative) to Ultra-Violet, via simple Red, Yellow Green and Blue LEDs, whilst simply measuring the light transmission with a sensor capable of covering the range - but even this could be switched to match as required ... all that's needed is calibration for the expected chemicals.

User avatar
rew
Posts: 429
Joined: Fri Aug 26, 2011 3:25 pm

Re: Sensing of a fluid color.

Sat Jun 09, 2012 8:55 pm

Canon have a set of scanners that do the lighting based trick.

My first scanner had a mechanical filter that would switch between color passes.

The newer canons have a bunch of RGB leds and they light the object with those three colors in sequence and use a monochrome sensor. If you require only one pixel, shining a simple RGB led through the liquid should allow you to figure out the color in software from this information....
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

rikosaita
Posts: 3
Joined: Mon May 25, 2015 9:48 am

Re: Sensing of a fluid color.

Sat Jun 13, 2015 9:19 am

jbeale wrote:You could use a "color sensing" chip attached to a clear section of the pipe.

The TAOS TCS3200 color sensing chip is under $4 in unit quantities. You input the R,G,B,I selection and the output is a frequency proportional to the selected channel: red, green, blue and overall intensity. You'd have to design and build the board that it mounts on.
http://www.digikey.com/product-detail/e ... ND/3095267
http://media.digikey.com/PDF/Data%20She ... 00,210.pdf

Or for some more money, you can get a pre-built module, including white LEDs for illumination:
http://www.parallax.com/Store/Sensors/C ... roductName
can you give me an example code for reading RGB channel in python for raspberry?

Return to “Automation, sensing and robotics”