{"id":1527,"date":"2012-11-07T16:49:53","date_gmt":"2012-11-07T22:49:53","guid":{"rendered":"http:\/\/www.firmwarez.com\/?p=1527"},"modified":"2012-11-07T16:49:53","modified_gmt":"2012-11-07T22:49:53","slug":"simple-rgb-led-driver","status":"publish","type":"post","link":"http:\/\/www.firmwarez.com\/?p=1527","title":{"rendered":"Simple RGB LED driver"},"content":{"rendered":"<p>So back on 17 Sept 12 I posted <a href=\"https:\/\/twitter.com\/i\/#!\/FirmWarez\/media\/slideshow?url=pic.twitter.com%2Fe0pcFhLf\" target=\"_blank\">this picture of a board layout<\/a> on twitter. <\/p>\n<p>This was just a quickie idea I threw together. I had to order a number of protos for customer projects, and decided to get a deal on copper and do a big panel with a number different boards all at once.  Boards were in my hands 19 Oct and here we go, on 7 Nov I&#8217;ve got some first order code running on my &#8220;Simple RGB&#8221; board.<\/p>\n<p>The thing is I love LEDs. Serious LEDs. Who doesn&#8217;t? What I wanted was simple but flexible RGB driver, that could be used both as a bench test tool and in other applications. After playing with some other processors, I ended up going with a Microchip PIC18F26K80 due to the multiple PWM outputs. I&#8217;ve done software PWM before to get multiple channels, but that&#8217;s a cumbersome solution compared to hardware PWMs. The board was designed with twin dual channel FETs that can handle 5A. So my &#8220;RGB&#8221; driver can actually handle four channels; remember, I said I wanted flexible. Power for the processor can be either direct from an outside regulated source or by an on-board regulator. I provided a header with serial port and power pins exposed; this could be used for custom serial control, DMX, MIDI, whatever.<\/p>\n<p><img src=\"http:\/\/www.firmwarez.com\/wp-content\/uploads\/2012\/11\/simpleRGB.jpg\" alt=\"simpleRGB\" width=\"550\"\/><\/p>\n<p>The main interface is via four nifty <a href=\"https:\/\/www.sparkfun.com\/search\/results?term=LED+tactile&#038;what=products\" target=\"_blank\">LED illuminated switches<\/a> I got from <a href=\"http:\/\/www.sparkfun.com\/\" target=\"_blank\">SparkFun<\/a>. The board has red, green, blue, and orange switches. Basic operation is quickly press a switch to toggle that color from full on to full off, or hold the switch down to run through 256 levels of PWM controlled brightness. I will probably add some functions to the orange switch for toggling between switch controlled, patterns, or &#8216;random&#8217; colors. In addition to the switches there is a jumper available, perhaps useful for &#8216;serial&#8217; or &#8216;switch controlled&#8217; selection. While running in &#8216;switch controlled&#8217; mode the serial port will output the current PWM settings. That way I can use the board to find colors I like for particular LEDs and then recreate those colors later.<\/p>\n<p>My first tests were with a high output RGB LED I picked up from e-bay. Yes, I&#8217;m using big ugly current limiting resistors instead of some more advanced (and efficient) technique.  Remember, this is meant to be simple. I&#8217;m running the board at 5V, though the 26K80 can run down to 1.8V. My only complaint right now is that the green switch LED isn&#8217;t nearly as bright as the others; I may be able to change that with the current limiting resistor.  <\/p>\n<p>The board has options for an external crystal. There are surface mount LEDs to indicate power on and one under control of the processor. There is also a small FET and output jumper for control of additional indicators, or whatever.<\/p>\n<p>I&#8217;ve got six of these boards on hand. I may make a couple of minor revs and make some more. I&#8217;ve considered changing it to incorporate serial, DMX, and MIDI support components, make for a very flexible little driver. I think my hot tub needs more high powered RGB LEDs; that does indeed look cool.<\/p>\n<p>Even though I&#8217;ve got a number of client and start-up projects, I like to throw something fun and easy like this in to the mix every now and then. I find it is helpful to have a &#8220;success guaranteed&#8221; project to keep things flowing. I&#8217;m considering releasing this little guy as an open source item. What do you think?<\/p>\n<p>(Ok, ok. The video is awful. I was fighting with focus the whole time because the high brightness LEDs kept messing with the camera. Excuses, excuses. If I didn&#8217;t need to get back on other projects I&#8217;d reshoot, but customers pay the bills! I&#8217;m still putting this up here, my next vid will be better!)<\/p>\n<div class=\"youtube_sc  fluid widescreen\"><div class=\"inner block\"><noscript><style type=\"text\/css\">.youtube_sc iframe.yp{display:none;}<\/style><object width=\"560\" height=\"340\" class=\"yp\" title=\"YouTube video player\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/tQL8OlvLzas?version=3&amp;hl=en_US\"><param name=\"allowscriptaccess\" value=\"always\"><param name=\"wmode\" value=\"transparent\"><embed src=\"http:\/\/www.youtube.com\/v\/tQL8OlvLzas?version=3&amp;hl=en_US\" width=\"560\" height=\"340\" class=\"yp\" type=\"application\/x-shockwave-flash\" wmode=\"transparent\" allowscriptaccess=\"always\"><span style=\"display:block;margin-top:15px;\">The Adobe Flash Player is required for video playback.<br><a href=\"http:\/\/get.adobe.com\/flashplayer\/\" title=\"Install from Adobe\">Get the latest Flash Player<\/a> or <a href=\"http:\/\/www.youtube.com\/watch?v=tQL8OlvLzas\" target=\"_blank\" title=\"Watch on YouTube\">Watch this video on YouTube<\/a>.<\/span><\/object><\/noscript><iframe src=\"http:\/\/www.youtube.com\/embed\/tQL8OlvLzas?version=3&amp;wmode=transparent\" width=\"560\" height=\"340\" class=\"yp\" title=\"YouTube video player\" frameborder=\"0\" allowfullscreen><\/iframe><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>So back on 17 Sept 12 I posted this picture of a board layout on twitter. This was just a quickie idea I threw together. I had to order a number of protos for customer projects, and decided to get a deal on copper and do a big panel with a number different boards all [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes"},"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=\/wp\/v2\/posts\/1527"}],"collection":[{"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1527"}],"version-history":[{"count":12,"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=\/wp\/v2\/posts\/1527\/revisions"}],"predecessor-version":[{"id":1540,"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=\/wp\/v2\/posts\/1527\/revisions\/1540"}],"wp:attachment":[{"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1527"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.firmwarez.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}