What is recommended color recognition sensor in the following two cases:

  • To determine the color of the floor while the robot is moving (multi-color line follower).

  • To determine the color of an object in distance 10cm at least.

For both cases above, I am looking for a sensor so that I can get values like (R: 252 , G: 217 , B: 0) not only red, green or blue as an result, and no problem with small errors.

  • Why analog? Just curious ...
    – user31481
    Oct 18 '17 at 20:52
  • @LookAlterno e.g. (R: 252 , G: 217 , B: 0)
    – Abdulkader
    Oct 18 '17 at 20:56
  • That's looks digital to me. Analog means you are reading a voltage at an input pin. Please, clarify editing your question.
    – user31481
    Oct 18 '17 at 21:21
  • Why analog? Digital ones are far more common and some give more sensitivity and accuracy than the Arduino ADC can give.
    – Majenko
    Oct 18 '17 at 21:27
  • @LookAlterno How many pins do you need to read this three values as digital output? 3 * log2(256) pins !!
    – Abdulkader
    Oct 18 '17 at 21:28

You have a conceptual error. You don't need n wires to transmite n bits of information. If you use a serial protocol, one wire or two is enough to transmit information of any size: you just send one bit after another.

Just think: you are downloading sketchs in your Arduino thru a cable with only 4 wires ...

Most sensors (and modules) for Arduino use I2C or SPI to transmit commands/information in digital format. You can learn a lot in this tutorial that covers I2C, SPI and USB.

A quick search on Aliexpress show me this APDS-9960 sensor

APDS-9960 sensor

The sensor provide ambient light and color measurement, proximity detection and non-contact gesture detection. The APDS-9960 has built in UV and IR blocking filters, four separate diodes sensitive to different directions, and an I2C compatible interface.

Pins: VL (optional power to IR LED), GND (Ground), VCC (power to APDS-9960 sensor), SDA (I2C data), SCL (I2C clock), and INT (interrupt). Each APDS-9960 also has a detection range of 4 to 8 inches (10 to 20 cm).

It works with 3.3V.

  • Sorry for the conceptual error, thanks a lot.
    – Abdulkader
    Oct 18 '17 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.