<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eric Sorensen &#187; Electronics</title>
	<atom:link href="http://www.esorensen.com/category/electronics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.esorensen.com</link>
	<description>exploring photography, electronics, music, and programming.</description>
	<lastBuildDate>Mon, 26 Oct 2009 22:39:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>High Speed Photography</title>
		<link>http://www.esorensen.com/2008/12/22/high-speed-photography/</link>
		<comments>http://www.esorensen.com/2008/12/22/high-speed-photography/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 07:39:01 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Microprocessors]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://www.esorensen.com/?p=306</guid>
		<description><![CDATA[My two primary interests are photography and electronics. This project allowed me to combine two of my loves and capture some stellar images. I used a PIC microcontroller to sync my shutter and some off-camera strobes with the collision of a water/milk droplet and a bowl of liquid. This technique captures durations in the order [...]]]></description>
			<content:encoded><![CDATA[<p>My two primary interests are photography and electronics. This project allowed me to combine two of my loves and capture some stellar images. I used a PIC microcontroller to sync my shutter and some off-camera strobes with the collision of a water/milk droplet and a bowl of liquid. This technique captures durations in the order of microseconds.</p>
<p><a href="http://www.esorensen.com/2008/12/22/high-speed-photography/" title="Permanent Link to High Speed Photography">Here a SimpleViewer Flash gallery should be displayed. Click here to open the post in your browser to see the gallery.</a></p>
<p><span id="more-306"></span>When I first became interested in high speed photography I discovered the site <a href="http://www.hiviz.com/">Hiviz.com</a>. This extremely useful site is where I learned about using flash strobes to capture fast-moving objects. Using the circuit diagrams provided <a href="http://www.hiviz.com/tools/triggers/makeown.htm#delay">here</a> I built a 555 timer-based delay and trigger circuit for my camera flashes.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_1440.jpg"></a><a href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030318_1.jpg"><img class="alignnone size-medium wp-image-361" title="p1030318_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030318_1-500x375.jpg" alt="p1030318_1" width="500" height="375" /></a></p>
<p>The idea in a delayed trigger is to sense the droplet outside of the view of the camera then take the picture when the droplet falls inside of the frame. When I take these pictures I hold a dropper about a foot and a half above a bowl. I place an infrared emitter/receiver below my hand to sense the droplet when it first leaves the dropper. Then, after a specified amount of time (depending on the sensor&#8217;s height above the bowl) the flashes fire. By calibrating this time correctly I make the flashes fire directly after the drop hits the water.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/consistant.jpg"><img class="alignnone size-medium wp-image-367" title="consistant" src="http://www.esorensen.com/wp-content/uploads/2008/12/consistant-500x500.jpg" alt="consistant" width="500" height="500" /></a></p>
<p>Using the same delay yields almost identical images. These are six consecutive pictures taken using my controller.</p>
<p>The shutter is usually left open for this entire process. These pictures are taken in a darkened room so that the ambient light had little or no effect on the exposure. When the flashes fire they are much brighter than the ambient light and they freeze that moment onto the film/sensor. This makes the flash duration the effective &#8220;shutter speed&#8221; for the picture.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/_mg_6658-1.jpg"><img class="alignnone size-medium wp-image-348" title="_mg_6658-1" src="http://www.esorensen.com/wp-content/uploads/2008/12/_mg_6658-1-500x333.jpg" alt="_mg_6658-1" width="500" height="333" /></a></p>
<p>The 555-based circuit from hiviz.com worked well and I got some great pictures. I am very grateful for all the detailed information about high speed photography they provide. But after I used their circuit a few times I started to get frustrated. Using a potentiometer to control the timing was imprecise and cumbersome. It was easy to bump a knob and lose my work &#8220;calibrating&#8221; the system. I also found myself swapping out components when I needed to drastically alter the delay time.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_1471.jpg"><img class="alignnone size-medium wp-image-352" title="img_1471" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_1471-500x333.jpg" alt="img_1471" width="500" height="333" /></a></p>
<p>As a solution to these problems I designed my own &#8220;High Speed Controller&#8221; using a microcontroller. This controller is programmed on a 18F series PIC microcontroller. You can adjust the input characteristics, flash timings (down to the millisecond), and shutter duration using a rotary encoder and an LCD screen. It supports up to four flashes and two cameras &#8212; although more can easily be added. Each flash can be individually timed. And since you can adjust the characteristics of the sensor you can use a variety of trigger devices (I have tested it using both a photogate and a computer microphone)</p>
<p>The following menu items are used to adjust the behavior of the controller. You use the rotary encoder to scroll through the menu items, then use the button to select a particular item.</p>
<p><strong>Sensor Threshold &#8211; </strong>Each sensor plugs into an analog/digital converter on the PIC. The sensor threshold is the value at which the sensor is triggered. For convenience, the current value of the sensor is displayed as you adjust the threshold. The above picture was taken as I was adjusting the sensor threshold.</p>
<p><strong>Sensor High/Low &#8211; </strong>This tells the controller if it should trigger when the sensor is higher or lower than the threshold value.</p>
<p><strong>Shutter Delay &#8211; </strong>If enabled, this delay waits a specified amount of time after the trigger event before opening the shutter.</p>
<p><strong>Shutter Duration -</strong> This is pretty self-explanatory. The nice thing about having the controller open/close the shutter is that you can take pictures in a moderately light room. With shutter durations in the 100-200ms range the ambient light of the room becomes less impactful on the final image.</p>
<p><strong>Flash Delay 1, 2, 3, 4 &#8211; </strong>Each flash can be individually timed. I usually have them go off simultaneously but I like having the option of having them go off in sequence.</p>
<p><strong>Execute &#8211; </strong>This causes the PIC to enter a delay loop waiting for the sensor conditions to be met.</p>
<p><strong>Shutter Control</strong> -  This menu items was necessary due to some limitations in my camera. The Canon 20D I use to take these pictures has a delay of ~70ms from the moment it recieves a signal to the moment the shutter opens. This often isn&#8217;t an issue since the delay for water droplets is often greater than 200ms. However, in case I need to capture less than 70ms from the time the sensor is triggered I needed an alternate way to control the shutter. This menu option has two options:</p>
<p><em>Normal: The shutter opens after the sensor is trigger. </em></p>
<p><em>Fast Object: The shutter opens as soon as you hit &#8220;execute&#8221;. It still turns off based on the &#8220;shutter duration&#8221; value after the sensor is triggered. </em></p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/board.gif"><img class="alignnone size-full wp-image-356" title="board" src="http://www.esorensen.com/wp-content/uploads/2008/12/board.gif" alt="board" width="508" height="302" /></a></p>
<p>If you are interested in building a controller for yourself I have created a board and released the source code.</p>
<p>Unfortunately, neither are well documented for now &#8212; so you may have to work a little to understand how to use them. After I catchup with my website I will update these files with well documented code. For now, please feel free to email me if you have any specific questions.</p>
<p>The source is available <a href="http://www.esorensen.com/downloads/highspeed_source.zip">here</a>. I compiled it using the C18 compiler provided by microchip. I controlled LCD using a library I found on <a href="http://www.piclist.com/techref/microchip/language/c/io/lcd/hitachilcd-ak/index.htm">piclist</a>. It was written for the Hitech compiler and had quite a few errors in C18 so I had to rewrite some sections of it.</p>
<p>The board/circuit diagram can be downloaded <a href="http://www.esorensen.com/downloads/highspeed_hardware.zip">here</a>. I included inputs/outputs for a few more buttons and a few LEDs in case you want to implement some extra controls. Use <a href="http://www.cadsoft.de/">eagle</a> to open the files. If you want to etch the board you can do so using my <a href="http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/">etching howto</a>.</p>
<p>You&#8217;ll need the following parts:</p>
<p>(1) PIC18F4685 (available as a free sample for students)</p>
<p>(4) EC103D SCRs</p>
<p>(4) 2N2222 transistors (or any small npn transistors)</p>
<p>(1) 4mhz crystal (optional&#8211; the current source actually uses the internal oscillator)</p>
<p>(1) LM7805 (optional &#8212; depending on your power source)</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_40711.jpg"><img class="alignnone size-medium wp-image-323" title="img_40711" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_40711-500x214.jpg" alt="img_40711" width="500" height="214" /></a></p>
<p>The technical details are important to capture water droplets, but your captures won&#8217;t look like art unless you spend some time controlling the light. You can experiment with using gels over the flash, hard vs soft light, and different backgrounds or floor coverings to achieve different effects.</p>
<p>Although my setup may seem complicated, most of these components can be found for pretty cheap.</p>
<p><strong>Cameras</strong> &#8211; I used a Canon 20D and my friend used his Canon 40D to take the pictures. Any camera that you can externally trigger with a &#8220;bulb&#8221; setting should work for droplet photography.</p>
<p><strong>Flashes</strong> &#8211; Old, manual, strobes are perfect for this kind of photography. I use two Nikon strobes from the 90&#8217;s that I found locally for cheap.</p>
<p><strong>Umbrellas &#8211; </strong>You can get these for $10-15 a piece. But if you don&#8217;t want to buy umbrellas and stands you can use sheets of white paper to soften the light.</p>
<p><strong>Dropper &#8211; </strong>I used a dropper meant to dispense chemicals in a fish bowl. Straws work.. but only as a last resort.</p>
<p><strong>Paper/Backgrounds &#8211; </strong>I bought paper at Craft Warehouse.</p>
<p>Here are some pictures of the setup I used for most of the images on this page:</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030326_1.jpg"><img class="alignnone size-medium wp-image-362" title="p1030326_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030326_1-375x500.jpg" alt="p1030326_1" width="375" height="500" /></a></p>
<p><!--more--><a href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030319_1.jpg"><img class="alignnone size-medium wp-image-363" title="p1030319_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030319_1-500x375.jpg" alt="p1030319_1" width="500" height="375" /></a></p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_1430.jpg"><img class="alignnone size-medium wp-image-364" title="img_1430" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_1430-500x333.jpg" alt="img_1430" width="500" height="333" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esorensen.com/2008/12/22/high-speed-photography/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic Christmas Train</title>
		<link>http://www.esorensen.com/2008/12/14/automatic-christmas-train/</link>
		<comments>http://www.esorensen.com/2008/12/14/automatic-christmas-train/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 03:11:35 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Microprocessors]]></category>

		<guid isPermaLink="false">http://www.esorensen.com/?p=128</guid>
		<description><![CDATA[Now that finals are over, I finally have some time to work on the projects I&#8217;ve been putting aside over the last few months. The first thing I checked off my list is something I&#8217;ve been promising my mother for a couple of weeks.

We decided to put our Christmas tree outside on the front porch [...]]]></description>
			<content:encoded><![CDATA[<p>Now that finals are over, I finally have some time to work on the projects I&#8217;ve been putting aside over the last few months. The first thing I checked off my list is something I&#8217;ve been promising my mother for a couple of weeks.</p>
<p><a rel="attachment wp-att-176" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030370/"><img class="alignnone size-medium wp-image-176" title="Christmas Train" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030370-500x437.jpg" alt="Christmas Train" width="500" height="437" /></a></p>
<p>We decided to put our Christmas tree outside on the front porch this year. My mom had the idea of setting up the train under the tree and having it automatically move around the track whenever someone came up to the front door. She setup the tree and the train, my task was to make it move.</p>
<p><span id="more-128"></span></p>
<p>Normally I&#8217;d use a relay for this kind of project. Unfortunately this train is battery power and since its been in our family for over twenty years I didn&#8217;t want to modify it. Instead, I decided to use the built-in infrared communication to control the train. I opted to record the output from the infrared remote and emulate it using a microprocessor whenever someone comes to the door.</p>
<p>The first thing I did was record the infrared waveforms. To do this I soldered an infrared photo transistor to a 1/8&#8243; phono plug (headphone jack) and plugged the sensor into my laptop&#8217;s microphone input. For each of the functions on the remote (Forward, Back, Whistle, Stop) I held the remote up to the the sensor and &#8220;recorded&#8221; the waveform of the infrared command. I essentially used the sound card on my laptop as a storage oscilloscope.</p>
<p><a title="Sensor" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030381.jpg"></a><a href="http://www.esorensen.com/?attachment_id=187"><img class="alignnone size-medium wp-image-187" title="p1030381" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030381-500x333.jpg" alt="p1030381" width="500" height="333" /></a></p>
<p>Here are some images of the waveforms:</p>
<p><a title="Stop" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/stop2.gif"></a><a rel="attachment wp-att-227" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/whistle-2/"><img class="alignnone size-medium wp-image-227" title="whistle" src="http://www.esorensen.com/wp-content/uploads/2008/12/whistle-500x46.gif" alt="whistle" width="500" height="46" /></a></p>
<p><a rel="attachment wp-att-231" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/stop2/"><img class="alignnone size-medium wp-image-231" title="stop2" src="http://www.esorensen.com/wp-content/uploads/2008/12/stop2-500x46.gif" alt="stop2" width="500" height="46" /></a></p>
<p><a rel="attachment wp-att-228" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/back2/"><img class="alignnone size-medium wp-image-228" title="back2" src="http://www.esorensen.com/wp-content/uploads/2008/12/back2-500x58.gif" alt="back2" width="500" height="58" /></a></p>
<p><a rel="attachment wp-att-229" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/forward-2/"><img class="alignnone size-medium wp-image-229" title="forward" src="http://www.esorensen.com/wp-content/uploads/2008/12/forward-500x55.gif" alt="forward" width="500" height="55" /></a></p>
<p>Using Audacity, my audio editing software, I amplified each of the waveforms until they clipped. Then I lowered the threshold enough that I had good square waves to deal with. This make it easier to accurately measure the width of each signal component. The final signal I used to measure the pulse widths looked something like this:</p>
<p><a title="Pulse-Length" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/pulse-lengths.gif"></a><a rel="attachment wp-att-230" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/pulse-lengths/"><img class="alignnone size-medium wp-image-230" title="pulse-lengths" src="http://www.esorensen.com/wp-content/uploads/2008/12/pulse-lengths-500x59.gif" alt="pulse-lengths" width="500" height="59" /></a></p>
<p>Luckily, the encoding for these signals is easy to understand/duplicate. I found there were three durations I needed to record. Each high pulse was 1.5ms wide. In between each pulse is a delay. The longer delays are 4.5ms and the shorter delays are 1.75ms.</p>
<p>In order to stay organized, I decided to define some of the &#8220;building blocks&#8221; of the waveform. It seemed to me that the information being carried was stored in the delay between pulses, so I called the longer delays 0 and the shorter delays 1. If this seems a little convoluted, the following image summarizes the information structure by showing an example of 1-0-1:</p>
<p><a title="Structure" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/structure.gif"></a><a href="http://www.esorensen.com/?attachment_id=180"><img class="alignnone size-medium wp-image-180" title="structure" src="http://www.esorensen.com/wp-content/uploads/2008/12/structure-500x217.jpg" alt="structure" width="500" height="217" /></a></p>
<p>Using this scheme, each of the commands is easily translated into a binary representation:</p>
<p>Forward: 001111101010<br />
Back: 001111001011<br />
Whistle: 001111111001<br />
Stop: 001101001100</p>
<p>Incidentally, these correspond to 1002, 971, 1017 and 844 in decimal &#8212; there does not seem to be any significance to these values.</p>
<p>The next step was to write the software to mimic this behavior. I chose to use a PIC18F4685. While this pic is WAY overkill for this project, I used it because I already had the breadboard ready to go from a previous project. I can use the same code with any smaller 18f series PIC or if I ever want to make this a permanent fixture I can write the code in assembly and program a very small 12F series PIC to handle this basic task.</p>
<p>I wrote the code in C because I did not want to spend very much time on this project and I knew with delays in the order of milliseconds the timing wasn&#8217;t critical. Using C, the code took me about five minutes. First I wrote two functions to handle delays. The first, called &#8220;pulse&#8221; sets the enable pin, waits 1.5ms and brings it low again. The second called &#8220;gap&#8221; accepts a variable called &#8220;value&#8221; and delays accordingly. So the waveform in my example above (1-0-1) could be represented with the code:</p>
<p>pulse();<br />
gap(1);<br />
pulse();<br />
gap(0);<br />
pulse();<br />
gap(1);<br />
pulse();</p>
<p>It isn&#8217;t the most elegant approach but its functional and quick &#8212; perfect for this project. I also attached a button to the pic to trigger the infrared LED sequence. Debouncing the button wasn&#8217;t necessary because the series of delay loops after the button was pressed lasted for many seconds.</p>
<p>Having finished the code, I attached the signal pin from the PIC to the base of a PN2222 transistor to act as a buffer. Then I attached two infrared LED&#8217;s to the transistor in series with a 100ohm resistor to supply them with about 50mA of current. Early on I noticed the train wasn&#8217;t very sensitive even to it&#8217;s built-in remote, so I knew I&#8217;d need at least two emitters with a decent amount of current.</p>
<p>I held the LED&#8217;s up to the train and pushed the button&#8211; the train wheels began to spin, the whistle started, and ten seconds later the wheels stopped. Success! Now all I needed was a way to trigger the train when someone walked up to my front door.</p>
<p>I considered a few ways to trigger the the train. Initially I wanted to use a motion sensor to trigger the train whenever someone approached our front porch. Unfortunately, time and budget constraints prevented that option. If I improve this project in the future I think I will try to incorporate a motion sensor into my design.</p>
<p>The solution I decided to use instead was very.. home made &#8212; but it ended up working surprisingly well. I decided to create a sensor that detected when someone stepped on my front doormat. I used two pieces of aluminum foil, some tapes, and a few drinking straws.</p>
<p>First I lay down a long strip of aluminum foil with some straws placed evenly across the surface:</p>
<p><a title="Straws" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030355.jpg"></a><a rel="attachment wp-att-179" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030355/"><img class="alignnone size-medium wp-image-179" title="p1030355" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030355-500x375.jpg" alt="p1030355" width="500" height="375" /></a></p>
<p>These straws will be used as &#8220;springs&#8221; to prevent a short circuit between two pieces of foil.</p>
<p><a title="Top" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030356.jpg"></a><a rel="attachment wp-att-177" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030356/"><img class="alignnone size-medium wp-image-177" title="p1030356" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030356-500x375.jpg" alt="p1030356" width="500" height="375" /></a></p>
<p>After laying the top piece of foil over the straws I fastened it down with some electrical tape and trimmed off as much unnecessary foil as possible. This was necessary to prevent any unintended shorts.</p>
<p>Next, I taped wire to each piece of foil and attached the foot sensor to my breadboard.</p>
<p><a title="Doormat" rel="lightbox[pics128]" href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030374.jpg"></a><a href="http://www.esorensen.com/?attachment_id=185"><img class="alignnone size-medium wp-image-185" title="p1030375" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030375-500x375.jpg" alt="p1030375" width="500" height="375" /></a></p>
<p>Finally, I placed the sensor under my front doormat. Now whenever someone steps on the sensor the two pieces of foil make contact and the PIC starts the train. When the person releases their foot the combined strength of the straws keeps the foil apart again.</p>
<p>The circuit has been in place two days at the time of this writing and so far it is working very well. The only thing keeping it from working perfectly is the train itself &#8212; occasionally it steers itself off the track. I&#8217;m going to add some more track segments to make the turns a little wider which should remedy that problem.</p>
<p>This project was a lot of fun for me. It gave me a chance to reverse engineer a product and provided me with insight about infrared communication. I am intrigued by the encoding method and would like to learn more. For instance, why did the product designers use the values they did for the infrared commands? Does this encoding have a name?</p>
<p>If anyone reading this has some insight I&#8217;d love to hear it.</p>
<p>Anyway, thanks for reading, I&#8217;ll leave you with some more pictures and a video.</p>
<p><a rel="attachment wp-att-184" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030373/"><img class="alignnone size-medium wp-image-184" title="p1030373" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030373-500x375.jpg" alt="p1030373" width="500" height="375" /></a><br />
The tree lit up at night.</p>
<p><a rel="attachment wp-att-186" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030380/"><img class="alignnone size-medium wp-image-186" title="p1030380" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030380-500x375.jpg" alt="p1030380" width="500" height="375" /></a><br />
The breadboard.</p>
<p><a rel="attachment wp-att-183" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030367/"><img class="alignnone size-medium wp-image-183" title="p1030367" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030367-500x375.jpg" alt="p1030367" width="500" height="375" /></a><br />
&#8220;Hiding&#8221; near my front door.</p>
<p><a rel="attachment wp-att-182" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030365/"><img class="alignnone size-medium wp-image-182" title="p1030365" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030365-500x375.jpg" alt="p1030365" width="500" height="375" /></a><br />
This is the original remote.</p>
<p><a rel="attachment wp-att-181" href="http://www.esorensen.com/2008/12/14/automatic-christmas-train/p1030357/"><img class="alignnone size-medium wp-image-181" title="p1030357" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030357-500x375.jpg" alt="p1030357" width="500" height="375" /></a><br />
The train comes to a halt with the emitter pointed at the infrared receiver.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/hnFyI0a-55s&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/hnFyI0a-55s&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>I&#8217;m sorry the video came out SO dark &#8211; it gets a little better after the first fifteen seconds. I will try to post another video when I get a chance.<em></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esorensen.com/2008/12/14/automatic-christmas-train/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Generating High Voltage</title>
		<link>http://www.esorensen.com/2008/12/13/generating-high-voltage/</link>
		<comments>http://www.esorensen.com/2008/12/13/generating-high-voltage/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 23:31:10 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[High Voltage]]></category>

		<guid isPermaLink="false">http://www.esorensen.com/?p=270</guid>
		<description><![CDATA[
Note: This project deals with high voltage and is inherently dangerous. I’ve built everything I describe on this page &#8211; and it works well for me &#8211; but I take no responsibility for your actions. If you decide you are interested in high voltage experiments PLEASE be careful and do so at your own risk.
This [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_89391.jpg"><img class="alignnone size-medium wp-image-371" title="img_89391" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_89391-310x500.jpg" alt="img_89391" width="310" height="500" /></a></p>
<p>Note: This project deals with high voltage and is inherently dangerous. I’ve built everything I describe on this page &#8211; and it works well for me &#8211; but I take no responsibility for your actions. If you decide you are interested in high voltage experiments PLEASE be careful and do so at your own risk.</p>
<p>This is part one of a two part article. On this page I am going to show you how to build a simple flyback transformer driver to generate very high voltages. I had to experiment a lot when I first tried this, so I hope to provide enough detail that anyone reading this can successfully generate a high voltage arc on their first try.</p>
<p><span id="more-270"></span></p>
<p>In the second part of the article I will show you how to modulate the signal being sent to the control circuitry. Connecting an audio signal to the control input allows you to reproduce those audio frequencies at the high voltage output of the transformer. Using this method, you can use your high voltage arc as a “plasma speaker” or a “singing arc” – with sound originating from the arc of electricity.</p>
<p><strong>Part 1: Choosing a Flyback</strong></p>
<p>The flyback transformer is the most important part of this circuit. Unfortunately, it is also the most complex – and usually undocumented – component. If you know what to look for, a flyback transformer is easy to find and incorporate into your design.</p>
<p>Flyback transformers are used to generate the high voltage necessary to operate older televisions and CRT monitors. They transform a low-medium voltage AC input and into an output of many thousands of volts. Most flyback transformers are designed to operate best at a specific frequency. For instance, the flyback transformers used to display NTSC television signals were designed to operate at ~15,750hz. An interesting effect of this operating frequency is the high pitched “whine” associated with older television sets.</p>
<p><strong><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_6199_1.jpg"><img class="alignnone size-medium wp-image-276" title="img_6199_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_6199_1-500x333.jpg" alt="img_6199_1" width="500" height="333" /></a></strong></p>
<p>There are two types of flyback transformers: AC and DC. I recommend using a DC (modern) flyback transformer because they often have a voltage multiplier built in. This means you will probably get a larger arc out of a DC flyback than you would if you used the equivalent circuitry to drive an AC flyback.</p>
<p>Luckily, DC flyback transformers seem to be more available anyway. I bought mine on Ebay for cheap, but if you are in a hurry and want to find one locally you should be able to remove one from a CRT monitor or television. You’ll know you have a DC, rather than an AC transformer based on the appearance. DC flybacks are usually black with one or two adjustment knobs on the side. They have a long, highly insulated, wire (usually red) coming from the top that attaches to the tube of the screen. They usually also have numerous pins along the bottom surrounded by epoxy.</p>
<p><strong>Part 2 – Winding the Primary</strong></p>
<p>You have two options to supply the input voltage – you can use the primary winding already in place or wind your own. Winding your own primary is usually a better option because you have complete control over the number of turns. It may also be easier to wind your own primary than to determine the pinout for the built-in primary.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_6198.jpg"></a><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_6199_1.jpg"><img class="alignnone size-medium wp-image-276" title="img_6199_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_6199_1-500x333.jpg" alt="img_6199_1" width="500" height="333" /></a></p>
<p>Winding your own primary is easy. Find the location of the current primary -  it is the smaller core segment attached to the main body of the flyback transformer. At this point your transformer will likely have the primary wound around this segment already. Note the direction the current primary is wrapped around the core and remove it. Now find some thick single-stranded copper wire to wrap the new primary. Carefully wrap a few loops around the core in the same direction as the original primary. These should be fairly tightly spaced but the turns should not cross each other. When you are finished, wrap the turns tightly with electrical tape.</p>
<p><em>Note: In the above picture I have stranded speaker wire attached to the primary of the flyback. This is not the wire I used to wrap the primary. </em></p>
<p>You will need to experiment to determine an optimal amount of primary turns. The output voltage increases according to the ratio between the primary and secondary windings &#8212; therefore the fewer windings you have on the primary winding the higher output voltage you should expect. At some point this correlation breaks down. I recommend starting with 10-12 turns on your primary and experimenting with different values after you get everything else working. I currently have 8 turns on my primary.</p>
<p><strong>Part 3 &#8211; Gather up the Parts</strong></p>
<p>What you will need:</p>
<p><em>Breadboard &#8211; </em>I recommend building this circuit using a bread board first. The frequencies involved in this design are not so high as to run into any problems with capacitance between the traces of the breadboard. In part two of this article I&#8217;ll share a circuit board design for the plasma speaker which uses many of the parts from this design &#8212; so you&#8217;ll probably want to be able to re-use these parts.</p>
<p><em>Power Mosfet &#8211; SSH222N50A &#8211; </em>This is the workhorse of the circuit. Mosfets are essentially voltage-controlled switches &#8212; and this one is a BIG one designed for a lot of power. I chose this one in particular because it is rated for peaks of 500v across its output pins and it can handle up to 22amps. Also, it is a very efficient mosfet with an on-state resistance of 0.25ohms. This will be connected directly to the primary coil of the flyback transformer. Mosfets are very fragile components &#8212; I recommend buying more than one in case one fails you during development.</p>
<p><em>Mosfet Driver &#8211; TC4424 -</em> I chose to use a mosfet driver IC rather than transistors to drive this mosfet. This simplifies the design and provides a small degree of isolation between the high voltage components and the rest of the circuit. The TC4424 driver is designed to rapidly alter the state of a mosfet and has a wide supply voltage range (4.5-18v). In the future I might try building the driver with push-pull transistors, but I&#8217;ll be surprised if they increase the performance over the TC4424. These are also a little fragile without proper treatment. I recommend getting a few of these if you can.  Microchip offers free samples to students.</p>
<p><em>Oscillator &#8211; LM555 &#8211; </em>This circuit needs oscillation to get any kind of effect from the flyback transformer. You can choose any component you&#8217;d like to provide this oscillation. A 555 timer simple and works well with the other components &#8212; the TC4424 is enabled by any signal from 2.4v  to the positive rail. So you can drive the TC4424 with a &#8220;logic level high&#8221; of 10v or more from the timer. You can run the LM555 at the same voltage as your TC4424 and using a potentiometer you can adjust its output frequency.</p>
<p><em>Power Supply #1 -    10-14v, low power  &#8211; </em>This power supply will be used to drive the 555 timer, TC4424,  and turn the mosfet on and off. It should be at least 10v to ensure the power mosfet is fully turned on.</p>
<p><em>Power Supply #2 -   high voltage, high power &#8211; </em>This power supply is used exclusively to drive the flyback transformer. Try to find a moderately high voltage power supply for this that is capable of sourcing at least 1-2amps. For all of the arcs pictured on this page I used my bench power supply which was capable of providing 25v at about 1.5 amps. In my &#8220;plasma speaker&#8221; I had to make my own power supply capable of sourcing 60v at 2-3amp. Interestingly, high voltage isn&#8217;t <em>required </em>to operate this circuit. I&#8217;ve hooked up a 9v battery and gotten 1-2mm sparks about of the flyback.</p>
<p><em>Note:  It is possible to run both parts of this circuit from the same power supply, but I don&#8217;t recommend it. The highest voltage you can run the 555 timer at is 16v. This voltage is far too low to get the most out of your flyback. If you decide to use the same power supply, I recommend puting some capacitors across the power rails near the 555 timer and TC4424 to smooth out any spikes created by the mosfet switching. </em></p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/p1030394.jpg"><img class="alignnone size-full wp-image-283" title="p1030394" src="http://www.esorensen.com/wp-content/uploads/2008/12/p1030394.jpg" alt="p1030394" width="640" height="480" /></a></p>
<p><em>Heatsink</em> &#8211; Despite its efficient design, the mosfet will produce a significant amount of heat. Find some metal to attach to the body of the mosfet to dissipate the heat. The heatsink I use (above) is actually NOT large enough to run my plasma speaker indefinitely &#8211; I have to turn the speaker off after a few minutes of operation.</p>
<p><em>Assorted Resistors and Capacitors</em> &#8211; Check the schematics for more information about values.</p>
<p><strong>Part 4 &#8211; Assembly</strong></p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/high-voltage-schematic2.gif"><img class="alignnone size-full wp-image-284" title="high-voltage-schematic2" src="http://www.esorensen.com/wp-content/uploads/2008/12/high-voltage-schematic2.gif" alt="high-voltage-schematic2" width="500" height="333" /></a></p>
<p><strong>Note: Assemble everything, but DO NOT turn on the high-power supply yet!</strong></p>
<p>Use the above schematic to assemble the flyback driver on your breadboard. In addition to the previously mentioned components you will need:</p>
<p>(1)  5k Potentiometer</p>
<p>(2) 1k Resistors</p>
<p>(1) 10 nF Capacitor</p>
<p>(2) 0.1 uF Capacitor (essential!)</p>
<p>In this circuit the 555 timer is acting as an astable oscillator. Using the potentiometer between pins 6 and 7 of the 555 timer you can adjust the frequency of oscillation from 11-48kHz. If you cannot find a potentiometer, you can try replacing the resistors between pins 6 and 7 of the timer with a single 3k resistor. This will lock the frequency at about 20kHz.</p>
<p>If you have an oscilloscope, I recommend testing pin three of the timer after you have everything assembled. You should see a square wave of the appropriate frequency on this pin. You may also want to check pin 7 of the TC4424 chip to make sure the signal is propagating through the chip.</p>
<p>Make sure to use the decoupling (0.1uF) capacitors in the circuit. The TC4424 probably won&#8217;t operate and can even be damaged without this capacitor.</p>
<p><strong>Part 5 &#8211; Turn it On, Verify it Works,  and Determine HV-</strong></p>
<p>When you turn on the circuit the high voltage from the flyback will appear between the red tube on the top (HV+) and a single pin along the bottom (HV-). The easiest way to determine which pin is connected to HV- is to turn it on and observe it. First, cut the &#8220;suction cup&#8221; from the end of the red wire and strip a small amount of insulation off the end. Use electrical tape to attach the end of the red wire to the end of a long wooden dowel. You will use this as a &#8220;wand&#8221; to point red wire at each of the pins along the bottom of the flyback transformer.</p>
<p>If you can &#8211; you should turn down your high-power supply at this point.</p>
<p>Turn on both of the power supplies and see what happens. If you don&#8217;t get any arc between the red wire and the bottom pins turn everything off and switch the wires of the primary winding on your breadboard. Next time you turn on the power supplies you should get a substantial arc between the HV- pin and the HV+ wire.</p>
<p>Now turn everything off and solder a wire to the HV- pin.  Once you have HV- and HV+ wires coming out of the flyback cover the ENTIRE thing with electrical tape to prevent shorts. This is what my flyback looked like when I was done:</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_6190_1.jpg"><img class="alignnone size-medium wp-image-285" title="img_6190_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_6190_1-500x333.jpg" alt="img_6190_1" width="500" height="333" /></a></p>
<p><strong>Part 6 &#8211; Enjoy </strong></p>
<p>Now have fun creating giant sparks of electricity! If you are dissapointed with the sparks you get out of your transformer you can either tune it using the potentiometer or add a larger power supply. I&#8217;ve gotten arcs about 3-4 inches long using only 30-35 volts. Please be careful, but have fun! Let me know if you have any questions or if you know of any ways I can improve my design!</p>
<p>When you get bored with high votlage arcs, stay tuned for the 2nd part of this article: Building a plasma speaker. I&#8217;ll show you how to modify the current circuit so that the high voltage arc creates music. This is a video of my plasma speaker:</p>
<p><object width="425" height="344" data="http://www.youtube.com/v/8xCKCxkhwB4&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/8xCKCxkhwB4&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>Here are some pictures of sparks I&#8217;ve created:</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_9015_1.jpg"><img class="alignnone size-medium wp-image-286" title="img_9015_1" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_9015_1-500x262.jpg" alt="img_9015_1" width="500" height="262" /></a></p>
<p>These sparks are about 2.5 inches apart.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_9010.jpg"><img class="alignnone size-medium wp-image-287" title="img_9010" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_9010-500x259.jpg" alt="img_9010" width="500" height="259" /></a></p>
<p>Ozone</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_8984.jpg"><img class="alignnone size-medium wp-image-288" title="img_8984" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_8984-500x238.jpg" alt="img_8984" width="500" height="238" /></a></p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_8951.jpg"><img class="alignnone size-medium wp-image-289" title="img_8951" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_8951-500x333.jpg" alt="img_8951" width="500" height="333" /></a></p>
<p>Short time-lapse of my jacob&#8217;s ladder.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_8964.jpg"><img class="alignnone size-medium wp-image-290" title="img_8964" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_8964-329x500.jpg" alt="img_8964" width="329" height="500" /></a></p>
<p>Larger View</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/12/img_8817.jpg"><img class="alignnone size-medium wp-image-291" title="img_8817" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_8817-500x333.jpg" alt="img_8817" width="500" height="333" /></a></p>
<p>This was done on my workbench with only about 15v input voltage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.esorensen.com/2008/12/13/generating-high-voltage/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Howto: Etch your own circuit board</title>
		<link>http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/</link>
		<comments>http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 06:25:49 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[howto etch circuit guide]]></category>

		<guid isPermaLink="false">http://www.esorensen.com/?p=24</guid>
		<description><![CDATA[
For those of you still using breadboards or toiling over protoboards, circuit etching is the next step in your at-home fabrication. Etching circuit boards allows you to spend more time designing a project and less time assembling it. Etching boards cuts back on the amount of wired clutter on a board, provides easy reproduction, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.esorensen.com/wp-content/uploads/2008/10/title.jpg"></a><a href="http://www.esorensen.com/?attachment_id=226"><img class="alignnone size-medium wp-image-226" title="title" src="http://www.esorensen.com/wp-content/uploads/2008/12/title-499x359.jpg" alt="title" width="499" height="359" /></a></p>
<p>For those of you still using breadboards or toiling over protoboards, circuit etching is the next step in your at-home fabrication. Etching circuit boards allows you to spend more time designing a project and less time assembling it. Etching boards cuts back on the amount of wired clutter on a board, provides easy reproduction, and allows you to work with surface mount components. Furthermore, learning to etch boards at home will save you time and money over professional fabrication.</p>
<p>Having etched a few circuit boards now, I feel I have the experience to pass on some of my knowledge. I was nervous the first time I etched a board so my goal to provide enough information for anyone reading this guide to create their own circuit boards- <em>without </em>having to second guess themselves throughout the process. This is an all-encompassing guide that describes the materials, prep-work, and final etching.</p>
<p><span id="more-24"></span><!--pagetitle:Step One: Materials--></p>
<p><strong>Step One: Materials</strong></p>
<p>1. Copper clad board  ~$15</p>
<p><a rel="attachment wp-att-26" href="http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/ip04/"></a><a rel="attachment wp-att-239" href="http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/ip04-2/"><img class="alignnone size-medium wp-image-239" title="ip04" src="http://www.esorensen.com/wp-content/uploads/2008/10/ip04-500x333.jpg" alt="ip04" width="500" height="333" /></a></p>
<p>The first thing you should buy is 1oz copper clad board. This is probably the only material you won&#8217;t be able to find locally so you should buy it a few days before you want to etch a board. This is cheap enough that you can buy it in bulk and have it available whenever you want to etch. I buy mine on Ebay and simply search for &#8220;copper clad board&#8221;. You can buy either double sided or single sided boards. I recommend buying both. Some projects may require two layers, but often you&#8217;ll only use one side. And using a two sided copper clad board for a project that only requires one is wasteful and will require much longer to etch.</p>
<p>2. Muriatic Acid &#8211; $5-10</p>
<p><a rel="attachment wp-att-28" href="http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/ip081/"></a><a href="http://www.esorensen.com/?attachment_id=206"><img class="alignnone size-medium wp-image-206" title="ip08" src="http://www.esorensen.com/wp-content/uploads/2008/12/ip08-333x500.jpg" alt="ip08" width="333" height="500" /></a></p>
<p>This can be found at most major hardware stores. Home depot has 5M HCl muriatic acid for sale by the gallon. This is a strong acid and should be handled with care. Do not get this acid near ANYTHING metal. And do not breathe the fumes coming from the container, especially upon first opening it.</p>
<p>3. Hyrdogen peroxide (3%) &#8211; $1</p>
<p>Everyone knows about hydrogen peroxide. Most of us have some around the house already. If you don&#8217;t have any hydrogen peroxide you can pick it up at the grocery store. $1 will get you enough for a lifetime of etching.</p>
<p>4. Drill bits &#8211; $2-10</p>
<p>You&#8217;ll need small drill bits to drill holes for component leads. Specifically, you&#8217;ll need 1/32&#8243; and 3/64&#8243; bits. These are not sold separately at most hardware stores, but you can get them in a <a href="http://www.dremel.com/en-us/AttachmentsAndAccessories/Pages/AttachmentsDetail.aspx?pid=628-01">Dremel kit</a>. If you want to order the drill bits individually, you can find them online.</p>
<p>5. Acetone &#8211; $5-10</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/10/acetone.jpg"></a><a rel="attachment wp-att-240" href="http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/acetone-2/"><img class="alignnone size-full wp-image-240" title="acetone" src="http://www.esorensen.com/wp-content/uploads/2008/10/acetone.jpg" alt="acetone" width="288" height="348" /></a></p>
<p>Although this material is optional, it will help you to clean the toner off the board when you are finished. One bottle will last you a long time so I recommend you buy some to make your life easier.</p>
<p>6. Dremel or Drill press</p>
<p>A normal drill is not ideal for drilling holes in circuit boards. If that is all you have you can probably make it work, but the high speed of a dremel and stability of a drill press are much better suited for PCB work.</p>
<p>7. An Iron/Ironing board.</p>
<p><a href="http://www.esorensen.com/wp-content/uploads/2008/10/img_9799.jpg"></a><a rel="attachment wp-att-213" href="http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/img_9799-2/"><img class="alignnone size-medium wp-image-213" title="img_9799" src="http://www.esorensen.com/wp-content/uploads/2008/12/img_9799-333x500.jpg" alt="img_9799" width="333" height="500" /></a></p>
<p>I assume you already have an iron. If not, go buy one. <img src='http://www.esorensen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.esorensen.com/2008/10/05/howto-etch-your-own-circuit-board/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
