Creative Commons images are CC BY-NC-SA 3.0

39.95

added to your
shopping cart

quantity
In stock 106 in stock
39.95 1+ units
35.96 10+ units
31.96 100+ units

Description: Atlas Scientific is on a mission to make high-quality sensors for environmental monitoring available to everyday hackers and makers. All of their kits are easy to calibrate and connect to your microcontroller-based project.

Color light sensors are awesome devices for everything from environmental sensors to general robotics. They can be used to monitor slowly changing events like algae blooms or leaf death, or to determine light absorption through a medium. But for all their utility, they have some flaws. First off, they can be complicated to interface to since RGB data often has to be derived using complex signal processing. Secondly, they're less than rugged, and when you want to deploy one in the field you need a device that can stand up to the weather. Even moisture in the air can make an unprotected sensor unreliable.

Atlas solved these problems by embedding the light sensor in a rugged housing below a layer of transparent epoxy which protects the sensor from moisture while still allowing light to get in. The resulting light probe is water- and dust-proof, sleet and ice tolerant, non reactive in salt water and will readily sink when submerged. On top of all that, it provides both RGB level (in 8-bit RGB format) and light intensity (in lux) as simple comma separated strings over RS-232!

Features:

  • R,G,B data is in true 8-bit RGB format from 0-255
  • light intensity is output in lux (lx)
  • lx given for R ,G and B as well as full spectrum lx
  • RGB color data and lx can be output simultaneously
  • lx range from 0- 3,235 lux
  • Light saturation indicator if lx is over 3,235
  • Three different output modes:
    • RGB only
    • Lx only
    • RGB and lx
  • Data output is a single comma separated string
  • Simple RS-232 connectivity (voltage swing 0-VCC)
  • Harsh environment ready: NEMA 6P and IP 68 rated
  • Wide operating temperature range: -40 Celsius to +85 Celsius
  • Simple instruction set consisting of only 5 commands
  • Reading time: 620ms
  • Wide operating voltage range: 3.1V to 5.5V
  • Shock resistant to 16 mega Pascals

Documents:

