Difference between revisions of "Crowtail- I2C Color Sensor"

From Elecrow
Jump to navigation Jump to search
(Created page with "== Description == Usually 4 digit display module is a 12 pin module. But in our Crowtail gadget, we utilize a TM1637 to scale down the controlling pins into 2 Crowtail pins....")
 
 
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
Usually 4 digit display module is a 12 pin module. But in our Crowtail gadget, we utilize a TM1637 to scale down the controlling pins into 2 Crowtail pins. It only takes 2 digital pins of Arduino or Crowduino to control the content, even the luminance of this display. For projects that require of alpha-numeric display, this can be a nice choice.
+
This module is based on the color sensor TCS3414CS with digital output I2C. Based on the 8*2 array of filtered photodiodes and 16-bits analog-to-digital converters, you can gain the color chromaticity of ambient light or the color of objects. Of the 16 photodiodes, 4 have red filters, 4 have green filters, 4 have blue filters and 4 have no filter(clear). With the synchronization input pin, external pulsed light source can provides precise synchronous conversion control.
  
'''Model: [https://www.elecrow.com/crowtail-4-digit-display.html  CT0060FDD]'''<br>
+
'''Model: [http://www.elecrow.com/crowtail-i2c-color-sensor-p-1523.html  CT0067ICS]'''<br>
  
[[File:Crowtail- 4-Digit Display1.JPG|400px]]
+
[[File:Crowtail- I2C Color Sensor2.JPG|400px]]
  
== Features ==
+
== Specification ==
*Compatible with Crowtail interface
+
*Crowtail compatible interface
*4 digit red alpha-numeric display
+
*16-Bit digital output with I 2C at 400 kHz
*8 adjustable luminance levels
+
*SYNC Input Synchronizes Integration Cycle to Modulated Light Sources
*Dimensions(mm):40.0(L)x20.0(W)x12.8(H)
+
*Operating temperature range -40°C to 85°C
 
+
*Programmable interrupt function with User-Defined Upper and lower threshold settings
== Application Ideas ==
+
*Dimensions(mm):20.0(L)x20.0(W)x13.6(H)
*Time display
 
*Stopwatch
 
*Sensors' input display
 
  
 
== Usage ==
 
== Usage ==
The following sketch demonstrates a simple application of digital display.
+
 
 
+
[[File:Crowtail- I2C Color Sensor1.jpg |600px]]
1.Hardware Connection.<br>
 
