
{"id":3471,"date":"2018-04-27T13:14:20","date_gmt":"2018-04-27T13:14:20","guid":{"rendered":"http:\/\/dyor.roboticafacil.es\/?p=3471"},"modified":"2018-04-27T13:14:41","modified_gmt":"2018-04-27T13:14:41","slug":"detectando-colores-sensor-tcs3200","status":"publish","type":"post","link":"https:\/\/dyor.webs.upv.es\/en\/detectando-colores-sensor-tcs3200\/","title":{"rendered":"Detecting Colours with TCS3200 sensor"},"content":{"rendered":"<p>In this post we show how to detect and classify colours using TCS3200 colour sensor and Facilino.<\/p>\n<p><!--more--><\/p>\n<p>Facilino uses simple instructions to detect colours with the TCS3200 sensor. Internally, the instruction uses a SVM that has been trained to classify colours. These instructions require Facilino&#8217;s license.<\/p>\n<p>The aim is to detect and classify up to 11 colours. The name of the detected colour must be shown on the console.<\/p>\n<h3>Circuit<\/h3>\n<p>Here we show the proposed circuit so that the TCS3200 sensor is connected to D3-D7 Arduino Nano pins. In particular pins S0-S3 are connected to D3-D6 and pin OUT is connected to D7.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3472\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/tcs3200_example_bb.png\" alt=\"\" width=\"393\" height=\"489\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/tcs3200_example_bb.png 393w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/tcs3200_example_bb-241x300.png 241w\" sizes=\"auto, (max-width: 393px) 100vw, 393px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Facilino<\/h3>\n<p>Here you can find the solution of the example. First we need to detect the colour and this value is uses as argument of the colour classifier. In this example we are able to detect up to 11 different colours.<\/p>\n<p style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"https:\/\/roboticafacil.es\/facilino\/blockly\/example.html?lang=en-GB&amp;proc=ArduinoNano&amp;example=rgb_sensor_example.bly\" width=\"800\" height=\"1100\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"yes\"><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n<p>Here we show the expected result:<\/p>\n<p><iframe loading=\"lazy\" title=\"Detectando colores con sensor TCS3200 y Facilino\" width=\"600\" height=\"338\" src=\"https:\/\/www.youtube.com\/embed\/uYniOUMD8Ok?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Espa\u00f1ol.<\/p>\n","protected":false},"author":1,"featured_media":3473,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[99],"tags":[15,115,116,101,37,114],"class_list":["post-3471","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-facilino-ejemplo","tag-arduino","tag-color","tag-deteccion","tag-ejemplo","tag-facilino","tag-tcs3200"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/tcs3200_example_green_key.png","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":734,"url":"https:\/\/dyor.webs.upv.es\/en\/sensor-distancia\/","url_meta":{"origin":3471,"position":0},"title":"Ultrasound sensor HC-SR04","author":"soporte","date":"Wednesday February 15th, 2017","format":false,"excerpt":"Learn how to use the ultrasound (sonar) sensor HC-SR04. DYOR robot uses this sensor to detect obstacles and measure distances. Working principle, connection diagrama and programming example with Facilino. How it works? The ultrasonic sensor HC-SR04 generates a set of ultrasonic waves using one of the membranes (capsules) and receives\u2026","rel":"","context":"In &quot;Arduino&quot;","block_context":{"text":"Arduino","link":"https:\/\/dyor.webs.upv.es\/en\/category\/electronica\/arduino\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/ultrasonidos_zumbador_bb.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/ultrasonidos_zumbador_bb.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/ultrasonidos_zumbador_bb.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/ultrasonidos_zumbador_bb.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/ultrasonidos_zumbador_bb.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1018,"url":"https:\/\/dyor.webs.upv.es\/en\/seguilineas\/","url_meta":{"origin":3471,"position":1},"title":"TCRT5000 Module (linetracker)","author":"soporte","date":"Friday February 24th, 2017","format":false,"excerpt":"Learn how to use the light module (linetracker). DYOR robot uses this module to track lines on the ground using the contrast (between black and white). Working principle, connection diagrams and programming examples with Facilino and Arduino. How does it work? TCRT5000 module emits an infrared light using a fotodiode\u2026","rel":"","context":"In &quot;Arduino&quot;","block_context":{"text":"Arduino","link":"https:\/\/dyor.webs.upv.es\/en\/category\/electronica\/arduino\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_tcrt5000_monitor.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_tcrt5000_monitor.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_tcrt5000_monitor.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_tcrt5000_monitor.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_tcrt5000_monitor.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_tcrt5000_monitor.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":3916,"url":"https:\/\/dyor.webs.upv.es\/en\/instalacion-de-librerias-externas-de-facilino\/","url_meta":{"origin":3471,"position":2},"title":"External library installation in Facilino","author":"soporte","date":"Monday June  4th, 2018","format":false,"excerpt":"Some instructions in Facilino have a dependency on external libraries that must be added to Arduino IDE to compile the code. In this post, we explain the installation process of external libraries of Facilino. Facilino \u2194 Arduino IDE Arduino IDE comes with a set of libraries installed by default, that\u2026","rel":"","context":"In &quot;Facilino&quot;","block_context":{"text":"Facilino","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/06\/arduino.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/06\/arduino.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/06\/arduino.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/06\/arduino.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1899,"url":"https:\/\/dyor.webs.upv.es\/en\/facilino-intro\/","url_meta":{"origin":3471,"position":3},"title":"Introduction to Facilino","author":"soporte","date":"Monday May 29th, 2017","format":false,"excerpt":"Facilino is a block-programming\u00a0tool for Arduino. This tool offers a set of features adapted to program DYOR robot, but it can also be used in wide\u00a0a variety of Arduino projects. Exclusive features Here we show some of the advanced features of Facilino Communication: There are block instructions to communicate over\u2026","rel":"","context":"In &quot;Facilino Manual&quot;","block_context":{"text":"Facilino Manual","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-manual\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/05\/UI.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/05\/UI.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/05\/UI.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/05\/UI.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/05\/UI.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/05\/UI.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":3466,"url":"https:\/\/dyor.webs.upv.es\/en\/mostrando-texto-matriz-leds\/","url_meta":{"origin":3471,"position":4},"title":"Showing Text with the LEDs Matrix","author":"soporte","date":"Friday April 27th, 2018","format":false,"excerpt":"In this post we show how to show text with a 8x8 LEDs matrix max7219 to use with your DYOR robot and Facilino. Facilino has a simple instruction to show some text with a 8x8 LEDs matrix max7219. This instruction requires Facilino's license. The aim is to show the sentence\u2026","rel":"","context":"In &quot;Facilino Ejemplo&quot;","block_context":{"text":"Facilino Ejemplo","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-ejemplo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/led_matrix_example_green_key.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3459,"url":"https:\/\/dyor.webs.upv.es\/en\/expresiones-basicas-matriz-leds\/","url_meta":{"origin":3471,"position":5},"title":"Showing Basic Expressions with LEDs Matrix","author":"soporte","date":"Friday April 27th, 2018","format":false,"excerpt":"In this post we show how to generate simple expressions with a 8x8 LEDs matrix max7219 to use with your DYOR robot and Facilino. Facilino has a simple instruction to create expressions with a 8x8 LEDs matrix max7219. This instruction requires Facilino's license. The aim is to show all predefined\u2026","rel":"","context":"In &quot;Facilino Ejemplo&quot;","block_context":{"text":"Facilino Ejemplo","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-ejemplo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/led_matrix_example_green_key.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/comments?post=3471"}],"version-history":[{"count":3,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3471\/revisions"}],"predecessor-version":[{"id":3476,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3471\/revisions\/3476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media\/3473"}],"wp:attachment":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media?parent=3471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/categories?post=3471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/tags?post=3471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}