Arduino Tutorials – பாடம் 20 – Color Sensor Using Arduino UNO

Colour Sensor ஐ Arduino UNO வை கொண்டு கட்டுப்படுத்துவது.

Required Components

  1. Arduino UNO -1 no
  2. Color Sensor -1 no
  3. USB cable -1 no
  4. Jumper Wires -7 no

Circuit

Steps

  1. நாம் பயன்படுத்தும் உபகரணங்கள் சரியாக வேலை செய்கிறதா என்பதை உறுதி செய்து கொள்ளவும்.
  2. Colour detector ஐ Arduino UNO உடன் இணைக்க வேண்டும்.
  3. Arduino UNO பின்னான 4 மற்றும் 5 ஐ Colour detector S0 மற்றும் S1 உடன் இணைக்க வேண்டும்.
  4. Arduino UNO பின்னான 6 மற்றும் 7 ஐ Colour detector S2 மற்றும் S3 உடன் இணைக்க வேண்டும்.
  5. Colour detector உடன் +5V மற்றும் Ground ஐ இணைக்க வேண்டும்.
  6. Arduino program ஐ சரி பார்க்க வேண்டும்.
  7. மின்சுற்றை சரி பார்க்க வேண்டும்.
  8. Arduino program ஐ ரன் செய்ய வேண்டும்.

Arduino Program

#define s0 4
#define s1 5
#define s2 6
#define s3 7
#define out 8
int data=0;

void setup()
{
  pinMode(s0,OUTPUT);
  pinMode(s1,OUTPUT);
  pinMode(s2,OUTPUT);
  pinMode(s3,OUTPUT);
  pinMode(out,INPUT);
  Serial.begin(9600);
  digitalWrite(s0,HIGH);
  digitalWrite(s1,HIGH);
}

void loop()
{
  digitalWrite(s2,HIGH);
  digitalWrite(s3,HIGH);
  Serial.print("Red value= ");
  GetData();
  digitalWrite(s2,LOW);
  digitalWrite(s3,HIGH);
  Serial.print("Blue value= ");
  GetData();
  digitalWrite(s2,LOW);
  digitalWrite(s3,LOW);
  Serial.print("Green value= ");
  GetData();
  Serial.println();
  delay(500);
}

void GetData()
{
  data=pulseIn(out,LOW);
  Serial.print(data
  Serial.print("\t");
  delay(20);
}

Usage

  1. வண்ணம் கண்டறிதல்(Colour Detection)
  2. வீடியோ செயலாக்கம்(video processing)
  3. படிம வருடி(image scanning technique)
  4. வருடுதல்(Scanner)
  5. அச்சுப்பொறி நுட்பம்(printer)

Arduino Tutorials – Lesson 20 – Color Sensor Using Arduino UNO

Creating the reflected color when the light sensor shining a white light at an object program using Arduino UNO

Required Components

  1. Arduino UNO -1 no
  2. Color Sensor -1 no
  3. USB cable -1 no
  4. Jumper Wires -7 no

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect the Color Sensor S0, S1, S2, S3 &Out pins to the Arduino UNO board pins 4,5,6,7 &8 respectively.
  3. Connect the sensor vcc pin to the Arduino UNO 5V pin.
  4. Connect the ground connection respectively.
  5. Check the Arduino program.
  6. Check the Circuit Connections.
  7. Run the Arduino program.

Arduino Program

#define s0 4
#define s1 5
#define s2 6
#define s3 7
#define out 8
int data=0;

void setup()
{
  pinMode(s0,OUTPUT);
  pinMode(s1,OUTPUT);
  pinMode(s2,OUTPUT);
  pinMode(s3,OUTPUT);
  pinMode(out,INPUT);
  Serial.begin(9600);
  digitalWrite(s0,HIGH);
  digitalWrite(s1,HIGH);
}

void loop()
{
  digitalWrite(s2,HIGH);
  digitalWrite(s3,HIGH);
  Serial.print("Red value= ");
  GetData();
  digitalWrite(s2,LOW);
  digitalWrite(s3,HIGH);
  Serial.print("Blue value= ");
  GetData();
  digitalWrite(s2,LOW);
  digitalWrite(s3,LOW);
  Serial.print("Green value= ");
  GetData();
  Serial.println();
  delay(500);
}

void GetData()
{
  data=pulseIn(out,LOW);
  Serial.print(data
  Serial.print("\t");
  delay(20);
}

Usage

  1. Color temperature measurement
  2. RGB LED consistency control
  3. Medical diagnosis systems
  4. Health fitness systems
  5. Industrial process control