{"id":264,"date":"2014-06-06T14:26:01","date_gmt":"2014-06-06T14:26:01","guid":{"rendered":"http:\/\/www.thinkering.de\/cms\/?p=264"},"modified":"2017-02-20T08:21:24","modified_gmt":"2017-02-20T08:21:24","slug":"color-sensing-rgb-light","status":"publish","type":"post","link":"http:\/\/www.thinkering.de\/cms\/?p=264","title":{"rendered":"Color-Sensing RGB Light"},"content":{"rendered":"<p>&#8230;using nrf24l01 radios and the tcs3200 color sensor.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nA word of warning: a chameleon does NOT change its color depending on the surface it is situated on, but depending on mood and temperature! This lamp does change its color depending on the color you show it. So we&#8217;re trying not to call it chameleon lamp.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nThis upgrade of a former project uses nrf24l01 spi-controlled cheap 2.4GHz radio modules for communication of the 10W RGB LED lamp built around an Arduino Pro Mini and three MBI6651 PWM-dimmable LED drivers.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nThe remote control uses a TCS3200 color sensor that uses rate coding to tell the microprocessor which color it senses. It is then packaged as a RGB string and sent to the lamp. For example pure red @ full brightness would be 255,0,0; The processor in the remote control is also an Atmega328p programmed in the Arduino IDE.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20131015_201445.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20131015_201445-300x225.jpg\" alt=\"20131015_201445\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-265\" srcset=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20131015_201445-300x225.jpg 300w, http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20131015_201445-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nThis project was another opportunity to create a DIY PCB. This time I took it to the next level and made it double-sided. A laser printer and laser transparencies were used, which is also an upgrade to inkjet stencils. I applied some toner density spray to the transparencies prior to exposing and hoped for better exposure results. It seemed to improve outcome.   Of course the good old solder coat was sprayed onto both sides after etching.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nNote: the extra holes are for the ribbon cable connector for a Pollin 2&#215;8 character LCD. I haven&#8217;t soldered it.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nThe color sensor board is attached face-down and therefore needs a window in the PCB. Made that using a PROXXON mill.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-top.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-top-300x225.jpg\" alt=\"chameleon tx top\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-270\" srcset=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-top-300x225.jpg 300w, http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-top-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nThe result was a good homemade PCB. The other extra holes are for a 7805 voltage regulator and a power pushbutton. Since the nrf modules are pretty solid and connect to each other immediately, you can just disconnect the transmitter from its power supply and the light remembers the color you showed it.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nThe device remains controllable via bluetooth UART (for example via Android applications).<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-bottom.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-bottom-300x225.jpg\" alt=\"chameleon tx bottom\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-269\" srcset=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-bottom-300x225.jpg 300w, http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/chameleon-tx-bottom-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nAfter testing I found out that the headers were too high for the sensor to properly detect surfaces and so I had to solder the TCS3200 PCB to the main PCB in a weird fashion in order to allow closer sample positioning to the sensor. Below the final version is shown with a 9V battery attached directly to the PCB.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161744.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161744-300x225.jpg\" alt=\"20140606_161744\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-273\" srcset=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161744-300x225.jpg 300w, http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161744-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161818.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161818-300x225.jpg\" alt=\"20140606_161818\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-274\" srcset=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161818-300x225.jpg 300w, http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/20140606_161818-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<iframe width=\"560\" height=\"315\" src=\"\/\/www.youtube.com\/embed\/yRREJwhz6Fo?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nArduino code for the transmitter and receiver:<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/ChameleonRGBlamp.rar\">ChameleonRGBlamp<\/a><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nEagle files for the transmitter (include schematics):<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/ChameleonTX.rar\">ChameleonTX<\/a><br \/>\ndammit, called it chameleon again.<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\nAndroid App code for Android SDK based on basic bluetooth socket code found online:<br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<br style=\u201dclear:both;\u201d \/><br \/>\n<a href=\"http:\/\/www.thinkering.de\/cms\/wp-content\/uploads\/2014\/06\/RGBlampRemote.zip\">RGBlampRemote<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8230;using nrf24l01 radios and the tcs3200 color sensor. A word of warning: a chameleon does NOT change its color depending on the surface it is situated on, but depending on mood and temperature! This lamp does change its color depending on the color you show it. So we&#8217;re trying not to call it chameleon lamp. &hellip; <a href=\"http:\/\/www.thinkering.de\/cms\/?p=264\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Color-Sensing RGB Light<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=\/wp\/v2\/posts\/264"}],"collection":[{"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264"}],"version-history":[{"count":7,"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":276,"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions\/276"}],"wp:attachment":[{"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thinkering.de\/cms\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}