Difference between revisions of "Sensor-Color Detector"

From Microduino Wiki
Jump to: navigation, search
(Document)
(Development)
Line 46: Line 46:
  
 
==Development==
 
==Development==
===Preparation===
+
===Program Download===
*Make sure you build Microduino IDE or refer to: [[Microduino Getting started]]
 
*Core selection
 
**1. Adopt [[Microduino-CoreUSB]] or [[mCookie-CoreUSB]] as the core.
 
**2. Adopt [[Microduino-Core]] or [[Microduino-Core+]] as the core plus [[Microduino-USBTTL]] as the program download module.
 
  
===Program===
+
*Download and unzip the program '''[[File:Sensor-Color Detector__Test.zip]]'''
[[https://github.com/Microduino/Microduino_Tutorials/tree/df0a1175ef707a5c541c6cf37efa4b83dbeb6030/mCookie_sensor/MicroduinoColorSensor MicroduinoColorSensor]]
 
  
 +
===Programming===
 +
{{Upload
 +
|nameA=[[Microduino-Core]], [[Microduino-USBTTL]]
 +
|nameB=[[Microduino-USBTTL]]
 +
|boardName=Microduino/mCookie-Core(328p), Atmega328P@16M,5V
 +
|fileName=Sensor-Color Detector Test.ino
 +
}}
  
*Define variable values; RGB reading range.
+
===Hardware Setup===
  #define redMax 32767
+
*Referring to the following diagram, connect the Sensor_Color_detector to IIC interface of '''[[Microduino-Sensorhub]]'''.
  #define greenMax 32767
+
<br>
  #define blueMax 32767
+
[[file:Microduino-sensorhub_I2C.JPG|thumb|400px|left]]
  int redValue,greenValue,blueValue;
+
<br style="clear: left"/>
  
*readRGB();    Read RGB color function
+
===Result===
 
+
*After download, open the serial monitor.  
*Reflect RGB value (0~32767) to (0.225); 
+
*Putting the sensor toward different colors, the serial monitor will print out the current RGB value in cycle.
  redValue=map(red, 0, redMax, 0, 255);
 
  greenValue=map(green, 0, greenMax, 0, 255);
 
  blueValue=map(blue, 0, blueMax, 0, 255);
 
 
 
===Hardware Buildup===
 
*Connect the sensor to the IIC interface of the Sensorhub with a wire.
 
[[Microduino-Sensorhub]]
 
[[file:Microduino-sensorhub_I2C.PNG|thumb|400px|center]]
 
[[mCookie-Hub]]
 
[[file:mCookie-sensorhub_I2C.PNG|thumb|400px|center]]
 
* Connect the core, Sensorhub and the Color Detector to a computer with a USB cable.  
 
* Select the right board and COM port, compile and download.  You can refer to [[AVR Core:Getting started]]
 
[[file:upload.JPG|thumb|800px|center]]
 
*Download the program above.
 
*Select the right port from Tools→Serial Port in Arduino IDE and then download program.
 
*Open the serial monitor after download. The console will print current RGB value circularly.
 
  
 
==Application==
 
==Application==

Revision as of 02:28, 9 November 2016

Language: English  • 中文
Microduino-ColorDetector

The product number of Sensor-Color Detector is: MSDT51

Microduino-Color detector is a color detection sensor.

This module adopts TCS3414CS color chip. Based on 8×2 filtered photodiode and 16-bit analog-digital converter, you can measure light or light reflection on the surface of an object to acquire color value.



Introduction of Sensor Pins

Sensor backpin.png
  • Pins of the sensor:
    • PIN1: GND
    • PIN2: VCC
    • General signal pins:
      • PIN3(IO1): digital/analog signal
      • PIN4(IO2): NC(null)
    • Special signal pins:
      • If it is IIC: IO1/IO2 are respectively SDA/SCL.
      • If it is soft serial port: IO1/IO2 are respectively tx/rx.
  • Special to Sensor-Color Detector sensor pins
    • PIN1: GND
    • PIN2: VCC
    • PIN3(IO1): SDA(IIC communication)
    • PIN4(IO2): SCL(IIC communication)


Microduino sensor can communicate with core module through the connection with Microduino-Module Sensor Hub.

Features

  • With high accuracy and sensitivity;
  • With low consumption, long service life and high stability;
  • Small and easy to install.

Specification

  • Sensor voltage
    • 3.3V~5V working voltage
  • Size of the sensor
    • Sensor of the board: 23.5mm*13mm
    • 1.27mm-spacing 4Pin interface connected to sensorhub
    • The CAD drawing of the sensor: File:Sensor CAD.zip
  • Technical parameter
    • Working temperature: -40 ~ 85 °C
  • Connection
  • This sensor can be connected to pin I2C of core.

Document

Development

Program Download

Programming

  • Follow the Software Getting Started Guide.
  • Select the Board, Processor and Port.
  • Click [File]->[Open], browse to the project program address, and click "Sensor-Color Detector Test.ino" to open the program.
  • After confirming all these items are correct, click "→" to download the program to the development board.

Hardware Setup

  • Referring to the following diagram, connect the Sensor_Color_detector to IIC interface of Microduino-Sensorhub.


Microduino-sensorhub I2C.JPG


Result

  • After download, open the serial monitor.
  • Putting the sensor toward different colors, the serial monitor will print out the current RGB value in cycle.

Application

Microduino-Color detector is suitable for environment color detection.


Project


Purchase

History

Pictures

  • Front
Microduino-Temp&Hum Front
  • Back
Microduino-Temp&Hum Back