{"id":33996,"date":"2017-04-25T11:37:05","date_gmt":"2017-04-25T11:37:05","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=33996"},"modified":"2019-04-02T10:23:29","modified_gmt":"2019-04-02T10:23:29","slug":"arduino-color-sensor-tcs230-tcs3200","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/arduino-color-sensor-tcs230-tcs3200\/","title":{"rendered":"Guide for TCS230\/TCS3200 Color Sensor with Arduino"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">This post shows you how to detect colors with the Arduino using the <strong>TCS230\/<\/strong><\/span><b>TCS3200 color sensor<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The TCS3200 color sensor can detect a wide variety\u00a0of\u00a0colors based on their wavelength. This sensor is specially useful for color recognition projects such as color matching, color sorting, test strip reading and much more. <\/span><!--more--><\/p>\n<p><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-36992\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=700%2C395&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"395\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?w=948&amp;quality=100&amp;strip=all&amp;ssl=1 948w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=150%2C84&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=768%2C433&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=80%2C45&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=220%2C124&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=178%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 178w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=266%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 266w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=423%2C238&amp;quality=100&amp;strip=all&amp;ssl=1 423w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=737%2C415&amp;quality=100&amp;strip=all&amp;ssl=1 737w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?resize=865%2C487&amp;quality=100&amp;strip=all&amp;ssl=1 865w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2>Introduction<\/h2>\n<p><span style=\"font-weight: 400;\">The TCS3200 color sensor &#8211; shown in the figure below &#8211; \u00a0uses a TAOS TCS3200 RGB sensor chip to detect color. It also contains four white LEDs that light up the object in front of it.<\/span><\/p>\n<p><b><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter wp-image-36968\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=326%2C383&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"326\" height=\"383\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?w=400&amp;quality=100&amp;strip=all&amp;ssl=1 400w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=128%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 128w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=255%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 255w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=68%2C80&amp;quality=100&amp;strip=all&amp;ssl=1 68w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=187%2C220&amp;quality=100&amp;strip=all&amp;ssl=1 187w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=85%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 85w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=203%2C238&amp;quality=100&amp;strip=all&amp;ssl=1 203w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-1.jpg?resize=353%2C415&amp;quality=100&amp;strip=all&amp;ssl=1 353w\" sizes=\"(max-width: 326px) 100vw, 326px\" \/><br \/>\nSpecifications<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s the sensor specifications:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Power: 2.7V to 5.5V<\/span><\/li>\n<li style=\"font-weight: 400;\">Size: 28.4 x 28.4mm (1.12 x 1.12&#8243;)<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Interface: digital TTL<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">High-resolution conversion of light intensity to frequency<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Programmable color and full-scale output frequency<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Communicates directly to microcontroller<\/span><\/li>\n<\/ul>\n<h2>Where to buy?<\/h2>\n<p><span style=\"font-weight: 400;\">You can check the\u00a0<a href=\"https:\/\/makeradvisor.com\/tools\/tcs3200-color-sensor\/\" target=\"_blank\" rel=\"noopener noreferrer\">TCS3200 or a TCS230 color sensor<\/a> on <a href=\"https:\/\/makeradvisor.com\/tools\/tcs3200-color-sensor\/\" target=\"_blank\" rel=\"noopener noreferrer\">Maker Advisor<\/a> and find the best price.<\/span><\/p>\n<h2>How does the TCS3200 sensor work?<\/h2>\n<p><span style=\"font-weight: 400;\">The TCS3200 has an array of photodiodes with 4 different filters. A photodiode is simply a semiconductor device that converts light into current. The sensor has:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">16 photodiodes with red filter &#8211; sensitive to red wavelength<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">16 photodiodes with green filter &#8211; sensitive to green wavelength<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">16 photodiodes with blue filter &#8211; sensitive to blue wavelength<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">16 photodiodes without filter<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If you take a closer look at the TCS3200 chip you can see the different filters.<\/span><\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter wp-image-36969\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=280%2C216&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"280\" height=\"216\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=150%2C116&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=300%2C231&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=80%2C62&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=220%2C170&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=130%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 130w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=194%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 194w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=309%2C238&amp;quality=100&amp;strip=all&amp;ssl=1 309w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=538%2C415&amp;quality=100&amp;strip=all&amp;ssl=1 538w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_filters.jpg?resize=631%2C487&amp;quality=100&amp;strip=all&amp;ssl=1 631w\" sizes=\"(max-width: 280px) 100vw, 280px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">By selectively choosing the photodiode filter\u2019s readings, you\u2019re able to detect the intensity of the different colors. The sensor has a current-to-frequency converter that converts the photodiodes&#8217; readings into a square wave with a frequency that is proportional to the light intensity of the chosen color. This frequency is then, read by the Arduino &#8211; this is shown in the figure below.<\/span><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-36972\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=708%2C171&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"708\" height=\"171\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=150%2C36&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=300%2C72&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=80%2C19&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=220%2C53&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=250%2C60&amp;quality=100&amp;strip=all&amp;ssl=1 250w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=280%2C68&amp;quality=100&amp;strip=all&amp;ssl=1 280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color-sensor-scheme.png?resize=510%2C123&amp;quality=100&amp;strip=all&amp;ssl=1 510w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/p>\n<h3>Pinout<\/h3>\n<p><span style=\"font-weight: 400;\">Here\u2019s the sensor pinout:<\/span><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36994\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=304%2C158&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"304\" height=\"158\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?w=304&amp;quality=100&amp;strip=all&amp;ssl=1 304w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=150%2C78&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=300%2C156&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=80%2C42&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=220%2C114&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=192%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 192w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_Sensor_1.jpg?resize=280%2C146&amp;quality=100&amp;strip=all&amp;ssl=1 280w\" sizes=\"(max-width: 304px) 100vw, 304px\" \/><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Pin Name<\/b><\/td>\n<td><b>I\/O<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">GND (4)<\/span><\/td>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">Power supply ground<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">OE (3)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">I<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Enable for output frequency\u00a0(active low)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">OUT (6)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">O<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Output frequency\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">S0, S1\uff081\uff0c2\uff09<\/span><\/td>\n<td><span style=\"font-weight: 400;\">I<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Output frequency scaling selection inputs<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">S2, S3\uff087\uff0c8\uff09<\/span><\/td>\n<td><span style=\"font-weight: 400;\">I<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Photodiode type selection inputs<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">VDD\uff085\uff09<\/span><\/td>\n<td><\/td>\n<td><span style=\"font-weight: 400;\">Voltage supply<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Filter selection<\/h3>\n<p><span style=\"font-weight: 400;\">To select the color read by the photodiode, you use the control pins S2 and S3. As the photodiodes are connected in parallel, setting the S2 and S3 LOW and HIGH in different combinations allows you to select different photodidodes. Take a look at the table below:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Photodiode type<\/b><\/td>\n<td><b>S2<\/b><\/td>\n<td><b>S3<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Red<\/span><\/td>\n<td><span style=\"font-weight: 400;\">LOW<\/span><\/td>\n<td><span style=\"font-weight: 400;\">LOW<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Blue<\/span><\/td>\n<td><span style=\"font-weight: 400;\">LOW<\/span><\/td>\n<td><span style=\"font-weight: 400;\">HIGH<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">No filter (clear)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">HIGH<\/span><\/td>\n<td><span style=\"font-weight: 400;\">LOW<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Green<\/span><\/td>\n<td><span style=\"font-weight: 400;\">HIGH<\/span><\/td>\n<td><span style=\"font-weight: 400;\">HIGH<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Frequency scaling<\/h3>\n<p><span style=\"font-weight: 400;\">Pins S0 and S1 are used for scaling the output frequency. It can be scaled to the following preset values: 100%, 20% or 2%. Scaling the output frequency is useful to optimize the sensor readings for various frequency counters or microcontrollers. Take a look at the table below:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Output frequency scaling<\/b><\/td>\n<td><b>S0<\/b><\/td>\n<td><b>S1<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Power down<\/span><\/td>\n<td><span style=\"font-weight: 400;\">L<\/span><\/td>\n<td><span style=\"font-weight: 400;\">L<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">2%<\/span><\/td>\n<td><span style=\"font-weight: 400;\">L<\/span><\/td>\n<td><span style=\"font-weight: 400;\">H<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">20%<\/span><\/td>\n<td><span style=\"font-weight: 400;\">H<\/span><\/td>\n<td><span style=\"font-weight: 400;\">L<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">100%<\/span><\/td>\n<td><span style=\"font-weight: 400;\">H<\/span><\/td>\n<td><span style=\"font-weight: 400;\">H<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For the Arduino, it is common to use a frequency scaling of 20%. So, you set the S0 pin to HIGH and the S1 pin to LOW.<\/p>\n<h2>Color Sensing with Arduino and TCSP3200<\/h2>\n<p><span style=\"font-weight: 400;\">In this example you\u2019re going to detect colors with the Arduino and the TCSP3200 color sensor. \u00a0This sensor is not very accurate, but works fine for detecting colors in\u00a0simple projects.<\/span><\/p>\n<h3>Parts required<\/h3>\n<p>Here&#8217;s the parts required for this project:<\/p>\n<ul>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/tcs3200-color-sensor\/\" target=\"_blank\" rel=\"noopener noreferrer\">TCSP3200 or TCS230 color sensor\u00a0<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/compatible-arduino-uno-r3-board\/\" target=\"_blank\" rel=\"noopener noreferrer\">Arduino UNO<\/a>\u00a0\u2013 read\u00a0<a href=\"https:\/\/makeradvisor.com\/best-arduino-starter-kits\/\" target=\"_blank\" rel=\"noopener noreferrer\">Best Arduino Starter Kits<\/a><\/li>\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noopener noreferrer\">Jumper wires\u00a0<\/a><\/li>\n<\/ul>\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n<h3>Schematic<\/h3>\n<p><span style=\"font-weight: 400;\">Wiring the TCSP3200 sensor to your Arduino is pretty straightforward. Simply follow the next schematic diagram.<\/span><\/p>\n<p><strong><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-36977\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=528%2C717&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"528\" height=\"717\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=111%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 111w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=221%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 221w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=59%2C80&amp;quality=100&amp;strip=all&amp;ssl=1 59w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=162%2C220&amp;quality=100&amp;strip=all&amp;ssl=1 162w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=74%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 74w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=175%2C238&amp;quality=100&amp;strip=all&amp;ssl=1 175w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=306%2C415&amp;quality=100&amp;strip=all&amp;ssl=1 306w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=359%2C487&amp;quality=100&amp;strip=all&amp;ssl=1 359w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/color_sensor_schematics_bb_f.png?resize=438%2C595&amp;quality=100&amp;strip=all&amp;ssl=1 438w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/a><\/strong><\/p>\n<p>Here&#8217;s the connections between the TCSP3200 and the Arduino:<\/p>\n<ul>\n<li><strong>S0<\/strong>: digital pin 4<\/li>\n<li><strong>S1<\/strong>: digital pin 5<\/li>\n<li><strong>VCC<\/strong>: 5V<\/li>\n<li><strong>S3<\/strong>: digital pin 6<\/li>\n<li><strong>S4<\/strong>: digital pin 7<\/li>\n<li><strong>OUT<\/strong>: digital pin 8<\/li>\n<\/ul>\n<h3>Code<\/h3>\n<p>You\u00a0need two sketches for this project:<\/p>\n<ol>\n<li><strong>Reading and displaying the output frequency on the serial monitor<\/strong>. In this part you need to write down the frequency values when you place different colors in front of the sensor.<\/li>\n<li><strong>Distinguish between different colors<\/strong>. In this section you&#8217;ll insert the frequency values picked previously on your code, so that your sensor can distinguish between different colors. We&#8217;ll detect\u00a0red, green and blue colors.<\/li>\n<\/ol>\n<h3>1. Reading the output frequency<\/h3>\n<p>Upload the following code to your Arduino board.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at http:\/\/randomnerdtutorials.com  \n*********\/\n\n\/\/ TCS230 or TCS3200 pins wiring to Arduino\n#define S0 4\n#define S1 5\n#define S2 6\n#define S3 7\n#define sensorOut 8\n\n\/\/ Stores frequency read by the photodiodes\nint redFrequency = 0;\nint greenFrequency = 0;\nint blueFrequency = 0;\n\nvoid setup() {\n  \/\/ Setting the outputs\n  pinMode(S0, OUTPUT);\n  pinMode(S1, OUTPUT);\n  pinMode(S2, OUTPUT);\n  pinMode(S3, OUTPUT);\n  \n  \/\/ Setting the sensorOut as an input\n  pinMode(sensorOut, INPUT);\n  \n  \/\/ Setting frequency scaling to 20%\n  digitalWrite(S0,HIGH);\n  digitalWrite(S1,LOW);\n  \n   \/\/ Begins serial communication \n  Serial.begin(9600);\n}\nvoid loop() {\n  \/\/ Setting RED (R) filtered photodiodes to be read\n  digitalWrite(S2,LOW);\n  digitalWrite(S3,LOW);\n  \n  \/\/ Reading the output frequency\n  redFrequency = pulseIn(sensorOut, LOW);\n  \n   \/\/ Printing the RED (R) value\n  Serial.print(&quot;R = &quot;);\n  Serial.print(redFrequency);\n  delay(100);\n  \n  \/\/ Setting GREEN (G) filtered photodiodes to be read\n  digitalWrite(S2,HIGH);\n  digitalWrite(S3,HIGH);\n  \n  \/\/ Reading the output frequency\n  greenFrequency = pulseIn(sensorOut, LOW);\n  \n  \/\/ Printing the GREEN (G) value  \n  Serial.print(&quot; G = &quot;);\n  Serial.print(greenFrequency);\n  delay(100);\n \n  \/\/ Setting BLUE (B) filtered photodiodes to be read\n  digitalWrite(S2,LOW);\n  digitalWrite(S3,HIGH);\n  \n  \/\/ Reading the output frequency\n  blueFrequency = pulseIn(sensorOut, LOW);\n  \n  \/\/ Printing the BLUE (B) value \n  Serial.print(&quot; B = &quot;);\n  Serial.println(blueFrequency);\n  delay(100);\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/color\/Color_Sensor_TCS230_TCS3200_1.ino\" target=\"_blank\">View raw code<\/a><\/p>\n<p>Open the serial monitor at a baud rate of 9600.<\/p>\n<p>Place a blue object in front of the sensor at different distances. You should save two measurements: when the object is placed far from the sensor and when the object is close to it.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36982\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=700%2C261&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"261\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=150%2C56&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=300%2C112&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=80%2C30&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=220%2C82&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=250%2C93&amp;quality=100&amp;strip=all&amp;ssl=1 250w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=280%2C104&amp;quality=100&amp;strip=all&amp;ssl=1 280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue.jpg?resize=510%2C190&amp;quality=100&amp;strip=all&amp;ssl=1 510w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>Check the values displayed on the serial monitor. The blue\u00a0frequency (B) should be the lowest compared to the red (R)\u00a0and green (G)\u00a0frequency readings &#8211; see figure below.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36987\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=800%2C616&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"800\" height=\"616\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?w=800&amp;quality=100&amp;strip=all&amp;ssl=1 800w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=150%2C116&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=300%2C231&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=768%2C591&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=80%2C62&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=220%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=130%2C100&amp;quality=100&amp;strip=all&amp;ssl=1 130w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=195%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 195w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=309%2C238&amp;quality=100&amp;strip=all&amp;ssl=1 309w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=539%2C415&amp;quality=100&amp;strip=all&amp;ssl=1 539w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=632%2C487&amp;quality=100&amp;strip=all&amp;ssl=1 632w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-blue-Copy.png?resize=773%2C595&amp;quality=100&amp;strip=all&amp;ssl=1 773w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>When we place the\u00a0blue object in front of the sensor, the blue frequency (B) values oscillate between <strong>59<\/strong> and <strong>223 <\/strong>(see highlighted values).<\/p>\n<p><strong>Note:<\/strong> you can&#8217;t use these frequency values (59 and 223) in your code, you should measure the colors for your specific object with your own color sensor. Then, save your upper and bottom frequency limits for the blue color, because you&#8217;ll need them later.<\/p>\n<p>Repeat this process with\u00a0a green and red objects and write down the upper and bottom frequency limits for each color.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36985\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=700%2C273&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" width=\"700\" height=\"273\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?w=700&amp;quality=100&amp;strip=all&amp;ssl=1 700w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=150%2C59&amp;quality=100&amp;strip=all&amp;ssl=1 150w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=300%2C117&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=80%2C31&amp;quality=100&amp;strip=all&amp;ssl=1 80w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=220%2C86&amp;quality=100&amp;strip=all&amp;ssl=1 220w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=250%2C98&amp;quality=100&amp;strip=all&amp;ssl=1 250w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=280%2C109&amp;quality=100&amp;strip=all&amp;ssl=1 280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/reading-red-and-green.jpg?resize=510%2C199&amp;quality=100&amp;strip=all&amp;ssl=1 510w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<h3>2. Distinguish between different colors<\/h3>\n<p>This next sketch maps the frequency values to RGB values (that are between 0 and 255).<\/p>\n<p>In the previous step when we have maximum blue we obtained a frequency of 59 and when we have blue at a higher distance we obtained 223.<\/p>\n<p>So, 59 in frequency corresponds to 255 (in RGB) and 223 in frequency to 0 (in RGB). We&#8217;ll do this with the Arduino <em><span style=\"color: #808080;\">map()<\/span><\/em> function. In the <em><span style=\"color: #808080;\">map()<\/span><\/em> function you need to replace XX parameters\u00a0with your own values.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at http:\/\/randomnerdtutorials.com  \n*********\/\n\n\/\/ TCS230 or TCS3200 pins wiring to Arduino\n#define S0 4\n#define S1 5\n#define S2 6\n#define S3 7\n#define sensorOut 8\n\n\/\/ Stores frequency read by the photodiodes\nint redFrequency = 0;\nint greenFrequency = 0;\nint blueFrequency = 0;\n\n\/\/ Stores the red. green and blue colors\nint redColor = 0;\nint greenColor = 0;\nint blueColor = 0;\n\nvoid setup() {\n  \/\/ Setting the outputs\n  pinMode(S0, OUTPUT);\n  pinMode(S1, OUTPUT);\n  pinMode(S2, OUTPUT);\n  pinMode(S3, OUTPUT);\n  \n  \/\/ Setting the sensorOut as an input\n  pinMode(sensorOut, INPUT);\n  \n  \/\/ Setting frequency scaling to 20%\n  digitalWrite(S0,HIGH);\n  digitalWrite(S1,LOW);\n  \n  \/\/ Begins serial communication\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  \/\/ Setting RED (R) filtered photodiodes to be read\n  digitalWrite(S2,LOW);\n  digitalWrite(S3,LOW);\n  \n  \/\/ Reading the output frequency\n  redFrequency = pulseIn(sensorOut, LOW);\n  \/\/ Remaping the value of the RED (R) frequency from 0 to 255\n  \/\/ You must replace with your own values. Here's an example: \n  \/\/ redColor = map(redFrequency, 70, 120, 255,0);\n  redColor = map(redFrequency, XX, XX, 255,0);\n  \n  \/\/ Printing the RED (R) value\n  Serial.print(&quot;R = &quot;);\n  Serial.print(redColor);\n  delay(100);\n  \n  \/\/ Setting GREEN (G) filtered photodiodes to be read\n  digitalWrite(S2,HIGH);\n  digitalWrite(S3,HIGH);\n  \n  \/\/ Reading the output frequency\n  greenFrequency = pulseIn(sensorOut, LOW);\n  \/\/ Remaping the value of the GREEN (G) frequency from 0 to 255\n  \/\/ You must replace with your own values. Here's an example: \n  \/\/ greenColor = map(greenFrequency, 100, 199, 255, 0);\n  greenColor = map(greenFrequency, XX, XX, 255, 0);\n  \n  \/\/ Printing the GREEN (G) value  \n  Serial.print(&quot; G = &quot;);\n  Serial.print(greenColor);\n  delay(100);\n \n  \/\/ Setting BLUE (B) filtered photodiodes to be read\n  digitalWrite(S2,LOW);\n  digitalWrite(S3,HIGH);\n  \n  \/\/ Reading the output frequency\n  blueFrequency = pulseIn(sensorOut, LOW);\n  \/\/ Remaping the value of the BLUE (B) frequency from 0 to 255\n  \/\/ You must replace with your own values. Here's an example: \n  \/\/ blueColor = map(blueFrequency, 38, 84, 255, 0);\n  blueColor = map(blueFrequency, XX, XX, 255, 0);\n  \n  \/\/ Printing the BLUE (B) value \n  Serial.print(&quot; B = &quot;);\n  Serial.print(blueColor);\n  delay(100);\n\n  \/\/ Checks the current detected color and prints\n  \/\/ a message in the serial monitor\n  if(redColor &gt; greenColor &amp;&amp; redColor &gt; blueColor){\n      Serial.println(&quot; - RED detected!&quot;);\n  }\n  if(greenColor &gt; redColor &amp;&amp; greenColor &gt; blueColor){\n    Serial.println(&quot; - GREEN detected!&quot;);\n  }\n  if(blueColor &gt; redColor &amp;&amp; blueColor &gt; greenColor){\n    Serial.println(&quot; - BLUE detected!&quot;);\n  }\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/color\/Color_Sensor_TCS230_TCS3200_2.ino\" target=\"_blank\">View raw code<\/a><\/p>\n<p>To distinguish between different colors we have three conditions:<\/p>\n<ul>\n<li>When the R is the maximum value (in RGB parameters) we know we have a red object<\/li>\n<li>When G is the maximum value, we know we have a green\u00a0object<\/li>\n<li>When B is the maximum value, we know we have a blue\u00a0object<\/li>\n<\/ul>\n<p>Now, place something in front of the sensor. It should print\u00a0in your serial monitor the color detected:\u00a0red, green or blue.<\/p>\n<p><strong>Tip: <\/strong>your sensor can also detect other colors\u00a0with more if statements.<\/p>\n<h2>Wrapping up<\/h2>\n<p><span style=\"font-weight: 400;\">In this post you\u2019ve learned how to detect colors with the TCSP3200 color sensor.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can easily build a color sorting machine by simply adding a servo motor.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Do you have project ideas related to\u00a0color sorting?<\/span><\/p>\n<p>Let us know by posting a comment below.<\/p>\n<p><span style=\"font-weight: 400;\">If you like this post, you\u2019ll probably like these posts:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/randomnerdtutorials.com\/21-arduino-modules-you-can-buy-for-less-than-2\/\">21 Arduino Modules You Can Buy For Less Than $2<\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/randomnerdtutorials.com\/guide-for-real-time-clock-rtc-module-with-arduino-ds1307-and-ds3231\/\"><span style=\"font-weight: 400;\">Guide for Real Time Clock (RTC) Module with Arduino (DS1307 and DS3231)<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/randomnerdtutorials.com\/guide-for-oled-display-with-arduino\/\"><span style=\"font-weight: 400;\">Guide for 0.96 inch OLED Display with Arduino<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/randomnerdtutorials.com\/20-free-guides-for-arduino-modules-and-sensors\/\">20 Free Guides for Arduino Modules and Sensors<\/a><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/randomnerdtutorials.com\/complete-guide-for-dht11dht22-humidity-and-temperature-sensor-with-arduino\/\">Guide for DHT11\/DHT22 Humidity and Temperature Sensor With Arduino<\/a><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Thanks for reading,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Rui and Sara<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post shows you how to detect colors with the Arduino using the TCS230\/TCS3200 color sensor. The TCS3200 color sensor can detect a wide variety\u00a0of\u00a0colors based on their wavelength. This &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Guide for TCS230\/TCS3200 Color Sensor with Arduino\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/arduino-color-sensor-tcs230-tcs3200\/#more-33996\" aria-label=\"Read more about Guide for TCS230\/TCS3200 Color Sensor with Arduino\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":36992,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[267,2,302,269,223,264,215,10],"tags":[],"class_list":["post-33996","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-project","category-arduino","category-0-guide","category-guide-project","category-modules","category-project","category-sensors","category-a-tutorials"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/04\/Color_sensor_featured_image.jpg?fit=948%2C534&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/33996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=33996"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/33996\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/36992"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=33996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=33996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=33996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}