Comments 17 comments

  • This would have made the RGB Fiber Communication experiment much easier!

  • I don’t know if this will help anyone but… One of the things I noticed about this sensor is when I connect it to a PIC32 UART port, if I try to program the pic or pause it when it is running in debug mode the sensor quits sending data. Often it will not start back up until it is power cycled. To solve this I put a 100K resistor from the white wire to Vcc. When the PIC is reset the pins go from being driven to being in a high impedance state, making the color sensor see a start bit.

    Hope this is helpful.

  • Can I connect it to a pc !?, can someone give a code example using C++ !?

  • // Copyleft Zach Vorhies 2014
    // No rights reserved.
    // Tested on an ArduinoMega. Connect pins to RX and TX.
    // Usage:
    //  ColorDetector<HardwareSerial> cd(Serial3);
    //  void setup() { cd.begin(); }
    //  void loop() {
    //    if (cd.Update()) {  // True when new readings have occured.
    //      cd.PrintValues(Serial);  // print values.
    //    }
    //  }
    
    
    template<class StreamT>  // StreamT == HardwareSerial or SoftSerial.
    class ColorDetector {
     public:
      ColorDetector(StreamT& s)
         : input_(""), stream_(s),
           r(0), b(b), g(0),
           r_lx(0), b_lx(0), g_lx(0), total_lx(0),
           saturated(false) {
        input_.reserve(kStrLen);  // Upto 36 characters for the rgb+lx data.     
      }
    
      void begin() {
        stream_.begin(38400);
        stream_.write("M3\r");  // Sets mode0 of the sensor.
      }
    
      // Returns true if new values were parsed.
      bool Update() {
        while (stream_.available() > 0) {
          //if the hardware serial port_3 receives a char 
          //get the char we just received
          char inchar = (char)stream_.read();
          //add it to the inputString
          input_ += inchar; 
          if(inchar == '\r') {
            saturated = input_.indexOf('*') != -1;
    
    
            // Time to parse out the string into values.
            int* values[] = {&r, &g, &b, &r_lx, &g_lx, &b_lx, &total_lx};
            const int values_size = sizeof(values)/sizeof(values[0]);
            int i = 0;
    
            char cpy_str[kStrLen];
            input_.toCharArray(cpy_str, kStrLen);
            input_ = "";  // resets the input.
    
            char* p = cpy_str;
    
            char *str;
             // delimiter is the comma
            while (i < values_size && (str = strtok_r(p, ",", &p)) != NULL) {
              String cpy = str;
              *values[i] = cpy.toInt();
              ++i;
            }
            return true;
          }
          // No update yet.
          return false;
        }
      }
    
      void PrintValues(Stream& output) {
        int* values[] = {&r, &b, &g, &r_lx, &b_lx, &g_lx, &total_lx};
        const int array_size = sizeof(values) / sizeof(values[0]);
        for (int i = 0; i < array_size; ++i) {
          output.print(*values[i]);
          if (i < array_size - 1) {
            output.print(",");
          }
        }
        if (saturated) {
          output.print(",<saturated>");
        }
        output.println();
      }
    
      int r, b, g;
      int r_lx, b_lx, g_lx, total_lx;
      bool saturated;
    
     private:
      static const int kStrLen = 38;
      String input_;
      StreamT& stream_;
    };
    
    
    ColorDetector<HardwareSerial> color_detector(Serial3);
    
    void setup() 
      Serial.begin(9600);
      color_detector.begin();
    }
    
    void loop() {
      if (color_detector.Update()) {
        color_detector.PrintValues(Serial);
      }
    }
    
  • hi, i ’m not much aware of electronics. i want to build a color mixer which ’ll mix 3 primary colors (RGB) to give the exact color sample placed before the sensor. i.e., give red, blue and green proportions of the sample color. can this sensor be used to do so.. pls.. help

  • Hello,

    I just received this sensor, and it feels and looks great. But I cannot seem to get any sensible readings from it using the Arduino along with the sample code. A simple Google search got me to the conclusion that nobody got it to work.

    Can you please post a working sample code that can atleast tell us the RGB and lx values it sees?

    Thank you in advance, Ali

  • None of the sample code works (completely or reliably) on an Arduino Uno (R3, latest IDE is v1.5.4). The problems with getting the serial communication to work with this device are discussed here: http://forum.arduino.cc/index.php?PHPSESSID=bg08293jtk53uprjmclqluav73&topic=146380.0
    It appears that this may be because of a timing conflict between SoftwareSerial and Serial, but as of Jan 17, 2014, no one has posted sample code that works completely. If anyone here has simple code that works, I’d love to see it… :/

  • Awesome sensor, however the read time is 1200 ms; 620 ms is a mistake in the datasheet.

  • Any idea when these might be available again? Thanks.

  • i want to ask about the connection of this sensor..this sensor need another board to connect to arduino mega 2560 or not?if this sensor need other board to connect the arduino,what kind of board?i really need to know because i want to buy this product and i from malaysia.if this product do not work as i expected and i cannot get the output that i want,it will really cost me a lot of money..

  • 620ms seems like quite a long time for an instruction to complete. For higher speed color detection, this should probably be avoided.

  • Guys, 0 – VCC is not a valid RS-232 serial level. If you connected this to a proper RS-232 port, it would not work. Please correct this in the spec as it is misleading and some people would take it to mean you can connect it to a PC or something similar directly.

    RS-232 specifies that the voltage must swing between a negative voltage and a positive voltage to represent logical 0’s and 1’s. The minimum swing normally accepted for this is from -5V to +5v with anything in between being ignored (i.e. 0V).

    • 0-Vcc levels will be recognized by most modern RS-232 hardware. As long as the polarity is correct and this isn’t inverted like TTL, it will work. I can personally attest to these levels working.

  • My biggest complaint about the device is that the surrounding area of the sensor is not matted out. The chip breakout board is not even color neutral and the solder joints are shiny, allowing potential contamination of data if the device is positioned close to the source of light being analyzed. Even the housing is shiny!

    I work with optics and matte black is standard for every device related to light processing, minimizing the bounce and diffusion.

    Perhaps something to consider for the next revision of this thing.

    • Should that matte-r though (pun intended)? I get the impression that the probe is only designed to detect the color of what is directly in front of it, i.e. liquid. How could the reflections off of the housing/solder/etc. even be perceived by the sensor, assuming of course that the container of liquid you are measuring isn’t itself reflective.

  • Is any information available on the field of view or detection range?

  • Can anyone tell where to find more information about the 5 commands this supports. I seem to have it working in a basic way but would like to see what else it supports

    Doh, found it — linky above


Related Products