<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5353486203196595217</id><updated>2012-02-16T01:28:12.937-08:00</updated><title type='text'>ME Hax</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-2808618616779977417</id><published>2011-07-16T23:31:00.000-07:00</published><updated>2011-07-18T09:56:31.766-07:00</updated><title type='text'>Super Ultra High Power Telephoto Lens Hack</title><content type='html'>Last night was a full moon and it happened to be a very clear night. There were a couple stray clouds meandering across the night sky to which my dad alerted me and suggested I grab my camera. I grabbed my&amp;nbsp;shiny new Nikon D3100&amp;nbsp;and headed out to grab some shots of the moon, but as I only had the kit 18-55mm Nikkor lens, I was not planning on any close ups. This is what I started expecting:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nvYkCGTsMS0/TiJ7dwLdX6I/AAAAAAAAALY/3roiHZGTJLg/s1600/moon+010.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="425" src="http://2.bp.blogspot.com/-nvYkCGTsMS0/TiJ7dwLdX6I/AAAAAAAAALY/3roiHZGTJLg/s640/moon+010.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I make it outside just as the clouds are passing but grabbed a few pics anyway, as it was nice out and still looked cool. My dad&amp;nbsp;mentioned&amp;nbsp;how back in the day, people would go out and shoot entire rolls of film of the moon with it in different locations to use later in enhancing other pictures. That seemed pretty cool, but we discussed the miracles of the GIMP and other things with cut and paste editing. Anyway, the idea of actually looking at the moon came up and I mentioned how awesome it looked through my spotting scope. shortly thereafter I made a trip inside and grabbed my Gander Mountain 12-50x scope and a tripod. At 50x, the moon entirely filled the eyepiece of the scope with great detail.&lt;br /&gt;&lt;br /&gt;Since the camera was still outside, I decided to see how well it worked if I just put the camera behind the scope and looked through it. It actually worked fantastically well. Though it was very difficult to hold still and keep the moon in the frame, I managed to grab a couple awesome shots such as the one below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/27382996@N04/5938628295/" title="Moon Hax by Mista Sparkle, on Flickr"&gt;&lt;img alt="Moon Hax" height="427" src="http://farm7.static.flickr.com/6015/5938628295_a8f96a1656_z.jpg" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With the great success that that experiment led to, I promptly set about the task of making a more stable lens hack platform. For this platform, I planned on just using a board with some 1/4-20 bolts to hold everything in place and to allow the camera to be positioned up high enough so that it would be on axis with the scope. initially I had only placed a single hole for a bolt for each the scope and camera, but found that I needed to adjust the distance between them more than I had anticipated, so one of the holes became a slot with the help of a 1/4" router bit and the drill press (I was far too impatient to bother setting up the router).&lt;br /&gt;&lt;br /&gt;To provide a way to attache the mount to my tripod, I drilled a 3rd hole and counter bored it&amp;nbsp;slightly&amp;nbsp;and pressed a 1/4-20 nut into it. This later proved to not work so well as it was terribly not balanced, so I later adjusted it. When replacing it, I also &amp;nbsp;filed some notches into the bolt and Guerrilla&amp;nbsp;Glued it into place. Hopefully the notches and expanding action of the glue will keep it snug this time.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-cghgpU5lapI/TiJ7rve1NqI/AAAAAAAAALg/NDeO-3-4I_w/s1600/spotting+scope+lens+hack+009.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-cghgpU5lapI/TiJ7rve1NqI/AAAAAAAAALg/NDeO-3-4I_w/s400/spotting+scope+lens+hack+009.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When it all gets put together, it looks something like this:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vdQ74bQ5AY8/TiJ8MyAuyJI/AAAAAAAAALw/5aF2qESMMaU/s1600/spotting+scope+lens+hack+015.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://3.bp.blogspot.com/-vdQ74bQ5AY8/TiJ8MyAuyJI/AAAAAAAAALw/5aF2qESMMaU/s640/spotting+scope+lens+hack+015.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;and can take pictures like these:&lt;br /&gt;&lt;br /&gt;mailbox ~300'&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-KdHzYPgPUNE/TiJ56NdBfDI/AAAAAAAAALI/Um0QRVKG0Ms/s1600/more+lens+hack+003.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" src="http://3.bp.blogspot.com/-KdHzYPgPUNE/TiJ56NdBfDI/AAAAAAAAALI/Um0QRVKG0Ms/s640/more+lens+hack+003.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Green thing ~90'&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-8ZwCrWDLCwY/TiJ-43XnZMI/AAAAAAAAAL4/y0n8Z-dt370/s1600/more+lens+hack+001.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" src="http://3.bp.blogspot.com/-8ZwCrWDLCwY/TiJ-43XnZMI/AAAAAAAAAL4/y0n8Z-dt370/s640/more+lens+hack+001.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vONJAvZ5gy4/TiJ6CTy38YI/AAAAAAAAALM/6B44RgAPs1M/s1600/more+lens+hack+009.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="422" src="http://3.bp.blogspot.com/-vONJAvZ5gy4/TiJ6CTy38YI/AAAAAAAAALM/6B44RgAPs1M/s640/more+lens+hack+009.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-tiqUfbY6yKE/TiJ8Z6vm01I/AAAAAAAAAL0/iJXzE7ocC28/s1600/Moon+green.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="422" src="http://1.bp.blogspot.com/-tiqUfbY6yKE/TiJ8Z6vm01I/AAAAAAAAAL0/iJXzE7ocC28/s640/Moon+green.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Overall, though the&amp;nbsp;image&amp;nbsp;quality is nowhere near fantastic and does not fill the whole sensor, it is still quite excellent for the price. It does not respond well with small&amp;nbsp;apertures&amp;nbsp;as there is major vignetting, which is improved greatly with wider&amp;nbsp;apertures. There also is a lot of chromatic&amp;nbsp;aberration&amp;nbsp;present, especially if the camera and scope are slightly off axis. I believe that CA is still present when using the scope on ts own as it really&amp;nbsp;isn't&amp;nbsp;designed for this use... In the final pic of the moon above, I removed the red and blue channels and desaturated it, to remove large amounts of CA&lt;br /&gt;&lt;br /&gt;But yeah, reasonable very long lens for maybe $2 in parts(or entirely scrap if you have a proper basement)? Sounds great to me =]&lt;br /&gt;&lt;br /&gt;These few pics are hosted in 14.2MP at&lt;a href="https://picasaweb.google.com/101557827201623541237/LensHack?authuser=0&amp;amp;authkey=Gv1sRgCIqGisPLuITp0QE&amp;amp;feat=directlink"&gt; my Picasa&lt;/a&gt;&lt;br /&gt;also, check out &lt;a href="http://www.flickr.com/photos/27382996@N04/"&gt;my Flickr...&lt;/a&gt;&amp;nbsp;for some more interesting stuff but limited hosting and such...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-2808618616779977417?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/2808618616779977417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2011/07/super-ultra-high-power-telephoto-lens.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/2808618616779977417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/2808618616779977417'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2011/07/super-ultra-high-power-telephoto-lens.html' title='Super Ultra High Power Telephoto Lens Hack'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-nvYkCGTsMS0/TiJ7dwLdX6I/AAAAAAAAALY/3roiHZGTJLg/s72-c/moon+010.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-3195425736513493151</id><published>2011-02-21T00:06:00.000-08:00</published><updated>2011-02-23T09:32:58.618-08:00</updated><title type='text'>Arduino Stroboscope</title><content type='html'>I was watching TV a bit ago and playing with my model wind turbine from my fluids class and was having a good time playing with aliasing. From there, the obvious answer to my problem that I didn't really have was to build a stroboscope. This little tangent has resulted in a stroboscope capable of measuring rotational speeds from 577 to 30,000 rpm.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nNS-w1-sknk/TWIc7kGmpgI/AAAAAAAAAEw/TYCV4mP2BJw/s1600/Stroboscope.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://2.bp.blogspot.com/-nNS-w1-sknk/TWIc7kGmpgI/AAAAAAAAAEw/TYCV4mP2BJw/s320/Stroboscope.bmp" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Before I get too far into the code and such, a brief description of a stroboscope is in order. A stroboscope is essentially a pulsed light at a known frequency. when the frequency of a rotating object matches that of the stroboscope, it appears to stand still. It is possible for the object to be moving at a multiple of the strobe frequency as well. for more info check out the interwebs or something.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;My Arduino was already set up with 6 LEDs connected to ports 3, 5, 6, 9, 10, and 11 so I used that as a starting place. Since I don't have any drivers or expertise yet in dealing with led/lcd displays, I decided that the serial out would work for taking measurements.first I started trying to use the tone function, however, the 50% duty cycle was not adequate for my needs. The next step was to use a time based funtion that would be independent of the time it took to run the code. This was solved using millis(); however this did not produce adequate results as will be discussed later.&lt;br /&gt;&lt;br /&gt;A potentiometer was used to control the strobe rate running off pin A0. all 6 LEDs were used as brighter is better. The basic circuit is about a follows:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-OOu2kXhz-t0/TWIZpN_SGPI/AAAAAAAAAEs/vKCLpLGfECc/s1600/Stroboscope.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="225" src="http://2.bp.blogspot.com/-OOu2kXhz-t0/TWIZpN_SGPI/AAAAAAAAAEs/vKCLpLGfECc/s320/Stroboscope.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Jyu3mzd3xoM/TWIZQVAzzZI/AAAAAAAAAEo/JO1BKLW9IKQ/s1600/Stroboscope.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;What really makes it tick is the code. Its split into 2 sections because if you use only millis(), resolution at high speeds is terrible. I then tried using only micros() but then the lowest frequency was 31hz or about 1800 rpm. I split the code so that for high speed, it uses a version based on mircos() and low speed uses millis(). This split allowed for good resolution to about from 9.7Hz to 300Hz.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;In terms of displaying the speed, I used a simple serial output to read the strobe rate as well as the rotational speed in rpm. To avoid delaying the program unnecessarily, the speeds are only reported 5 times per second. I had also noticed that having the serial port set to 9600 baud would cause errors in code execution. In order to handle data transfer, the baud rate was set to 115200. With the higher baud rate, everything seems to run smoothly.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Overall it was a neat little project that could prove to be very useful later on. Here is a little video that kind of shows it working, though that is a bit difficult to convey. It would have been nice to have an accurate stroboscope for some of my other projects, and now that I do essentially have one, I'm sure it will find some more interesting uses.&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I have included a video&amp;nbsp; that somewhat shows it working, but for best results, you would actually be using it. That and the video that my camera takes is horrid...&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-f507caeb817767cd" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v13.nonxt3.googlevideo.com/videoplayback?id%3Df507caeb817767cd%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1333390369%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DEFC7ECB702D304273CB24AF49B804C38913A046.1AEE4C9ED3428BCFB246E557BA9DC070769BEECC%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Df507caeb817767cd%26offsetms%3D5000%26itag%3Dw160%26sigh%3DWo2v0U_6tRux0DYj4OyBUK_2n-s&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v13.nonxt3.googlevideo.com/videoplayback?id%3Df507caeb817767cd%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1333390369%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DEFC7ECB702D304273CB24AF49B804C38913A046.1AEE4C9ED3428BCFB246E557BA9DC070769BEECC%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Df507caeb817767cd%26offsetms%3D5000%26itag%3Dw160%26sigh%3DWo2v0U_6tRux0DYj4OyBUK_2n-s&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Its pretty cool, It even has a variable delay for how long to leave the LEDs on so it always will produce a sharp image with a constant brightness.I was quite surprised at how well the arduino was handling the math for how sensitive it was.&lt;br /&gt;&lt;br /&gt;If anyone has an idea of something else cool to use it for, don't hesitate to mention it =] &lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;And obviously some code =]&lt;br /&gt;&lt;br /&gt;**EDIT: This is the newer code.. The new code uses micros()exclusively using an unsigned long for 17-2,500Hz so 1,020rpm to 150,000rpm The older code can be found &lt;a href="http://mehax.blogspot.com/p/older-stroboscope-code.html"&gt;here&lt;/a&gt;** &lt;/div&gt;&lt;pre&gt;&lt;span style="color: #7e7e7e;"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&amp;nbsp;Analog&amp;nbsp;input,&amp;nbsp;serial&amp;nbsp;output&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Reads&amp;nbsp;an&amp;nbsp;analog&amp;nbsp;input&amp;nbsp;pin,&amp;nbsp;uses&amp;nbsp;this&amp;nbsp;value&amp;nbsp;as&amp;nbsp;a&amp;nbsp;time&amp;nbsp;delay&amp;nbsp;for&amp;nbsp;a&amp;nbsp;stroboscope.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Also&amp;nbsp;sends&amp;nbsp;frequency&amp;nbsp;info&amp;nbsp;back&amp;nbsp;via&amp;nbsp;serial.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;The&amp;nbsp;circuit:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*&amp;nbsp;potentiometer&amp;nbsp;connected&amp;nbsp;to&amp;nbsp;analog&amp;nbsp;pin&amp;nbsp;0.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Center&amp;nbsp;pin&amp;nbsp;of&amp;nbsp;the&amp;nbsp;potentiometer&amp;nbsp;goes&amp;nbsp;to&amp;nbsp;the&amp;nbsp;analog&amp;nbsp;pin.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;side&amp;nbsp;pins&amp;nbsp;of&amp;nbsp;the&amp;nbsp;potentiometer&amp;nbsp;go&amp;nbsp;to&amp;nbsp;+5V&amp;nbsp;and&amp;nbsp;ground&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*&amp;nbsp;LEDs&amp;nbsp;connected&amp;nbsp;from&amp;nbsp;digital&amp;nbsp;pins&amp;nbsp;3,5,6,9,10,and&amp;nbsp;11&amp;nbsp;to&amp;nbsp;ground&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;created&amp;nbsp;2/20/2011&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="color: #7e7e7e;"&gt; modified 2/21/2011&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;by&amp;nbsp;Steve&amp;nbsp;Krave&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;//sets&amp;nbsp;constants&lt;/span&gt;&lt;br /&gt;const&amp;nbsp;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; analogInPin = A0;  &lt;span style="color: #7e7e7e;"&gt;// Analog input pin that the potentiometer is attached to&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;//&amp;nbsp;Variables&amp;nbsp;etc...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;float&lt;/span&gt; sensorValue = 1;       &lt;span style="color: #7e7e7e;"&gt;// value read from the pot&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;float&lt;/span&gt; hold = 1;              &lt;span style="color: #7e7e7e;"&gt;// hold time between iterations (sort of)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;float&lt;/span&gt; holdFrequency = 1;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;unsigned&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;long&lt;/span&gt; microsPrev = 0;       &lt;span style="color: #7e7e7e;"&gt;// set up value for timing       &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;unsigned&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;long&lt;/span&gt; microsCurrent = 0;    &lt;span style="color: #7e7e7e;"&gt;// used for timing purposes&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;unsigned&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;long&lt;/span&gt; millisSerial =0;      &lt;span style="color: #7e7e7e;"&gt;//used for serial output timing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;float&lt;/span&gt; frequency = 1;         &lt;span style="color: #7e7e7e;"&gt;// stores frequency&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;float&lt;/span&gt; rpm = 0;              &lt;span style="color: #7e7e7e;"&gt;// rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;&lt;b&gt;setup&lt;/b&gt;&lt;/span&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;// initialize serial communications at 115200 bps&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;// lower speeds can delay execution&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;begin&lt;/span&gt;(115200); &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//initialize pins as outputs&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;pinMode&lt;/span&gt;(3, &lt;span style="color: #006699;"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;pinMode&lt;/span&gt;(5, &lt;span style="color: #006699;"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;pinMode&lt;/span&gt;(6, &lt;span style="color: #006699;"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;pinMode&lt;/span&gt;(9, &lt;span style="color: #006699;"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;pinMode&lt;/span&gt;(10, &lt;span style="color: #006699;"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;pinMode&lt;/span&gt;(11, &lt;span style="color: #006699;"&gt;OUTPUT&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;&lt;b&gt;loop&lt;/b&gt;&lt;/span&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;// this while is a workaround for timer limitations using micros vs millis&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;sensorValue&amp;nbsp;=&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogRead&lt;/span&gt;(analogInPin);   &lt;span style="color: #7e7e7e;"&gt;//take potentiometer reading&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;hold&amp;nbsp;=&amp;nbsp;sensorValue*55&amp;nbsp;+&amp;nbsp;400;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//add some time to scale and for code execution&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;microsCurrent&amp;nbsp;=&amp;nbsp;&lt;span style="color: #cc6600;"&gt;micros&lt;/span&gt;();                &lt;span style="color: #7e7e7e;"&gt;// collect current time&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;if&lt;/span&gt; (microsCurrent &amp;gt; microsPrev + hold){  &lt;span style="color: #7e7e7e;"&gt;//set up timing loop&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;frequency&amp;nbsp;=&amp;nbsp;1000000/(microsCurrent&amp;nbsp;-&amp;nbsp;microsPrev);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;microsPrev&amp;nbsp;=&amp;nbsp;microsPrev&amp;nbsp;+&amp;nbsp;hold;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//set up millis for delay stuff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//set all 6 LEDs high (they were already plugged in)&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(3,&lt;span style="color: #006699;"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(5,&lt;span style="color: #006699;"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(6,&lt;span style="color: #006699;"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(9,&lt;span style="color: #006699;"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(10,&lt;span style="color: #006699;"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(11,&lt;span style="color: #006699;"&gt;HIGH&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delayMicroseconds&lt;/span&gt;(.02*hold);  &lt;span style="color: #7e7e7e;"&gt;//leave LEDs on long enough to see&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//set all LEDs low&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(3,&lt;span style="color: #006699;"&gt;LOW&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(5,&lt;span style="color: #006699;"&gt;LOW&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(6,&lt;span style="color: #006699;"&gt;LOW&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(9,&lt;span style="color: #006699;"&gt;LOW&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(10,&lt;span style="color: #006699;"&gt;LOW&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;digitalWrite&lt;/span&gt;(11,&lt;span style="color: #006699;"&gt;LOW&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;if&lt;/span&gt;(&lt;span style="color: #cc6600;"&gt;millis&lt;/span&gt;() &amp;gt; millisSerial + 200){ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;millisSerial=&lt;span style="color: #cc6600;"&gt;millis&lt;/span&gt;();    &lt;span style="color: #7e7e7e;"&gt;//reset timer&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;holdFrequency&amp;nbsp;=&amp;nbsp;1000000/hold;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//do some math to find values&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rpm&amp;nbsp;=&amp;nbsp;frequency&amp;nbsp;*&amp;nbsp;60;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;// print the results to the serial monitor:&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//      Serial.print("sensor  " );      //print sensor data for debug&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//      Serial.print(sensorValue);&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//Serial.print("holdFreq = " );                       &lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//Serial.print(holdFrequency);&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"  freq = "&lt;/span&gt; );                       &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(frequency);      &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"  rpm = "&lt;/span&gt;);      &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(rpm);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-3195425736513493151?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/3195425736513493151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2011/02/arduino-stroboscope.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/3195425736513493151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/3195425736513493151'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2011/02/arduino-stroboscope.html' title='Arduino Stroboscope'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-nNS-w1-sknk/TWIc7kGmpgI/AAAAAAAAAEw/TYCV4mP2BJw/s72-c/Stroboscope.bmp' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-8842145750965718320</id><published>2011-02-17T14:12:00.000-08:00</published><updated>2011-02-17T14:14:01.717-08:00</updated><title type='text'>6 channel serial LED Dimmer w/ Arduino</title><content type='html'>While continuing research for senior project we came across the LanBox DMX controller. It essentially takes a hex string and converts it to DMX. Since the LanBox is expensive and we only have one, I wanted to make something that could function similarly for prototyping applications.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-rGdUe6Um-HI/TV2bRCO_ZkI/AAAAAAAAAEk/wGRmA4Vovaw/s1600/008.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-rGdUe6Um-HI/TV2bRCO_ZkI/AAAAAAAAAEk/wGRmA4Vovaw/s400/008.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;What I came up with was using all 6 PWM pins on the Arduino and assigning them intensities through a serial string beginning with "A"&lt;br /&gt;&lt;br /&gt;Since allowable intensities varied between 0 and 255 I had the code break down the serial string into chunks of 3 characters. I dont know a whole ton about hex, but it would have been ideal.&lt;br /&gt;&lt;br /&gt;So if you send the string "A255000255000122200"&lt;br /&gt;channel intensities would be&lt;br /&gt;&lt;ol&gt;&lt;li&gt;255&lt;/li&gt;&lt;li&gt;000&lt;/li&gt;&lt;li&gt;255&lt;/li&gt;&lt;li&gt;000&lt;/li&gt;&lt;li&gt;122&lt;/li&gt;&lt;li&gt;200&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The idea is that a whole string of all the instrument (LED) values would be sent in some sort of loop to control dimming operations so that minimal to no code would have to reside on the dmx device improving reliability of the system.&lt;br /&gt;&lt;br /&gt;In the meantime, this is the code that I have come up with ideally I would like to be able to send information only on certain channels with some sort of identifier.&lt;br /&gt;&lt;br /&gt;The exact code that is currently in use can be found after the break&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;span id="goog_596930719"&gt;&lt;/span&gt;&lt;span id="goog_596930720"&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: #7e7e7e;"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;this&amp;nbsp;is&amp;nbsp;a&amp;nbsp;chunk&amp;nbsp;of&amp;nbsp;stuff&amp;nbsp;to&amp;nbsp;fade&amp;nbsp;3&amp;nbsp;leds&amp;nbsp;from&amp;nbsp;serial&amp;nbsp;read&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;//Callout&amp;nbsp;LED&amp;nbsp;pins&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; ledA = 3;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; ledD = 5;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; ledC = 6;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; ledE = 9;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; ledF = 10;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; ledG = 11;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; A_lvl =64;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; D_lvl =64;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; C_lvl =64;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; E_lvl =64;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; F_lvl =64;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; G_lvl =64;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;char&lt;/span&gt; kind_of_data;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;&lt;b&gt;setup&lt;/b&gt;&lt;/span&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;begin&lt;/span&gt;(115200); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledA, A_lvl);         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledD, D_lvl);   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledC, C_lvl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledE, E_lvl);         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledF, F_lvl);   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledG, G_lvl);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;&lt;b&gt;loop&lt;/b&gt;&lt;/span&gt;()  { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;while&lt;/span&gt;(&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;available&lt;/span&gt;() &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;kind_of_data&amp;nbsp;=&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;if&lt;/span&gt; (kind_of_data == &lt;span style="color: #006699;"&gt;'A'&lt;/span&gt; ) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; A100 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; A10 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; A1 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A_lvl=A1+10*A10+A100*100;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; D100 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; D10 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; D1 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;D_lvl=D1+10*D10+D100*100;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; C100 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; C10 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; C1 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;C_lvl=C1+10*C10+C100*100;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; E100 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; E10 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; E1 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;E_lvl=E1+10*E10+E100*100;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; F100 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; F10 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; F1 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;F_lvl=F1+10*F10+F100*100;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; G100 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; G10 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;double&lt;/span&gt; G1 = &lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;read&lt;/span&gt;()- &lt;span style="color: #006699;"&gt;'0'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;G_lvl=G1+10*G10+G100*100;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledA, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt;(A_lvl));         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledD, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt;(D_lvl));   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledC, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt;(C_lvl));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledE, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt;(E_lvl));         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledF, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt;(F_lvl));   &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;analogWrite&lt;/span&gt;(ledG, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt;(G_lvl));&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"A: "&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(A_lvl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"D: "&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(D_lvl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"C: "&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(C_lvl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"E: "&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(E_lvl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"F: "&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(F_lvl);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(&lt;span style="color: #006699;"&gt;"G: "&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;println&lt;/span&gt;(G_lvl); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-8842145750965718320?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/8842145750965718320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2011/02/6-channel-serial-led-dimmer-w-arduino.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/8842145750965718320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/8842145750965718320'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2011/02/6-channel-serial-led-dimmer-w-arduino.html' title='6 channel serial LED Dimmer w/ Arduino'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-rGdUe6Um-HI/TV2bRCO_ZkI/AAAAAAAAAEk/wGRmA4Vovaw/s72-c/008.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-5280904306765145532</id><published>2011-02-05T17:11:00.000-08:00</published><updated>2011-02-05T17:15:52.430-08:00</updated><title type='text'>DIY temp controlled fermentation chamber from broken fridge.</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;/div&gt;(reposted from last year from &lt;a href="http://www.homebrewtalk.com/f51/heated-ferm-fridge-stuff-laying-around-157850/"&gt;Homebrewtalk&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;So a couple weeks ago, my fridge broke. Since I live in an apartment,  the landlord had a new one brought&lt;br /&gt;&lt;div style="text-align: left;"&gt; 3 flights of stairs by his crew. I  saw an opportunity in this as it took those guys around 20 minutes to  bring the new one up. I asked them if I could keep it and they said  "sure go ahead." I now had this dead fridge out in my 30º sun room that I  needed to get working on. I already had a thermostat in my closet, but  the closet has been proving too leaky to keep at a reasonable temp. So  it worked out really well.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&amp;nbsp;&lt;img alt="Running" height="200" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/running.jpg" width="150" /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Here's what I did.&amp;nbsp;&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;I went to home depot to get a soldering iron so I could start  piecing this thing together with my old Honeywell classic mercury  thermometer. On the clearance rack, there was a Honeywell  non-programmable digital thermostat for $15 from $30. Score!  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="thermostat" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/Thermostat.jpg" width="400" /&gt;    &lt;/div&gt;&lt;div style="text-align: left;"&gt;I proceeded to tear it apart so I could move the thermistor  inside the fridge. If I had the option, I didn't want to have to open  the fridge to check or change the temp.     &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="thermostat2" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/Thermostat2.jpg" width="400" /&gt;    &lt;/div&gt;&lt;div style="text-align: left;"&gt;Getting the thermistor off was easy, I had a hard time getting  it back on as I had no way to remove the old solder so I couldn't get  the leads through easily and when they did punch through, they took the  solder pads with them. I also need more practice on smaller things, I'm  used to soldering larger things like PA speakers and cables  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="thermistor" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/Thermistor.jpg" width="400" /&gt;  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="thermostat3" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/Thermostat3.jpg" width="400" /&gt;    &lt;/div&gt;&lt;div style="text-align: left;"&gt;After adding the jumper to the thermistor, I punched some holes in the fridge and ran the cable outside.   &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="cable2" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/cable2.jpg" width="400" /&gt;  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="cable3" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/cable3.jpg" /&gt;   &lt;/div&gt;&lt;div style="text-align: left;"&gt;My roommate &lt;a href="http://stupidhax.blogspot.com/" target="_blank"&gt;Gigawatts&lt;/a&gt;  and I had built a control box type thingy with an older thermostat to  keep the closet warm while out of town so we just adapted it to this  build. It contains a 12V wall adapter, a 12V relay, a male IEC connector  (like on your computer power supply) and a standard Edison plug for  whatever 120V appliance we wanted to switch. I added an ethernet port to  the back of it so it didn't have to be hard wired into my thermostat.   &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="control1" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/control1.jpg" width="400" /&gt;  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="control2" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/control2.jpg" width="400" /&gt;    &lt;/div&gt;&lt;div style="text-align: left;"&gt;Since this fridge was outside essentially and temps were  dropping into the 20's, the batteries weren't holding out so we used one  of the spare pairs in the ethernet cable to send 3V to the thermostat  so the batteries were no longer needed. The 12V to 3V circuit is in the  bottom left of the box, near the blue tape.  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="control3" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/control3.jpg" width="400" /&gt;  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="control4" height="300" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/control4.jpg" width="400" /&gt;    &lt;/div&gt;&lt;div style="text-align: left;"&gt;For heating the fridge, I had planned on using the defrost  element from the evap coil in the freezer, but at 450 watts, it was  creating an extremely hot layer at the top of the fridge and I was  getting temp swings of 12º as it started mixing down. I am looking for a  small 120V fan that I could stick in there to mix things up, but until  then, I will be using a 100 watt incandescent lamp. Its still plenty  powerful to keep the fridge warm, but I would feel better with something  that wont shatter if it gets wet or something. This is what I ended up  with. It will probably hold 2 standard ale pails, but the fermenter in  there now is quite a bit wider and shorter than my other fermenters.  &lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="Running" height="400" src="http://hilltop.bradley.edu/%7Eskrave/image/Beer/running.jpg" width="300" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-5280904306765145532?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/5280904306765145532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2011/02/diy-temp-controlled-fermentation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/5280904306765145532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/5280904306765145532'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2011/02/diy-temp-controlled-fermentation.html' title='DIY temp controlled fermentation chamber from broken fridge.'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-2959778729934066037</id><published>2011-02-04T21:39:00.000-08:00</published><updated>2011-02-07T15:17:29.235-08:00</updated><title type='text'>Closed loop evaporative wort chiller</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;A port of my post from &lt;a href="http://homebrewtalk.com/"&gt;Homebrewtalk.com&lt;/a&gt; found at &lt;a href="http://www.homebrewtalk.com/f51/closed-loop-evaporative-wort-chiller-217094/"&gt;http://www.homebrewtalk.com/f51/closed-loop-evaporative-wort-chiller-217094/&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;Reading the forums, I noticed that a lot of people were feeling somewhat  guilty about all the water that they go through chilling their beer. As  a good engineer interested in thermodynamics, I decided that I would  take a shot at tackling this problem. Since many of the people with the  water issues were in warm climates with fairly warm water temperatures  tended to be in the southwest, I decided that an evaporative chiller  would be the easiest and most effective way to go.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://sphotos.ak.fbcdn.net/hphotos-ak-snc6/hs063.snc6/167361_614703138135_31404199_35120945_2864456_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="" border="0" height="300" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc6/hs063.snc6/167361_614703138135_31404199_35120945_2864456_n.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;My cooling system consists of the following parts connected in this order&lt;br /&gt;1: High head pump (115' head, 650GPH))&lt;br /&gt;2: Wort chiller (I used an immersion chiller but a counterflow or other isolated chiller would work as well)&lt;br /&gt;3: Spray head (constructed out of PVC, 1/8" hole with flat surface to disperse water, I used a  14 Ga. copper wire)&lt;br /&gt;4: Spray Column (used some circular duct from an old furnace install)&lt;br /&gt;5: Reservoir (An old trash can in my case, I cleaned it, but it doesn't really matter)&lt;br /&gt;&lt;br /&gt;The idea is to pump the water through the chiller and disperse it into a  fine mist while moving massive amounts of air to evaporate as much  water as possible. Each pound of water evaporated removes about 960 BTU  from the environment in the form of a temperature drop. With evaporative  cooling, it is possible to cool the working fluid down to the dew point  so that means you can cool below the outside temperature which can be  very significant in dry climates.&lt;br /&gt;&lt;br /&gt;I have some more pics and details of the rig following&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;img alt="" border="0" height="400" src="http://sphotos.ak.fbcdn.net/hphotos-ak-snc6/hs054.snc6/168450_614703198015_31404494_35120948_3962362_n.jpg" width="222" /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;The rig worked very well, however it should be noted that we were  working in 20 degree weather. We were able to cool 5 gallons of beer  from 180 to 80 in about 6 minutes which is on par with what I was able  to achieve with straight well water. We did have a failure in the system  as one of the hoses obtained from the trash essentially burst in use  but lasted long enough for some results.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;A pic of the spray head&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_vRkxiT1abas/TSz0XhsthtI/AAAAAAAAADY/JA97bqRghN0/s800/Beer%20and%20New%20Years%20052.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="245" src="http://3.bp.blogspot.com/_vRkxiT1abas/TSz0XhsthtI/AAAAAAAAADY/JA97bqRghN0/s320/Beer%20and%20New%20Years%20052.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;A pic of the system in action during the first test run. notice the ice. During the first test, it brought 4 gallons of water from 60F to a tub of slush in 7 minutes&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_vRkxiT1abas/TSz0XyZKc0I/AAAAAAAAADc/fEQ4K2sYe4A/s800/Beer%20and%20New%20Years%20041.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/_vRkxiT1abas/TSz0XyZKc0I/AAAAAAAAADc/fEQ4K2sYe4A/s320/Beer%20and%20New%20Years%20041.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Some other relevant info:&lt;br /&gt;With the mist nozzle on, flow rates of 4GPM were obtained. this was using a 1/8" orifice.&lt;br /&gt;Estimated airflow would be between 400 and 600CFM without any fans etc...&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;A couple videos of it in action&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://0.gvt0.com/vi/kzl5AZvggHw/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/kzl5AZvggHw&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/kzl5AZvggHw&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://3.gvt0.com/vi/C8LNod8dzHs/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/C8LNod8dzHs&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/C8LNod8dzHs&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/div&gt;Hopefully I can dig up a new hose and some better fittings and improve upon it a bit this spring. I am quite curious as to how it will perform in higher temperatures&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-2959778729934066037?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/2959778729934066037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2011/02/closed-loop-evaporative-wort-chiller.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/2959778729934066037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/2959778729934066037'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2011/02/closed-loop-evaporative-wort-chiller.html' title='Closed loop evaporative wort chiller'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_vRkxiT1abas/TSz0XhsthtI/AAAAAAAAADY/JA97bqRghN0/s72-c/Beer%20and%20New%20Years%20052.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-5739433654479000151</id><published>2011-02-04T20:57:00.000-08:00</published><updated>2011-02-05T15:00:49.951-08:00</updated><title type='text'>Prototype for Arduino control of Midi Dimmer pack</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;For my ME Senior Project this year, I have been assigned to work with the Galena Historical Society in Galena, Illinois. My Group has the task of designing three different exhibits for the museum. One exhibit involves the creation of a holographic type projection of Ulysses S. Grant and his wife Julia. The second exhibit is an interactive exhibit designed to highlight the famous &lt;i&gt;Peace in Union&lt;/i&gt; painting, which will possibly be using this Arduino control, and a third hypothetical exhibit consisting of a rotating/translating display case. Write ups or more details on the display case and holographic projection may be posted later.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_vRkxiT1abas/TUzR6H93yBI/AAAAAAAAADo/itorwtZAlCc/s1600/peace.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="211" src="http://1.bp.blogspot.com/_vRkxiT1abas/TUzR6H93yBI/AAAAAAAAADo/itorwtZAlCc/s320/peace.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span id="goog_659457545"&gt;&lt;/span&gt;&lt;span id="goog_659457546"&gt;&lt;/span&gt; &lt;br /&gt;For the illuminated painting, the idea is to have a touchscreen with a digital version of the painting. Guests will be able to click on the individual figures to learn more about everyone contained in the painting. When a character is selected, they will be highlighted on the actual painting on the wall either by the addition or subtraction of lighting. Users will be able to navigate through various layers of details for each individual as they see fit, with the lighting following along.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The team is currently investigating several forms of lighting control, ranging from the standard Arduino to a Phidgets controller or perhaps a LANBox DMX controller. Ideally we will be able to create smooth fades between preset scenes without a huge investment.&lt;br /&gt;&lt;br /&gt;Being a group of MEs, we aren't the most familiar with interactive museum exhibits so it has been an interesting process so far. We have a couple prototype interfaces in VB and html/php that we have been working with. At this point, it looks like we are going to got he VB route as it seems a little easier to talk to serial devices.&lt;br /&gt;&lt;br /&gt;On the actual hardware control side, we picked up a few Arduinos to play with and try to start making some headway. Currently we have some little circuits rigged up to just trip relays so they stand as a fallback to actual commercial control solutions. As a next step, dimming was the logical option. My roommate &lt;a href="http://stupidhax.blogspot.com/"&gt;Gigawatts&lt;/a&gt; had an old Midi controlled dimmer pack that we had been playing with for lighting control in our apartment and the necessary cables and stuff to hook it to an Arduino. I spent most of the night figuring out how to get midi to make stuff happen. I first went through playing with a button to change the light that was on. Although that was fun a moderately useful, I was more concerned about the quality of fades that could be obtained with MIDI as I am not terribly familiar with it as a lighting control interface. The biggest concern was that since we will be driving LEDs with it was that it would look choppy. I ended up sending MIDI values from 0x00 to 0x90 with a 20ms pause between steps. I suppose the resolution should not really have been a concern as 20ms is about one full cycle at 60Hz.&lt;br /&gt;&lt;br /&gt;Anyway, This is what I ended up with for a circuit and such:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_vRkxiT1abas/TUzX3juCdFI/AAAAAAAAADs/PiR6ebnNHEw/s1600/Arduino+MIDI.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://4.bp.blogspot.com/_vRkxiT1abas/TUzX3juCdFI/AAAAAAAAADs/PiR6ebnNHEw/s640/Arduino+MIDI.JPG" width="480" /&gt;&lt;/a&gt;&lt;/div&gt;And this is the code that I have:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: #7e7e7e;"&gt;/*&amp;nbsp;Midi&amp;nbsp;light&amp;nbsp;control&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Basic&amp;nbsp;code&amp;nbsp;to&amp;nbsp;fade&amp;nbsp;a&amp;nbsp;light&amp;nbsp;channel&amp;nbsp;up&amp;nbsp;and&amp;nbsp;down&amp;nbsp;via&amp;nbsp;midi&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Initially&amp;nbsp;used&amp;nbsp;with&amp;nbsp;Leprecon&amp;nbsp;LD-360-MIDI&amp;nbsp;dimmer&amp;nbsp;pack&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Designed&amp;nbsp;for:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Bradley&amp;nbsp;University&amp;nbsp;Mechanical&amp;nbsp;Engineering&amp;nbsp;Senior&amp;nbsp;project&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;in&amp;nbsp;cooperation&amp;nbsp;the&amp;nbsp;Galena&amp;nbsp;Historical&amp;nbsp;Society&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;The&amp;nbsp;circuit:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*&amp;nbsp;digital&amp;nbsp;in&amp;nbsp;1&amp;nbsp;connected&amp;nbsp;to&amp;nbsp;MIDI&amp;nbsp;jack&amp;nbsp;pin&amp;nbsp;5&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*&amp;nbsp;MIDI&amp;nbsp;jack&amp;nbsp;pin&amp;nbsp;2&amp;nbsp;connected&amp;nbsp;to&amp;nbsp;ground&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*&amp;nbsp;MIDI&amp;nbsp;jack&amp;nbsp;pin&amp;nbsp;4&amp;nbsp;connected&amp;nbsp;to&amp;nbsp;+5V&amp;nbsp;through&amp;nbsp;220-ohm&amp;nbsp;resistor&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;By&amp;nbsp;Steve&amp;nbsp;Krave&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;Created&amp;nbsp;2&amp;nbsp;Feb&amp;nbsp;2010&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;find&amp;nbsp;more&amp;nbsp;at&amp;nbsp;http://MEhax.blogspot.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;This&amp;nbsp;code&amp;nbsp;is&amp;nbsp;based&amp;nbsp;on&amp;nbsp;the&amp;nbsp;midi&amp;nbsp;tutorial&amp;nbsp;found&amp;nbsp;on&amp;nbsp;the&amp;nbsp;main&amp;nbsp;Arduino&amp;nbsp;page&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;http://www.arduino.cc/en/Tutorial/MIDI&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; dim = 1;      &lt;span style="color: #7e7e7e;"&gt;// dim controls whether to fade up or down  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; intensity = 0;  &lt;span style="color: #7e7e7e;"&gt;// Controls the intensity, a value from 0 to 127&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;&lt;b&gt;setup&lt;/b&gt;&lt;/span&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//  Set MIDI baud rate:&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;begin&lt;/span&gt;(31250);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; &lt;span style="color: #cc6600;"&gt;&lt;b&gt;loop&lt;/b&gt;&lt;/span&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;intensity&amp;nbsp;=&amp;nbsp;intensity&amp;nbsp;+&amp;nbsp;dim;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//Set Intensity Value. Min 0x00, max 0x90&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//int value = 64 * (1 + sin(millis()/500));&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;noteOn(0x90,&amp;nbsp;0x06,&amp;nbsp;intensity);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//controlls fade rate (ms) per step&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;delay&lt;/span&gt;(20);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//sets to fade out when max intensity is reached&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;if&lt;/span&gt; (intensity &amp;gt;= 0x90) dim = -1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #7e7e7e;"&gt;//set to fade on when intensity hits 0&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;if&lt;/span&gt; (intensity &amp;lt;= 0x00) dim = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;//&amp;nbsp;&amp;nbsp;plays&amp;nbsp;a&amp;nbsp;MIDI&amp;nbsp;note.&amp;nbsp;&amp;nbsp;Doesn't&amp;nbsp;check&amp;nbsp;to&amp;nbsp;see&amp;nbsp;that&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7e7e7e;"&gt;//&amp;nbsp;&amp;nbsp;cmd&amp;nbsp;is&amp;nbsp;greater&amp;nbsp;than&amp;nbsp;127,&amp;nbsp;or&amp;nbsp;that&amp;nbsp;data&amp;nbsp;values&amp;nbsp;are&amp;nbsp;&amp;nbsp;less&amp;nbsp;than&amp;nbsp;127:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #cc6600;"&gt;void&lt;/span&gt; noteOn(&lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; cmd, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; pitch, &lt;span style="color: #cc6600;"&gt;int&lt;/span&gt; velocity) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(cmd, &lt;span style="color: #006699;"&gt;BYTE&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(pitch, &lt;span style="color: #006699;"&gt;BYTE&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cc6600;"&gt;&lt;b&gt;Serial&lt;/b&gt;&lt;/span&gt;.&lt;span style="color: #cc6600;"&gt;print&lt;/span&gt;(velocity, &lt;span style="color: #006699;"&gt;BYTE&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;For a final result of:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/YU6vCY14W1Q/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/YU6vCY14W1Q?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266" src="http://www.youtube.com/v/YU6vCY14W1Q?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;On the video there is a set of regular old incandescent Christmas lights plugged in as well as this is a fairly cheap string of LEDs and will not dim properly without them.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Overall, I am quite pleased with the MIDI solution, though it does eat up the main serial port of the Arduino. Later on if we continue to use this method, it will probably require a software serial port but that not a major issue. It will of course take triggers and run the desired fades instead of a loop or any of that nonsense, but that's fairly trivial overall.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-5739433654479000151?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/5739433654479000151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2011/02/prototype-for-arduino-control-of-midi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/5739433654479000151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/5739433654479000151'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2011/02/prototype-for-arduino-control-of-midi.html' title='Prototype for Arduino control of Midi Dimmer pack'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_vRkxiT1abas/TUzR6H93yBI/AAAAAAAAADo/itorwtZAlCc/s72-c/peace.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-4056527783025026635</id><published>2010-10-13T20:12:00.000-07:00</published><updated>2010-10-13T20:21:41.752-07:00</updated><title type='text'>Death Ray (automatic smoke ring cannon)</title><content type='html'>While working on senior project the other day, I decided I wanted to build a death ray. I'm not quite sure why exactly, but it seemed like a spectacular idea. I have built smoke ring launcher things in the past but they were always operated by hitting the back membrane or whatever. This time, I thought it would be cool to use a speaker cone as the back diaphragm instead of the bottom of a garbage can or something.&lt;br /&gt;&lt;br /&gt;Lucky for me, back in high school I managed to obtain a couple busted old 15" PA drivers and had built a very rough prototype subwoofer enclosure for it. I was feeling adventurous at the time so I built it with a passive radiator. I built it like crap so it sounded about the same so it was sitting in my basement all alone. The hole where the passive radiator went was quite useful as no holes needed to be cut in the enclosure. I took out the driver and flipped it around to expose the full surface area of the cone to the working side. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_vRkxiT1abas/TLZvp0N8ZJI/AAAAAAAAACQ/YvWNx3RgPxg/s1600/smoke+rings+005.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/_vRkxiT1abas/TLZvp0N8ZJI/AAAAAAAAACQ/YvWNx3RgPxg/s400/smoke+rings+005.JPG" width="400" /&gt; &lt;/a&gt;&lt;/div&gt;With the driver mounted, all that was left was to cut a hole in a piece of cardboard on the front and to get some power to the driver. I started off with a hole the size of a masking tape roll cut centered in a square of cardboard. I generated some waveforms in audacity to feed the driver through an old amp I had laying around. I found that using the top half of a sine wave at a high amplitude worked best. Also, having a reasonable amount of space between pulses helped clean up the smoke rings. I finally settled on using a 40hz wave with spacing between 0.2 and 1 second.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_vRkxiT1abas/TLZyxSkBNpI/AAAAAAAAACY/r8r0NdL2hKQ/s1600/sine.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="112" src="http://1.bp.blogspot.com/_vRkxiT1abas/TLZyxSkBNpI/AAAAAAAAACY/r8r0NdL2hKQ/s400/sine.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;After playing around with that a bit, I cut a final orifice in a piece of 1/2" ply the size of a Minwax can. In all it worked fairly well and shit smoke rings about 12'. It probably would shoot them farther, but it was somewhat windy out and there was a fence in the way. I thing it would be awesome to use propane instead of smoke and shoot flaming rings of fire, but it may not be the smartest thing to do.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-435a3ef6b27769c9" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v21.nonxt8.googlevideo.com/videoplayback?id%3D435a3ef6b27769c9%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1333390369%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DA4A64451971B5A04EA0B5CD8115BBE1E76574A9.27E361D592A6BE9F2E0930DE1AABC615F73BFB40%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D435a3ef6b27769c9%26offsetms%3D5000%26itag%3Dw160%26sigh%3DXm9xfbx-ntcnQlDlaeYTQjYduNI&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v21.nonxt8.googlevideo.com/videoplayback?id%3D435a3ef6b27769c9%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1333390369%26sparams%3Did,itag,ip,ipbits,expire%26signature%3DA4A64451971B5A04EA0B5CD8115BBE1E76574A9.27E361D592A6BE9F2E0930DE1AABC615F73BFB40%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D435a3ef6b27769c9%26offsetms%3D5000%26itag%3Dw160%26sigh%3DXm9xfbx-ntcnQlDlaeYTQjYduNI&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;Here is a quick video of it in action, it sounds funny, but my little camera just couldn't pick it up properly. &lt;br /&gt;&lt;br /&gt;While I had the sub and tone generator out, I decided to test for the brown note. Overall, it didn't do much, but I really felt funny afterward&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-4056527783025026635?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/4056527783025026635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2010/10/death-ray-automaric-smoke-ring-cannon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/4056527783025026635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/4056527783025026635'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2010/10/death-ray-automaric-smoke-ring-cannon.html' title='Death Ray (automatic smoke ring cannon)'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_vRkxiT1abas/TLZvp0N8ZJI/AAAAAAAAACQ/YvWNx3RgPxg/s72-c/smoke+rings+005.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-4700166514928458367</id><published>2010-10-04T16:02:00.000-07:00</published><updated>2010-10-04T16:05:11.389-07:00</updated><title type='text'>Worlds Easiest Hack</title><content type='html'>Last winter, I had a refrigerator die on me, so naturally I tore everything out of it that still worked. This included some relays, a light socket, a heating element, and of course the little switch that turns the light on when the door is open.&lt;br /&gt;&lt;br /&gt;About 5 minutes later, it was wired up to the socket that was just obtained with a short chunk of speaker wire. Cool. My roommate &lt;a href="http://stupidhax.blogspot.com/"&gt;Gigawatts&lt;/a&gt; and I had some networking stuff in one of our closets with no light so we threw this little device in there with a little bit (really a lot) of hot glue. Here's a quick pic and a short, but awesome video starring Gigawatts' left hand.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_vRkxiT1abas/TKpcVK2J3eI/AAAAAAAAABo/cxV44B7VVIs/s1600/Closet+001.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/_vRkxiT1abas/TKpcVK2J3eI/AAAAAAAAABo/cxV44B7VVIs/s320/Closet+001.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-70fe5e2b176537d2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v12.nonxt7.googlevideo.com/videoplayback?id%3D70fe5e2b176537d2%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1333390369%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6100719955F0F2A283399AB8CCE70D0F680ED9D8.3544414DD8DC54954E6CD1DBA3D255B7403764A2%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D70fe5e2b176537d2%26offsetms%3D5000%26itag%3Dw160%26sigh%3D1yAGLDODzdSK3q8xAjCNOxa0xow&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v12.nonxt7.googlevideo.com/videoplayback?id%3D70fe5e2b176537d2%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1333390369%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6100719955F0F2A283399AB8CCE70D0F680ED9D8.3544414DD8DC54954E6CD1DBA3D255B7403764A2%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D70fe5e2b176537d2%26offsetms%3D5000%26itag%3Dw160%26sigh%3D1yAGLDODzdSK3q8xAjCNOxa0xow&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-4700166514928458367?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/4700166514928458367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2010/10/worlds-easiest-hack.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/4700166514928458367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/4700166514928458367'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2010/10/worlds-easiest-hack.html' title='Worlds Easiest Hack'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_vRkxiT1abas/TKpcVK2J3eI/AAAAAAAAABo/cxV44B7VVIs/s72-c/Closet+001.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5353486203196595217.post-4567571270655501067</id><published>2010-10-04T15:40:00.000-07:00</published><updated>2011-02-05T17:13:06.520-08:00</updated><title type='text'>Phone Activated Door Hax</title><content type='html'>This was a quick hack to buzz myself or guests in without using my  swipe card or pressing the buzz button on the panel. The Idea was to use  the ringing signal on a phone line to trip a relay, therefore opening  my door. Ringing phones were not an issue as there are no land line  phones connected in the apartment.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;After  taking some measurements and talking about the project with the phone  tech at my school, I figured out what I was going to do. After some  research, I determined that phones typically ring in the 90 to 120 VAC  range. I measured mine to be around 200, sometimes over 300, Still not a  big deal. The other thing though is that there is always 10VDC sitting  on the line for when the phone isn't ringing but you're talking etc... To  deal with that, I used a pair of non polar capacitors in parallel, as a  single .5µf capacitor wasn't passing enough current to trip the relay.&lt;br /&gt;&lt;br /&gt;From here, I connected a bridge rectifier chip, which in turn was  connected to my 12V relay. I soldered a 47µf 35V cap across the  terminals to smooth out the DC. It may not have been necessary, but I  had it laying around and I figured at 25Hz I might as well.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Diagram of the circuit I used&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_vRkxiT1abas/TKpWa7BeAJI/AAAAAAAAABQ/73xXSMmPJq0/s1600/Door_Hax_circuit.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_vRkxiT1abas/TKpWa7BeAJI/AAAAAAAAABQ/73xXSMmPJq0/s1600/Door_Hax_circuit.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Hodge Podge of parts and hot glue. I love that stuff, plus, I don't have  any perf board.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWbO8bSwI/AAAAAAAAABU/ieLunGDlQs4/s1600/Door_Hax1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWbO8bSwI/AAAAAAAAABU/ieLunGDlQs4/s400/Door_Hax1.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;My pretty (yeah right) wiring job &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_vRkxiT1abas/TKpWbhqS4HI/AAAAAAAAABY/h7Zt4Y4DD1w/s1600/Door_Hax2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/_vRkxiT1abas/TKpWbhqS4HI/AAAAAAAAABY/h7Zt4Y4DD1w/s400/Door_Hax2.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;The intercom/door thingy, easy enough to deal with.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWbyiNWpI/AAAAAAAAABc/L0_vdExNuyE/s1600/Door_Hax3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWbyiNWpI/AAAAAAAAABc/L0_vdExNuyE/s400/Door_Hax3.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;Final packaging of the opener. It's crammed in the top of a ranch salad  dressing neck with lots of hot glue. I used a chunk of Cat5 to connect  to the phone line. My apartment has RJ45 connections so it works fine.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWcQdOPJI/AAAAAAAAABg/R_Btxxyd0EM/s1600/Door_Hax5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWcQdOPJI/AAAAAAAAABg/R_Btxxyd0EM/s400/Door_Hax5.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;I packaged  it all up and stuck it in the wall and its working great. Everything tucked away and connected. I cut a small hole for the cable  in the bottom of the plastic so it looks better/involves fewer broken  intercoms.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWchurUfI/AAAAAAAAABk/5prEpO29KoI/s1600/Door_Hax8.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_vRkxiT1abas/TKpWchurUfI/AAAAAAAAABk/5prEpO29KoI/s400/Door_Hax8.JPG" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5353486203196595217-4567571270655501067?l=mehax.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mehax.blogspot.com/feeds/4567571270655501067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mehax.blogspot.com/2010/10/phone-activated-door-hax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/4567571270655501067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5353486203196595217/posts/default/4567571270655501067'/><link rel='alternate' type='text/html' href='http://mehax.blogspot.com/2010/10/phone-activated-door-hax.html' title='Phone Activated Door Hax'/><author><name>Mista Sparkle</name><uri>http://www.blogger.com/profile/09441683205745251932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='27' src='http://4.bp.blogspot.com/-CNKSygbs0SE/TWVPEJIM_ZI/AAAAAAAAAE0/uIOerpAfdX0/s220/%253D%255D.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_vRkxiT1abas/TKpWa7BeAJI/AAAAAAAAABQ/73xXSMmPJq0/s72-c/Door_Hax_circuit.JPG' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
