HUST PPT Template Color-Sensor
HUST PPT Template Color-Sensor
Class : 152378
Student:
3
01
Introduction
4
COLOR
SENSORS
TCS320
•- A color sensor is an electronic
device used to detect and identify
colors.
•- It works by measuring the
wavelengths of light reflected from
an object, determining its color
based on the intensity of red,
green, and blue (RGB)
components.
•- Color sensors are widely used in
various applications, including
industrial automation, robotics,
and consumer electronics.
•- By converting the light
information into electrical signals,
these sensors allow machines to
"see" and differentiate colors with 5
Sensor Package and Pinouts of
Sensor
GND 4 Power Supply Ground. All Voltages are referenced to this ground
6
Sensor Package and Pinouts of Sensor
7
Photodiodes
8
Photodiodes
1.Definition of Photodiodes
- Photodiode is a form of light sensor that
converts light energy into electrical
energy (voltage or current). Photodiode
is a type of semi conducting device with
PN junction. Between the p (positive)
and n (negative) layers, an intrinsic layer
is present.
- The photo diode accepts light energy as
input to generate electric current
- Typical photodiode materials are Silicon,
Germanium, Indium Gallium Arsenide
Phosphide and Indium gallium arsenide.
9
Photodiodes
2. Working
• In general, an electron will
have a negative charge,
and holes will have a
positive charge. The
depletion of energy will
have built-in electric field.
• Due to that electric field,
electron-hole pairs move
away from the junction.
Hence, holes move to
anode and electrons move
to the cathode to produce
photocurrent.
10
Application
Color sensor technology has a wide range of applications across various industries,
including :
- Industrial Automation: Color sensors are used in manufacturing processes for quality
control, product sorting, and color-based object detection.
- Scientific Research: Color sensors are used in spectroscopy, colorimetry, and other
scientific applications for precise color measurement and analysis.
11
02
Design
12
Design
Arduino Uno R3
13
LCD
• An LCD 16x2 with Arduino
refers to using a Liquid
Crystal Display (LCD) in
conjunction with an Arduino
microcontroller to display
information such as text,
numbers, or even simple
• graphics.
RS (Register Select): Controls
command or data mode.
• E (Enable): Tells the LCD when
data is being sent.
• D4-D7: Four data pins (used in
4-bit mode).
• VSS: Ground.
• VDD: Power (typically 5V from
the Arduino).
• RW (Read/Write): Usually tied
to ground (write mode).
• V0: Contrast adjustment pin
(connected to a potentiometer).
• A (Anode) & K (Cathode): LED
backlight pins for illuminatio
14
I2C LCD
1.Definition
An I2C LCD (Liquid Crystal Display)
refers to an LCD module that
communicates with a microcontroller
or a computer using the I2C (Inter-
Integrated Circuit) communication
protocol.
2. Pinout
LCD I2C uses I2C interfacce, so it
has 4 pin
GND pin: needs to be connected
to GND
VCC pin: the power supply for
the LCD, needs to be connected
to VCC (5V)
SDA pin: I2C data signal
SCL pin: I2C clock signal
15
I2C LCD
16
Arduino
17
Arduino
Application
19
03
Interpreting
Sensor Data
20
Interpreting Sensor Data
The output is a square wave (50% duty cycle) with frequency (fO) directly
proportional to light intensity
where
- fO is the output frequency;
- fD is the output frequency for dark condition (when Ee = 0);
- Re is the device responsivity for a given wavelength of light in
kHz/(mW/cm2);
- Ee is the incident irradiance in mW/cm2.
- fD is an output frequency resulting from leakage currents.
As shown in the equation above, this frequency represents a light-
independent term in the total output frequency fO.
At very low light levels (dark colors), this dark frequency can be a
significant portion of fO. The dark frequency is also temperature
dependent.
21
Interpreting Sensor Data
As fO is directly proportional to frequency, it is possible to map between the
frequency and RGB color value (0-255 for each of R, G and B) using linear
interpolation.
Two points on the RGB line are well determined – pure Black (RGB 0, 0, 0)
and pure White (255, 255, 255).
The proportional relationship is expressed by the standard straight line
equation y = mx + b where
•y is the reading obtained (in our case fO)
•x is the normalized RGB value
•b is the value of y when x is 0 (in our case fD)
•m is the slope, or proportionality constant, of the line
(in our case [fW - fD]/255).
The resulting equation is
or, rearranging to give us the desired RGB value
22
04
Circuit
diagram
23
Circuit diagram
24
THANK
YOU !
25