Go Down

Topic: Detecting the color of small wire (Read 1 time) previous topic - next topic


Hi there,
I perform 100% functional test for dc fan products by connecting it to the testing terminal (integrated with a dc power supply). Unfortunately, the fans were not enclosed with wire connector, just connected by stripping up the wire insulator. Since it was dc fan, connection polarity is important to prevent electrical damage to the fan. And recently, I found some of the fans were broken up due to wrong polarity connection, and potentially there will be more. I plan to built up a reverse polarity detector to prevent the current flows if the polarity is wrong.

I plan to use a color sensor, an arduino and a relay. So, if the color sensor confirm the wire color is OK, arduino will activate the relay and the current flows, otherwise the current will not flows.

The lead wire diameter is about 2-5 mm and the distance to the sensor may be 5-15 cm. Usually fans lead wire were set up as follow;
red for VCC
black or blue for GND
yellow or white for sensor line.

I want the color sensor being able to check the red wire and yellow/white wire. Now my problem is. I don't know how to start especially to pick up the correct color sensor and integrate it with the arduino.
Appreciate if somebody would like to help.


Will a diode on the fan do the job? A diode restricts current flow so only one direction is allowed. If you clip a diode on the red lead of your fan then there will be no current if the polarity is wrong. What does your test setup look like?
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


Will a diode on the fan do the job?

Or a rectifier bridge of four diodes - http://images.blog-u.net/img/diodes-bridge-rectifier/ - then it doesn't matter how the connection is made it will allways work.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


I would use low-voltage, low-current resistance measurement. I am sure that if you use a multi-meter, the measured resistance will be different in opposite directions. Pick some safe voltage and current and do the measurement each way to determine the connections.

KE7GKP, sorry I'm not fully understand about your explanation.  :|
How do you set up above condition?

Regarding the diode, the fan is fully equipped with rectifier diode on its VCC line. But not on its sensor line. Since the sensor was designed in state of open collector, hence if a diode is mounted in reverse bias, the sensor system will not work.

Again, Do we really can't find a high frequency response of a RGB color sensor?   :(


A bog-standard phototransistor is plenty fast for anything involving mechanical moving parts.
If you put a green filter in front of it, it becomes a "greenness sensor".
If you have three phototransistors, one with red, one with green, one with blue filters, you can read all three, and based on the relative readings, compute the observed colour in RGB space.

Would that do what you need?


Try looking into this device


"The ColorPAL from Parallax is a miniature color and light sensor that can double as a color generator with its RGB LED. When sensing color, the ColorPAL uses its LED to illuminate a sample one color component at a time while measuring the light reflected back with a broad-spectrum light-to-voltage converter. The amount of light reflected from the sample under illumination from each red, green, and blue LED can be used to determine the sample's color. For the ColorPAL to detect the color of a subject, the subject must be reflective and non-fluorescent. The color of objects that emit light (e.g. LEDs) cannot be detected."
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up