Hello friends, I hope you all are doing great. Today, I am going to share the new TCS3200 Color Sensor Library for Proteus Simulation. The TCS3200 turns colour into frequency: under its four white LEDs it looks at an object through tiny red, green, blue and clear filters and gives out a square wave whose frequency tells how much of each colour comes back. With this library you can run a full Proteus simulation of the common TCS3200 module, drive its filter and scaling pins from your Arduino, measure the pulses and teach your sketch to name colours.
TCS3200 Color Sensor Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Related parts: I2C LCD 16x2 · TCRT5000 IR Sensor · VEML7700 Light Sensor
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo is a colour detector on a conveyor: an Arduino UNO V4.0 calibrates the sensor on a white and a black card, then names each coloured card that passes, shows the red, green and blue values on a 16x2 LCD and lights an RGB LED in the colour it measured.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the photodiode board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the TCS3200 Color Sensor Library for Proteus Simulation:
What Is the TCS3200 Color Sensor?
Inside the TCS3200 is a tiny grid of 8 x 8 photodiodes. Sixteen of them sit under red filters, sixteen under green, sixteen under blue and sixteen have no filter at all - the clear ones. They are interleaved across the grid so that every colour sees the same spot. Each group is wired in parallel, and two pins, S2 and S3, choose which group is read: LOW LOW red, HIGH HIGH green, LOW HIGH blue and HIGH LOW clear.
The chosen photodiodes feed a current-to-frequency converter. The more light, the more current, the higher the frequency. Dividers turn it into a clean square wave with a 50 % duty cycle on OUT. Two more pins, S0 and S1, scale it: LOW LOW powers the converter down and leaves OUT floating, LOW HIGH gives 2 %, HIGH LOW 20 % and HIGH HIGH 100 % of the full output - up to about 600 kHz at full scale. OE, active low, switches the output on; on most modules it is simply tied to ground. The supply can be anything from 2.7 to 5.5 V.
The Module
The common module is a square board of 28.4 x 28.4 mm with the clear eight-pin package in the middle and four white LEDs around it that light whatever is in front of the sensor - always on while the board has power. Two four-pin headers carry the signals: S0, S1, OE, GND on one side and VCC, OUT, S2, S3 on the other. The object should be 10 to 20 mm away, and a black shroud that keeps room light out makes the readings far more stable.
From Frequency to Colour
The usual Arduino way is to measure half a period instead of the frequency: pulseIn(OUT, LOW) returns how many microseconds OUT stays LOW. That is half of one period, so a SHORT pulse means a HIGH frequency and MORE of that colour. With 20 % scaling, white paper close to the LEDs gives LOW pulses of a few tens of microseconds, black a few hundred. Because every sensor, every distance and every lamp differs, the pulses are calibrated: read a white card for each channel's shortest pulse and a black card for its longest, then map every reading between them to a value from 255 to 0.
Features of the TCS3200 Library
- A real-looking module: the board at its true size with the clear chip and its coloured photodiode array, the four LEDs and both headers; at Run the LEDs light and the array takes the object's colour.
- The pins of the datasheet: S0 S1 scaling and power-down, S2 S3 photodiode choice, OE active low.
- A true square wave: 50 % duty on OUT, its frequency following the light within one period.
- Four channels: red, green, blue and clear from the object's reflectance under the module's LEDs, with the distance.
- Objects: a DEMO conveyor of seven cards, or a STEADY colour; the pop-up puts a card under the sensor at any time.
- A pop-up: the card, the four photodiode types with their frequencies and the pulse widths an Arduino reads; graphs, an event log and a check page.
- A complete package: about 2.4 MB with the library, our I2C LCD, resistors and RGB LED, our Arduino UNO V4.0 and the demo, without the source code of the model.
The TCS3200 in Proteus
The device is TCS3200TEP in TEPTCS3200.LIB, under Modules > Sensors, with the model TEPTCS3200.DLL. Search TCS3200 or color in Pick Devices. Its eight pins are the two headers of the real board. Three properties set it up: PROFILE (DEMO or STEADY), DISTANCE (mm) and COLOR (the reflectance in red, green and blue for STEADY).
Download TCS3200 Color Sensor Library for Proteus Simulation
Click the button below to download TCS3200-Color-Sensor-Library-for-Proteus-v1.0.zip (about 2.4 MB, without the source code of the models):
TCS3200 Color Sensor Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPTCS3200.LIB,TEPI2CLCD16X2.LIB,TEPRESISTOR.LIB,TEPRGB.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPTCS3200.DLL,TEPLCD.DLL,TEPRESISTOR.DLL,TEPRGB.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (Wire only).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install TCS3200 Color Sensor Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPTCS3200.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for TCS3200.
Proteus Simulation of a Colour Detector
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0. The module (U1) has S0 to S3 on D4 to D7 and OUT on D8; OE is tied to ground as on most boards. A 16x2 LCD from our I2C LCD 16x2 Library for Proteus sits on the I2C bus at 0x27, and an RGB LED from our RGB LED Library for Proteus on the PWM pins D9, D10 and D11 shows the colour the Arduino measured. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open TCS3200-Color-Detector-ArduinoUnoV4.pdsprj. The cards come from the DEMO conveyor, 10 mm under the sensor, 0.8 s each.
The Sketch
The scaling is set once - S0 HIGH and S1 LOW for 20 %:
digitalWrite(S0, HIGH); digitalWrite(S1, LOW); // 20 % output scaling
Each reading chooses a filter, throws away one pulse that may still belong to the previous filter, and averages three:
digitalWrite(S2, s2); digitalWrite(S3, s3);
pulseIn(OUT, LOW, 20000);
The calibration turns a pulse into a value - the white card's pulse is 255, the black card's 0:
return constrain(map(pw, white, black, 255, 0), 0, 255);
A few simple rules then name the colour: all three high is white, all low is black, red and green high with blue low is yellow, red and blue high with green low is purple, and otherwise the largest channel wins.
TCS3200 Simulation Results
Open the project and press Run. The demo runs 5.4 simulated seconds and took about 2 minutes 20 seconds on our PC with the pop-up open and the pictures being taken. Click U1 for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
Calibration on White and Black
The conveyor starts with a white card. At 0.4 s the sketch reads it with each filter and keeps the LOW half-periods - about 42 us for red, 55 us for green and 59 us for blue: the shortest pulses it will ever see, because white reflects the most. At 1.2 s the black card is under the sensor and the same three readings come out about five times longer, around 200 to 290 us: black still reflects about a fifth of the light of white paper this close to the LEDs. These six numbers are the calibration; the monitor prints them both before the colour readings begin.
A Red Card
From 1.6 s a red card passes. The red photodiodes now see 85 % of what they saw on white, the green and blue ones only about a quarter. The monitor reads R 49 us, G 245 us, B 232 us, which the sketch maps to 244, 27 and 62 - "RED" on the LCD, and the RGB LED glows red. The pop-up at 2.2 s shows the card, the four photodiode types as bars at 20 % scaling, and the filter the sketch has just chosen, boxed.
Green and Blue
At 2.4 s a green card arrives: R 162 us, G 74 us, B 165 us, mapped to 67, 234 and 135 - "GREEN". Notice the blue value of 135: a real green pigment reflects some blue too, and the mapping is not linear, so the values bunch towards the top. The colour is still clearly green because green is the largest of the three.
From 3.2 s the blue card gives R 185 us, G 156 us, B 70 us - 30, 135 and 244, "BLUE". The pop-up at 3.8 s shows the blue bar far longer than the others.
Yellow and Purple
At 4.0 s a yellow card: yellow is red plus green, so the red and green pulses are both short - 46 us and 65 us - and only blue is long, 192 us. The values 249, 245 and 107 fall into the sketch's yellow rule: red and green above 150, blue below 120. The pop-up at 4.6 s catches the sketch reading the blue filter: S2 S3 are LOW HIGH, OUT runs at 2.58 kHz and stays LOW for 194 us; the other bars show 10.86 kHz and 46 us for red, 7.71 kHz and 65 us for green, 9.55 kHz and 52 us for clear.
The last card, purple from 4.8 s, mixes red and blue: R 67 us, G 217 us, B 85 us, mapped to 216, 61 and 227 - "PURPLE", with the RGB LED in a matching violet. Seven cards, seven right answers.
The Graphs, the Event Log and the Check Page
The Graphs page plots the red, green and blue channels at 100 % and the OUT frequency - each card shows as a step in the three colours, and OUT jumps between them as the sketch changes filters. The Event log lists every card the conveyor brings. The Check page sums up the run: the supply at 5.00 V and about 60 mA with the four LEDs; the output enabled with OE low at 20 % scaling; the brightest channel at 36 kHz, far below the 500 - 600 kHz full scale; the distance of 10 mm, the reference; and the thousands of filter changes and output edges the sketch caused.
The Arduino's built-in serial monitor prints the white and black references, then a line every 200 ms: the three pulse widths in microseconds, the three 0 - 255 values and the colour's name - the whole conveyor can be read back card by card.
Why the Values Bunch at the Top
The pulse width is inversely proportional to the light: twice the light, half the pulse. The map() function treats the pulse as if it were linear, so a channel that reflects only a quarter of white still comes out around 30 instead of near 0, and colours look a little washed out. For better colours convert each pulse to a frequency first (1,000,000 divided by twice the pulse) and map the frequencies, or use a lookup table made from a few reference cards.
TCS3200 and Other Light Sensors
Our VEML7700 Light Sensor Library for Proteus measures how bright the light is, in lux, but not its colour. Our TCRT5000 IR Sensor Library for Proteus only knows bright from dark in the infrared. The TCS3200 is the one that tells red from green - but only for things close to it and lit by its own LEDs; for the colour of a whole room or of a distant light source, a calibrated RGB sensor with an I2C interface is the better choice.
Try It Yourself
- Click U1 while the simulation runs and use the chips: red, green, blue, yellow and purple put a card under the sensor.
- Set DISTANCE to 25: the pulses grow longer, but the calibration was made at 10 mm - the colours come out dark.
- Change the sketch to 100 % scaling (S0 and S1 HIGH): every pulse becomes five times shorter.
- Set PROFILE to STEADY and COLOR to 0.9,0.5,0.2 (orange) and see which name the sketch gives it.
- Add an orange rule to the sketch between red and yellow.
Ideas to Extend the Demo
- Sort the cards with a servo into seven boxes.
- Store the colours of your own objects and recognise them by the nearest match.
- Measure the frequency with a timer instead of pulseIn for faster readings.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real TCS3200
- Shade it: room light adds to the LEDs' light - a black tube or hood around the sensor makes a big difference.
- Calibrate in place: white and black references change with the distance and the light.
- Distance: keep the object 10 - 20 mm away and always at the same distance.
- Glossy objects: tilt them a little so the LEDs are not reflected straight back.
- Timeouts: in the dark the output is so slow that pulseIn times out and returns 0.
Troubleshooting
- pulseIn returns 0: the output is off (S0 S1 = LL or OE high) or the light is too weak for the timeout.
- All colours read alike: the calibration was made at another distance or in other light.
- The readings saturate: the object is too close or too bright - move it away or use 2 % scaling.
- Red and green swapped: S2 S3 wired the wrong way round (LL red, HH green).
- The part is not simulated:
TEPTCS3200.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The pins, the scaling, the filter choice, OE, the square wave and the full scale follow the TCS3200 datasheet; the board is our own drawing.
- Our own figures: 60 / 45 / 42 / 70 kHz for white paper at 10 mm and 100 %, 300 Hz of room light, the distance law, about 60 mA with the LEDs, and the cards' reflectances.
- Not modelled: the filters' exact spectral curves, glossy reflections and temperature.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the maker of the TCS3200.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the TCS3200 Color Sensor Library for Proteus Simulation. I hope it helps you teach your next project to see in colour. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!