[[File:Crowtail- 4-Digit Display Hardware Connection12.JPG |400px]]
 
  
2.Download the library [http://www.elecrow.com/wiki/index.php?title=File:Crowtail-_4-Digit_Display.zip Crowtail- 4-Digit Display library]; Unzip and put it in the libraries file : ..\arduino-1.0\libraries;
+
1.Download [http://www.elecrow.com/wiki/index.php?title=File:I2C_Color_Sensor1.zip Crowtail- I2C Color Sensor library]; Unzip and put it in the libraries file : ..\arduino-1.0\libraries;
  
3.Open “_4Digital7_SegmentLED ” example via the path: File --> TM1650 --> Examples --> _4Digital7_SegmentLED.
+
2.Open "colorview" example via the path: File --> Examples --> Adafruit TCS34725 -->colorview.
 
   
 
   
 
  <pre>
 
  <pre>
/*
+
#include <Wire.h>
Demo code of P21 - 4 Digital 7-Segment LED with Time Separator
+
//#include <math.h>
by maker studio
+
#include <IICColorSensor.h>
*/
+
 
#include "TM1650.h"
 
#include <inttypes.h>
 
static uint8_t TubeTab[] = {
 
  0x3F,0x06,0x5B,0x4F,
 
  0x66,0x6D,0x7D,0x07,
 
  0x7F,0x6F,0x77,0x7C,
 
  0x39,0x5E,0x79,0x71, 
 
  };//0~9,A,B,C,D,E,F 
 
static uint8_t TubeTabwithPoit[] = {
 
  0xBF,0x86,0xDB,0xCF,
 
  0xE6,0xED,0xFD,0x87,
 
  0xFF,0xEF 
 
  };//0~9 
 
TM1650 DigitalLED(A5,A4);
 
int8_t number[] = {0,0,0,0};
 
 
void setup()
 
void setup()
 
{
 
{
//Serial.begin(9600);
+
Serial.begin(9600);
 +
Wire.begin();
 
}
 
}
  
 
void loop()
 
void loop()
 
{
 
{
    DigitalLED.clearDisplay();
+
int red, green, blue;
    delay(1000);
+
IICColorSensor colorSensor;
    DigitalLED.display(0,TubeTab[1]);
+
colorSensor.ledStatus = 1; // When turn on the color sensor LED, ledStatus = 1; When turn off the color sensor LED, ledStatus = 0.
    DigitalLED.display(1,TubeTab[2]);
+
while(1)
    DigitalLED.display(2,TubeTab[3]);
+
{
    DigitalLED.display(3,TubeTab[4]);
+
colorSensor.readRGB(&red, &green, &blue); //Read RGB values to variables.
    delay(1000);
+
delay(300);
    DigitalLED.clearDisplay();
+
Serial.print("The RGB value are: RGB( ");
    delay(100);
+
Serial.print(red,DEC);
    DigitalLED.display(0,TubeTabwithPoit[5]);
+
Serial.print(", ");
    DigitalLED.display(1,TubeTabwithPoit[6]);
+
Serial.print(green,DEC);
    DigitalLED.display(2,TubeTabwithPoit[7]);
+
Serial.print(", ");
    DigitalLED.display(3,TubeTabwithPoit[8]);
+
Serial.print(blue,DEC);
    delay(1000);
+
    Serial.println(" )");
 +
colorSensor.clearInterrupt();
 +
}
 
}</pre>
 
}</pre>
4.Upload it into your Crowduino board and observe the Digit-Display.
+
3.Upload it into your Arduino board and have a test.
 
 
[[File:the result372.jpg |400px]]
 
  
 
== Resource  ==
 
== Resource  ==
  
*[http://www.elecrow.com/wiki/index.php?title=File:Crowtail-_4-Digit_Display.zip Crowtail- 4-Digit Display Program]
+
*[http://www.elecrow.com/wiki/index.php?title=File:I2C_Color_Sensor1.zip Crowtail- I2C Color Sensor Program]
*[http://www.elecrow.com/wiki/index.php?title=File:Crowtail-_4-Digit_Display_eagle_files.zip Crowtail- 4-Digit Display eagle files]
+
*[http://www.elecrow.com/wiki/index.php?title=File:Crowtail-_I2C_Color_Sensor_eagle_files.zip Crowtail- I2C Color Sensor eagle files]

Latest revision as of 06:07, 22 August 2019

Description

This module is based on the color sensor TCS3414CS with digital output I2C. Based on the 8*2 array of filtered photodiodes and 16-bits analog-to-digital converters, you can gain the color chromaticity of ambient light or the color of objects. Of the 16 photodiodes, 4 have red filters, 4 have green filters, 4 have blue filters and 4 have no filter(clear). With the synchronization input pin, external pulsed light source can provides precise synchronous conversion control.

Model: CT0067ICS

Crowtail- I2C Color Sensor2.JPG

Specification

  • Crowtail compatible interface
  • 16-Bit digital output with I 2C at 400 kHz
  • SYNC Input Synchronizes Integration Cycle to Modulated Light Sources
  • Operating temperature range -40°C to 85°C
  • Programmable interrupt function with User-Defined Upper and lower threshold settings
  • Dimensions(mm):20.0(L)x20.0(W)x13.6(H)

Usage

Crowtail- I2C Color Sensor1.jpg

1.Download Crowtail- I2C Color Sensor library; Unzip and put it in the libraries file : ..\arduino-1.0\libraries;

2.Open "colorview" example via the path: File --> Examples --> Adafruit TCS34725 -->colorview.

#include <Wire.h>
//#include <math.h>
#include <IICColorSensor.h>

void setup()
{
	Serial.begin(9600);
	Wire.begin();
}

void loop()
{
	int red, green, blue;
	IICColorSensor colorSensor;
	colorSensor.ledStatus = 1;							// When turn on the color sensor LED, ledStatus = 1; When turn off the color sensor LED, ledStatus = 0.
	while(1)
	{
		colorSensor.readRGB(&red, &green, &blue);		//Read RGB values to variables.
		delay(300);
		Serial.print("The RGB value are: RGB( ");
		Serial.print(red,DEC);
		Serial.print(", ");
		Serial.print(green,DEC);
		Serial.print(", ");
		Serial.print(blue,DEC);
	    Serial.println(" )");
		colorSensor.clearInterrupt();
	}
}

3.Upload it into your Arduino board and have a test.

Resource