{"id":654,"date":"2011-02-02T03:24:55","date_gmt":"2011-02-02T08:24:55","guid":{"rendered":"http:\/\/scope-eye.net\/?p=654"},"modified":"2011-02-02T15:49:13","modified_gmt":"2011-02-02T20:49:13","slug":"infrared-sonic-screwdriver","status":"publish","type":"post","link":"https:\/\/scope-eye.net\/?p=654","title":{"rendered":"Infrared Sonic Screwdriver"},"content":{"rendered":"<p>I built this about a year ago for a friend who was getting his PhD.  It&#8217;s the 9th\/10th Doctor&#8217;s sonic screwdriver from Doctor Who. I added an infrared remote control circuit to it (based on the <a href=\"http:\/\/www.ladyada.net\/make\/tvbgone\/\">Lady Ada version of TV-B-Gone<\/a>), multiple UV LEDs in a random flashing pattern, then sealed the thing up and gave it a nice paint job to cover up the seam lines.<\/p>\n<p><a href=\"\/model-data\/sonic_screwdriver\/20110202_IR_sonic_screwdriver_overview.jpeg\"><img decoding=\"async\" src=\"\/model-data\/sonic_screwdriver\/20110202_IR_sonic_screwdriver_overview_thumb.jpeg\"><\/a><br \/>\n<!--more--><\/p>\n<p>I think projects like this are kind of popular among Doctor Who fans: after all, the sonic screwdriver is supposed to be able to do just about <em>anything<\/em>&#8230;  That&#8217;s a tall order, obviously, but making it do <em>something<\/em> is a start.  IR is nice, low-hanging fruit: you&#8217;ve got all kinds of devices out there in the world that will do what you tell them if you just send them the right IR code &#8211; no authentication or anything.  The parts are cheap, the circuit is small, and it doesn&#8217;t take a lot of power to get a decent signal out.  I&#8217;d love to do another one sometime with more functionality to it, but that&#8217;ll have to wait&#8230;<\/p>\n<p>The circuit has two parts: the &#8220;light show&#8221; which drives the seven UV LEDs, and the IR controller which sends codes to turn TVs on or off.  The light show is based on my <a href=\"\/?p=505\">Raven board<\/a>: I had plenty of these kicking around so all I really had to do was solder a chip on, program it, and wire it to the LEDs.  (Well, I also had to trim down the board to fit in the tight space at the head of the screwdriver&#8230;)  I tried to work out a way to have that board send the remote control codes as well, but there was no way that was gonna work.  The thing is, my Raven board is based around a PIC microcontroller, the 16F688 and its pin-compatible relatives.  I chose that particular type of PIC because it&#8217;s available in a small size with a good number of I\/O lines &#8211; they&#8217;re not terribly powerful otherwise.  These chips would have been perfectly adequate for sending the IR codes, but they lacked sufficient storage to hold the data table containing the IR codes.  Part of it is an architectural problem with the 16F-series PICs: the only way to store a data table on the chips is to store it as program code, a bunch of 14-bit instruction words, each containing 8 bytes of data.  (The AVR microcontrollers, on the other hand, use a 16-bit instruction word, and you can use that to store two bytes of data if you need to store a data table in program memory&#8230;  The PIC 18F family has that as well.)  I made some attempts to compile the program with a smaller version of the data table and squeeze something useful on to the PIC: but it became clear to me that it was going to be too much work, for too little yield.  I didn&#8217;t want to have to fabricate a new PCB for an AVR that could drive both the IR and the light show, so I went with two circuits instead.<\/p>\n<p>The &#8220;Light Show&#8221; consists of seven UV LEDs arranged radially around the IR LED in the center.  It was hell to put together, but once assembled and epoxied it was quite reliable.  The light show sequence picks a LED at random every once in a while and boosts its light level up to some value 50% or greater, and then the LED fades out until it gets boosted again. The sequence is random but every once in a while, by chance or something, it winds up looking like it&#8217;s spinning one way or the other. I think the effect turned out a lot nicer than if I&#8217;d just produced a spinning sequence or something. It was important to have the light show controller close to the LEDs due to the relatively large number of connections to the LEDs there &#8211; that simplified the wiring and allowed me to treat the whole front-end circuit (LEDs plus light-show controller) as a unit.<\/p>\n<p><a href=\"\/model-data\/sonic_screwdriver\/20110202_IR_sonic_screwdriver_head.jpeg\"><img decoding=\"async\" src=\"\/model-data\/sonic_screwdriver\/20110202_IR_sonic_screwdriver_head_thumb.jpeg\"><\/a><\/p>\n<p>The IR circuit got stuffed into the neck of the screwdriver &#8211; the spherical section just behind the head. I cut out a little bit of extra space inside there, and the circuit was stuffed inside each time I reassembled it.  The IR circuit is pretty small and pretty simple: the ATTiny85 is an 8-pin chip, and at SOIC size that&#8217;s about 6mmx6mm. The only connections it needed were power, a connection to the IR LED, and a crystal for the oscillator. When I was testing the breadboard version of the circuit I actually tried the ATTiny without the crystal (and set to use its internal clock source) &#8211; it seemed to work&#8230;  Though I only tested it with my own TV. Microcontrollers&#8217; internal clock sources aren&#8217;t super-precise, so I decided to play it safe and go with the crystal.<\/p>\n<p><a href=\"\/model-data\/sonic_screwdriver\/20110202_IR_sonic_screwdriver_neck.jpeg\"><img decoding=\"async\" src=\"\/model-data\/sonic_screwdriver\/20110202_IR_sonic_screwdriver_neck_thumb.jpeg\"><\/a><\/p>\n<p>It was kind of a frustrating project: the IR circuit is wired up without a circuit board, which meant that the connections were prone to breakage.  At one point I even broke a connection after the screwdriver was reassembled and repainted: I had to tear the thing apart to fix it &#8211; and in the process of fixing it other things broke, and I wound up rebuilding the whole circuit plus redoing the paint job. I brought the finished screwdriver with me to Tekkoshocon: I didn&#8217;t have a good opportunity to show off the IR feature, unfortunately.<\/p>\n<p>I also had some reliability issues: sometimes the IR circuit wouldn&#8217;t do its thing. My first guess was that the IR LED was drawing too much power, causing the battery voltage to drop and the AVR to go into brownout mode.  (That&#8217;d be a pretty significant drop &#8211; the AVR can operate on 3V, and the supply was 3 x LR44 cells, for a nominal total of 4.5V&#8230;)  To try and solve the problem, I added a hefty capacitor and a fourth cell to the power supply and a constant-current driver to the IR LED &#8211; I don&#8217;t know for sure exactly what caused the problem, but that seemed to clear it up.  Actually, though, my current best guess is that the reason the thing was going wrong is because I was foolish enough to gate my power supply for the microcontrollers through the pushbutton, rather than giving them a direct connection to the battery and using the switch as an input to bring the microcontrollers in and out of sleep mode. I had thought that this would help save power, or something &#8211; but the pushbutton really isn&#8217;t made to carry power: small changes in pressure or the angle of depression can change the thing&#8217;s resistance.  I think that may have been causing the brownouts.  Anyway, next time I build one of these I need to spend more time in the prototyping stage, and power the breadboard version with the same batteries that&#8217;ll be used in the final version &#8211; and no more last-minute design changes&#8230;<\/p>\n<p>I am planning to build a second one: this time around I&#8217;m going to use one AVR microcontroller for both the light show and the IR function.  I&#8217;ll have to come up with a circuit board design for the microcontroller and possibly one to hold the LEDs themselves. This means more planning up-front: I can&#8217;t take advantage of the Raven boards for an AVR circuit, and before I can design the board I need to prototype the circuit again to figure out exactly what needs to be on it&#8230;  Plus the AVR in question will likely be a surface-mount package with no leads, meaning that I&#8217;ll need to use a reflow method to solder it on&#8230;  But if I can work with that, installing the circuit into the screwdriver should be a snap.  I could probably even avoid disassembling the neck.<\/p>\n<p>I made a <a href=\"http:\/\/www.youtube.com\/watch?v=2SictiiBmEE\">video<\/a> demonstrating the screwdriver in action &#8211; I think before I make any more videos I need to think about how to present myself better.  :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I built this about a year ago for a friend who was getting his PhD. It&#8217;s the 9th\/10th Doctor&#8217;s sonic screwdriver from Doctor Who. I added an infrared remote control circuit to it (based on the Lady Ada version of TV-B-Gone), multiple UV LEDs in a random flashing pattern, then sealed the thing up and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[56,75,42,55],"_links":{"self":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts\/654"}],"collection":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=654"}],"version-history":[{"count":5,"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions"}],"predecessor-version":[{"id":659,"href":"https:\/\/scope-eye.net\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions\/659"}],"wp:attachment":[{"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scope-eye.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}