0% found this document useful (0 votes)
97 views

Sensor Warna DG Arduino

This document describes a color sensor project using an Arduino Uno board and TCS3200 color sensor module. The sensor can detect red, green, and blue light frequencies and send the data to the Arduino. This sensor could be used to detect meat colors or help the visually impaired identify currency colors. The document provides the hardware components, wiring diagram, code to read color values from the sensor, and instructions for viewing the sensor output on the Arduino serial monitor.

Uploaded by

Eka Kusyanto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Sensor Warna DG Arduino

This document describes a color sensor project using an Arduino Uno board and TCS3200 color sensor module. The sensor can detect red, green, and blue light frequencies and send the data to the Arduino. This sensor could be used to detect meat colors or help the visually impaired identify currency colors. The document provides the hardware components, wiring diagram, code to read color values from the sensor, and instructions for viewing the sensor output on the Arduino serial monitor.

Uploaded by

Eka Kusyanto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Inkubatek [supported by : www.tokotronik.

com]

SENSOR WARNA DG ARDUINO


Deskripsi :
Membaca data hasil dari sensor warna TCS3200 dari DF Robot. Jika dikembangkan sensor
warna ini dapat dipakai untuk berbagai keperluan yang berkaitan dengan pendeteksian
warna seperti alat uji daging sapi/babi, alat deteksi mata uang untuk tuna netra dan lain –
lain.

Aplikasi ini berbasis Arduino UNO dan modul sensor warna TCS3200.

Kebutuhan Hardware :

 Arduino UNO Board


 Sensor warna TCS3200

Sensor Warna TCS3200

Schematics
Inkubatek [supported by : www.tokotronik.com]

inkubatek

Koneksi Arduino UNO dengan modul sensor warna TCS3200 :

Pin ARDUINO Pin modul sensor warna


GND GND
5V VDD
3 S0
4 S1
5 S2
6 S3
7 OUT
8 LED
Inkubatek [supported by : www.tokotronik.com]

inkubatek

Program membaca sensor warna TCS3200 dengan Arduino sebagai berikut :

/*************************************

* Program : Project 30. Interfacing dg Sensor Warna

* Input : Sensor warna TCS3200

* 125 Proyek Arduino Inkubatek

* www.tokotronik.com

* ***********************************/

#define S0 3

#define S1 4

#define S2 5

#define S3 6
Inkubatek [supported by : www.tokotronik.com]

#define sensorOut 7

int frequency = 0;

void setup() {

pinMode(S0, OUTPUT);

pinMode(S1, OUTPUT);

pinMode(S2, OUTPUT);

pinMode(S3, OUTPUT);

pinMode(sensorOut, INPUT);

pinMode(8,OUTPUT);

digitalWrite(8,HIGH);

// Setting frequency-scaling to 20%

digitalWrite(S0,HIGH);

digitalWrite(S1,LOW);

Serial.begin(9600);

void loop() {

// RED filtered

digitalWrite(S2,LOW);

digitalWrite(S3,LOW);

// Reading the output frequency

frequency = pulseIn(sensorOut, LOW);

Serial.print("R= ");

Serial.print(frequency);

Serial.print(" ");

delay(100);
Inkubatek [supported by : www.tokotronik.com]

// Green filtered

digitalWrite(S2,HIGH);

digitalWrite(S3,HIGH);

// Reading the output frequency

frequency = pulseIn(sensorOut, LOW);

Serial.print("G= ");

Serial.print(frequency);

Serial.print(" ");

delay(100);

// Blue filtered

digitalWrite(S2,LOW);

digitalWrite(S3,HIGH);

// Reading the output frequency

frequency = pulseIn(sensorOut, LOW);

Serial.print("B= ");

Serial.print(frequency);

Serial.println(" ");

delay(800);

Jalannya Alat :
Setelah program di Upload ke Arduino UNO, selanjutnya buka Serial Monitor di Arduino IDE
( Tools Serial Monitor) kemudian seting baudrate 9600. Akan tampil informasi tentang
hasil pembacaan warna.
Inkubatek [supported by : www.tokotronik.com]

inkubatek

Hadapkan sensor ke objek dengan warna yang berbeda dan hasilnya dapat dilihat di Serial
Monitor :
Inkubatek [supported by : www.tokotronik.com]

inkubatek

You might also like