<?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>Synoptic Labs</title>
	<atom:link href="http://www.synopticlabs.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.synopticlabs.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 10 Jun 2009 19:41:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Addressable RGB LED Strip</title>
		<link>http://www.synopticlabs.com/blog/?p=97</link>
		<comments>http://www.synopticlabs.com/blog/?p=97#comments</comments>
		<pubDate>Wed, 10 Jun 2009 19:41:43 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Tinkering]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=97</guid>
		<description><![CDATA[
Recently I&#8217;ve been playing with something I think is somewhat of a holy grail in LED enthusiast circles:  the addressable RGB LED strip.
Non-addressable RGB strip (meaning you can turn the whole strip a particular color but not any individual LED) is becoming easier to find in the market but a RGB strip where you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/3614971585" title="View 'RGB LED Strip' on Flickr.com"><img src="http://farm3.static.flickr.com/2482/3614971585_ddf9de6369.jpg" alt="RGB LED Strip" border="0" width="500" height="375" /></a></p>
<p>Recently I&#8217;ve been playing with something I think is somewhat of a holy grail in LED enthusiast circles:  the addressable RGB LED strip.</p>
<p>Non-addressable RGB strip (meaning you can turn the whole strip a particular color but not any individual LED) is becoming easier to find in the market but a RGB strip where you can actually control each LED individually has only been the subject of geek fantasy.  Every time I&#8217;ve done something public with common RGB strip, someone has come up to me and said &#8220;oh wow man, can you control those LED&#8217;s individually?&#8221;.  No, sorry, with those strips you couldn&#8217;t &#8212; but with this strip you can!</p>
<p>   <span id="more-97"></span>So where do these fabled strips come from?  Well, the one I&#8217;ve been playing with fell into my lap a few months ago &#8212; tossed there by my friend Dan who got it from a shady-looking factory in China while there evaluating LED video wall products.  I&#8217;ve asked him for the name of the factory but he&#8217;s so far been drawing a blank.</p>
<p>At the time he assumed (as did I when I first saw it) that the strip consisted nothing more of RGB LED&#8217;s hooked up to standard standard shift registers, similar to how I built my single-color <a href="http://www.synopticlabs.com/blog/index.php/2009/06/02/led-serial-strip-v10/">LED serial strip</a>.  This turns out not to be the case and that the chips driving the LED&#8217;s are actually packed with a bit of smarts to them.</p>
<p>This became evident when I built a simple test program which treated the strip like a common shift register but failed in confounding ways to work.    Eventually I had to cut away some of the silicone liner on the strip to get a closer look at the driver chip.  The chip turned out to be a &#8220;HL1606&#8243;, nothing I&#8217;d ever heard of.  A few hours of online research left me with a datasheet for the HL1606 written only in Chinese and a single posting by one &#8220;John Cohn&#8221; from September 2007 looking for anybody who had more information on how to drive the chip.  The posting didn&#8217;t get any useful replies.</p>
<p>I tried running the datasheet through Google translate which was somewhat successful but left me scratching my head over the precise way to interpret sentences like this:</p>
<blockquote><p>When a data bit for the Road 10 (D2D1 or D4D3 or D6D5) and latches valid, the corresponding LED driver output state for Prescribed changes gradually, when the change to keep the brightest light of the state, until the new data is entered and effective latch.</p></blockquote>
<p>It *sounds* like english, right?  Yeah, anyways, trying to decipher the datasheet lasted for only so long before I got pulled away to more important distractions and the RGB strip sat on my bench untouched for months.</p>
<p>Then Maker Faire happened and, by some freak chance, while I was chatting to people about the <a href="http://www.monkeylectric.com/">MonkeyLectric</a> bike wheels, a guy came by wearing a most eye-catching headband.  The headband was constructed out flexible circuit board material on which RGB LEDs were mounted and were clearly being controlled individually.  Obviously, this was a guy I had to talk to.  After a short conversation I learned that he had found the strip from an electronics booth in China, the strip was built using HL1606 driver chips, and he too had had a heck of a time (and only partial success) figuring out how to drive them.  We exchanged contact info and a pledge to get in touch after the faire to share data and geek out on the strips.  It wasn&#8217;t until after I had gotten home did I piece it together that this guy was none other than the &#8220;John Cohn&#8221; whose lonely, unanswered call for help in 2007 was the only evidence I was able to find that anybody else in the world was playing with these strips.</p>
<p>Maker Faire rocks.</p>
<p>Anyways, shortly after we got to our respective homes, John sent me a copy of the datasheet in Chinese which I had already found earlier as well as the PIC code for his headband.  The PIC code was the missing key to the puzzle and by studying it in conjunction with the machine-translated datasheet I was finally able to get my head wrapped around how the chip worked.</p>
<p>Below is a short video showing off a basic rainbow-scroll (the &#8220;hello world&#8221; of addressable RGB strip effects):</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ydVPq7UGVZc&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ydVPq7UGVZc&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>So that nobody has to ever go through what John and I went through to get these strips to work, I wrote an <a href="http://code.google.com/p/ledstrip/">Arduino library for the HL1606</a> and open sourced it.  It&#8217;s still a bit unpolished and under-documented but it&#8217;s feature-complete in the sense that it can control all of the features of the HL1606.</p>
<p>Oh, and before anybody asks, I don&#8217;t yet have a solid source for more of the strips but I&#8217;ve found them being sold online.  So far I&#8217;ve only been able to find them being bundled with a controller and I&#8217;d like to find a source selling them without one (hopefully at a reduced price).  To hunt them down on your own, the keywords to look for are HL1606 and 5-volt operation.  The 5-volt operation is actually the key distinguisher, as all of the non-addressable RGB strips run on 12V or higher.</p>
<p><b>Update 6/18/09:</b> I see John&#8217;s posted an Instructable on his <a href="http://www.instructables.com/id/Too-cool-Rainbow-Headband/">Too-cool Rainbow Headband</a>.  In it he documents more what you need to do to drive the chip and even suggests some possible suppliers for the strips.  Check it out (and if you like it, give him a vote for the &#8216;Get the LED Out&#8217; contest he&#8217;s entered it into <img src='http://www.synopticlabs.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>MonkeyLectric wheel POV</title>
		<link>http://www.synopticlabs.com/blog/?p=93</link>
		<comments>http://www.synopticlabs.com/blog/?p=93#comments</comments>
		<pubDate>Fri, 05 Jun 2009 06:40:56 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Tinkering]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=93</guid>
		<description><![CDATA[
So part of the reason that I&#8217;ve been so slack with the postings this year has been because I&#8217;ve been collaborating on this project as well.  We&#8217;ve been sorta pseudo-hush about it as we&#8217;ve been developing it but, now that we&#8217;ve shown it in its full glory at Maker Faire, the cat&#8217;s outta the [...]]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/mT13ZcpwYtA&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mT13ZcpwYtA&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>So part of the reason that I&#8217;ve been so slack with the postings this year has been because I&#8217;ve been collaborating on this project as well.  We&#8217;ve been sorta pseudo-hush about it as we&#8217;ve been developing it but, now that we&#8217;ve shown it in its full glory at Maker Faire, the cat&#8217;s outta the bag.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=93</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LED Serial Strip v1.0</title>
		<link>http://www.synopticlabs.com/blog/?p=83</link>
		<comments>http://www.synopticlabs.com/blog/?p=83#comments</comments>
		<pubDate>Wed, 03 Jun 2009 06:28:07 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[LED Serial Strip]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=83</guid>
		<description><![CDATA[
They&#8217;re in!  I&#8217;ve finally gotten back the first factory run of serial LED strips and they look awesome.  50 meters of LEDs on a string and I&#8217;m really quite happy with them.  I&#8217;ve tested about half of the batch and so far haven&#8217;t run into any build-quality problems.  They just seem [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/3590814601" title="View 'LED Serial Strips v1.0' on Flickr.com"><img src="http://farm4.static.flickr.com/3614/3590814601_2ab9ee8af4.jpg" alt="LED Serial Strips v1.0" border="0" width="500" height="375" /></a></p>
<p>They&#8217;re in!  I&#8217;ve finally gotten back the first factory run of serial LED strips and they look awesome.  50 meters of LEDs on a string and I&#8217;m really quite happy with them.  I&#8217;ve tested about half of the batch and so far haven&#8217;t run into any build-quality problems.  They just seem to all work.</p>
<p>In particular I&#8217;ve been impressed with how flexible the strips have been and how resilient (so far) they&#8217;ve been in the face of bending.  Most LED strips that are available on the market now are coated with a rubbery like clear flexible coating which protects them from the elements and gives them additional strength.  The factory was able to apply such a coating but I opted out of it since my intended application was indoors-only and I didn&#8217;t want the additional bulk.  Also having them uncoated lets me change the color of the LED&#8217;s later if I need to.  Thus without the coating these strips are significantly more fragile than your typical LED strip and yet they&#8217;ve put up with all the punishment I&#8217;ve dished out to them so far.</p>
<p><span id="more-83"></span>I actually didn&#8217;t receive these till about a week and a half or so before Maker Faire 2009, leaving me little time to put together any sort of serious demonstration since I was focused on making sure the 4-spoke <a href="http://www.monkeylectric.com/">monkeylectric</a> wheel was running solid.  However I brought them to the Faire anyways and at the very last second put together a primitive demo by stringing a couple 5-meter rolls around our tent with zipties and packing tape and driving them with an Arduino.  I thought it all looked really gimpy but I got some nice comments on them anyways.</p>
<p>A surprising number of people asked me if I were was selling the the strips or if I was planning to.  You know, that&#8217;s one of those interesting questions that the more people ask it, the more I&#8217;m inclined to say yes.</p>
<p><a href="http://www.flickr.com/photos/23524524@N05/3591726804" title="View 'LED Serial Strip Driver Shield' on Flickr.com"><img src="http://farm4.static.flickr.com/3366/3591726804_a80751935b.jpg" alt="LED Serial Strip Driver Shield" border="0" width="500" height="375" /></a></p>
<p>Someone else asked me how I was driving the strips.  For the demo, I hacked together a simple controller using an Arduino with a <a href="http://www.ladyada.net/make/pshield/">Proto Shield</a>.</p>
<p>As far as how you drive the strips (asked by a commenter in <a href="http://www.synopticlabs.com/blog/index.php/2008/05/11/serial-led-strip-pt4/">a different post</a>), here&#8217;s what you need.</p>
<pre>
   Pin 1 = V+ (4 to 7 volts)
   Pin 2 = LATCH
   Pin 3 = CLK
   Pin 4 = DATA
   Pin 5 = V-
</pre>
<p>LATCH, CLK, and DATA are used just as with a typical shift register.  DATA gets latched into the shift register on the rising edge of CLK but the state of the shift register doesn&#8217;t affect the LED output pins until LATCH is driven high.  Thus if you tie LATCH high all the time (as I do for the chasing-LEDs effect), then on every rising CLK edge the whole chain of LED&#8217;s will shift down by one.  If you want to have more control, you can keep LATCH low and clock in a whole chain&#8217;s worth of new data before driving LATCH high again.  Do this fast enough and you can give the illusion that you&#8217;re controlling the LEDs individually.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=83</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ian Hanschen&#8217;s Blog</title>
		<link>http://www.synopticlabs.com/blog/?p=47</link>
		<comments>http://www.synopticlabs.com/blog/?p=47#comments</comments>
		<pubDate>Fri, 27 Feb 2009 19:34:44 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[babble]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=47</guid>
		<description><![CDATA[
My friend Ian Hanschen (aka Furan)  has been doing a number of impressive projects involving LED&#8217;s and electronics.  If you enjoy the sort of material I write about here, definitely give his blog a visit too.
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.escapehatchlabs.com/userfiles/main/uploaded/leddisplay.jpg" height=375></p>
<p>My friend <a href="http://www.escapehatchlabs.com/index.php">Ian Hanschen</a> (aka <a href="http://www.escapehatchlabs.com/index.php">Furan</a>)  has been doing a number of impressive projects involving LED&#8217;s and electronics.  If you enjoy the sort of material I write about here, definitely give <a href="http://www.escapehatchlabs.com/index.php">his blog</a> a visit too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=47</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LED Valentines Day Card</title>
		<link>http://www.synopticlabs.com/blog/?p=31</link>
		<comments>http://www.synopticlabs.com/blog/?p=31#comments</comments>
		<pubDate>Sat, 14 Feb 2009 21:29:19 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[make]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=31</guid>
		<description><![CDATA[
This year I gave my sweetheart a LED Valentine.
16 LED&#8217;s surface mounted onto flexible circuit-board material and driven by a small microcontroller.  The LED&#8217;s animate a pattern which pulses (approximately) to the beat of my own heart.

The circuit incorporates 2 STP08DP05TTR constant-current shift registers (so I didn&#8217;t
have to try and place 16 resistors for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/3279803358" title="View 'LED Valentines Day Card' on Flickr.com"><img src="http://farm4.static.flickr.com/3326/3279803358_69f4317295.jpg" alt="LED Valentines Day Card" border="0" width="500" height="375" /></a></p>
<p>This year I gave my sweetheart a LED Valentine.</p>
<p>16 LED&#8217;s surface mounted onto flexible circuit-board material and driven by a small microcontroller.  The LED&#8217;s animate a pattern which pulses (approximately) to the beat of my own heart.<br />
<span id="more-31"></span><br />
The circuit incorporates 2 STP08DP05TTR constant-current shift registers (so I didn&#8217;t<br />
have to try and place 16 resistors for the LEDs) driven by an ATTiny45V microcontroller.</p>
<p>The circuit itself was toner-transfer etched onto DuPont Pyralux flexible circuit-board material.  The Pyralux is pretty cool stuff; it feels like a tough plastic tissue-paper that crinkles when you flex it yet stands up to a reasonable amount of ham-handing (lucky for me and my particularly ham-like hands).  The circuit traces were only 11mil wide and yet they stood up to my hand-soldering on this material without breaking or lifting off.  The stuff is quite handy when you need a printed circuit but don&#8217;t want the bulk of a standard PCB.</p>
<p><a href="http://www.flickr.com/photos/23524524@N05/3279803106" title="View 'Valentines Day Card 2009 Circuit' on Flickr.com"><img src="http://farm4.static.flickr.com/3310/3279803106_51cea519da.jpg" alt="Valentines Day Card 2009 Circuit" border="0" width="500" height="467" /></a></p>
<p>The software pattern consists of two sets of chasing LEDs sliding past each other at different speeds.  This results in a visual pulse harmonic which I tuned to the approximate speed of my own heartbeat at the time of coding.</p>
<p>The card was presented alongside a tasty breakfast-in-bed and was well received.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/-QvHKuV1_us&#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/-QvHKuV1_us&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=31</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Garage Door Monitor</title>
		<link>http://www.synopticlabs.com/blog/?p=29</link>
		<comments>http://www.synopticlabs.com/blog/?p=29#comments</comments>
		<pubDate>Thu, 31 Jul 2008 21:33:08 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Tinkering]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=29</guid>
		<description><![CDATA[
Since my last posting, Synoptic Labs has been transplanted to new, larger digs in Sacramento, CA.  As a feature of the new location, we now find ourselves with a full garage which has substantially increased our storage and work area.  However, this garage opens up onto a busy downtown street with a lot [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/2720038005" title="View 'Garage' on Flickr.com"><img src="http://farm4.static.flickr.com/3057/2720038005_618f18d1f2.jpg" alt="Garage" border="0" width="500" height="375" /></a></p>
<p>Since my last posting, Synoptic Labs has been transplanted to new, larger digs in Sacramento, CA.  As a feature of the new location, we now find ourselves with a full garage which has substantially increased our storage and work area.  However, this garage opens up onto a busy downtown street with a lot of foot-traffic and a bit of that traffic is from scavengers &#8212; people who routinely comb the neighborhood (usually early in the morning) looking for recyclables or, frankly, anything that isn&#8217;t nailed down.</p>
<p>The door is opened by remote control and, as we&#8217;ve found on numerous occasions already, it&#8217;s all too easy to inadvertently hit the remote and open the door without realizing or just forget to close it.  More than once we&#8217;ve woken up and found that the door has been wide open all night long; the fact that we haven&#8217;t lost any tools or equipment because of this astounds me.</p>
<p>Knowing that our luck wasn&#8217;t going to hold out forever if we keep leaving the door open, I decided something had to be done.  So I hacked together a internet/mobile-phone enabled garage door monitoring system which will notify us if the door is left open during the night.</p>
<p><span id="more-29"></span></p>
<p><a href="http://www.flickr.com/photos/23524524@N05/2720038105" title="View 'Garage door sensor' on Flickr.com"><img src="http://farm4.static.flickr.com/3181/2720038105_b623e2eddb_m.jpg" alt="Garage door sensor" border="0" width="240" height="180" /></a><a href="http://www.flickr.com/photos/23524524@N05/2720862594" title="View 'Tapping garage sensor into parallel port' on Flickr.com"><img src="http://farm4.static.flickr.com/3284/2720862594_feb62f1d57_m.jpg" alt="Tapping garage sensor into parallel port" border="0" width="240" height="180" /></a></p>
<p>Using a simple push-switch from my electronics junk box and the parallel port on my FreeBSD server, I was able to wire the switch into the parallel port and write a very simple program to check whether or not the switch was closed.  This was the first time I&#8217;ve ever hacked with the parallel port so it took me a little bit to figure out the pinouts.  However, I was delighted to find that FreeBSD had the awesome ppi(4) interface for the parallel port and that it was already installed and running on my server.  It only took me a couple minutes to write a simple program which could check the status of my switch and thus report on the state of the garage door.</p>
<p>Once that was done I whipped up a simple shell script which would run out of cron every minute and log the status of the garage door.  I also whipped up a simple CGI script to so the status could be queried on the web and incorporated that into a live-status page on our private wiki.  This makes it easy to check on the garage door from our mobile phones.</p>
<p>The final touch was setting up a <a href="http://www.twitter.com/">Twitter</a> account for the garage door and posting updates to that account.  Now we&#8217;re able to get SMS notifications whenever the garage opens or closes.  To minimize the chatter, the SMS notifications are generated only if the door is opened at night.</p>
<p>And thus with about $0.05 worth of parts and an afternoon&#8217;s worth of work, we now have a mobile phone/internet-enabled garage status monitoring system to alert us if we ever leave the door open again.</p>
<h4>garagelog.sh &#8212; run out of cron every minute</h4>
<blockquote>
<pre>
#!/bin/sh

./garageis > status/garage.now

# Hour past which we'll report updates to twitter
twitstart=22
# Hour before which we'll report updates to twitter
twitstop=6

username='yourtwitteruser'
password='yourtwitterpass'

hour=`date +%H`
minute=`date +%M`

if [ ! -f status/garage.then ] || ! cmp -s status/garage.then status/garage.now; then
	if [ $hour -ge $twitstart -o $hour -lt $twitstop ]; then
		/usr/local/bin/curl -u $username:$password \
			  -d status="`cat status/garage.now`" \
			  http://twitter.com/statuses/update.xml > /dev/null 2>&#038;1
		echo `date "+%G-%m-%d %R:%S garage: "` `cat status/garage.now` "(twittered)" >> garage.log
	else
		echo `date "+%G-%m-%d %R:%S garage: "` `cat status/garage.now` >> garage.log
	fi

	mv status/garage.now status/garage.then
elif [ $hour -eq $twitstart -a $minute -eq 0 ] &#038;&#038; grep -q open status/garage.now; then
	# make sure we send a twitter if the garage is open when our
	# sensitivity window starts
	/usr/local/bin/curl -u $username:$password \
		  -d status="`cat status/garage.now`" \
		  http://twitter.com/statuses/update.xml > /dev/null 2>&#038;1
fi
</pre>
</blockquote>
<h4>garageis.c &#8212; report status of garage door</h4>
<blockquote>
<pre>
#include &lt;fcntl.h&gt;
#include &lt;errno.h&gt;
#include &lt;stdio.h&gt;
#include &lt;dev/ppbus/ppi.h&gt;
#include &lt;dev/ppbus/ppbconf.h&gt;

int fd;

int
main()
{
	uint8_t  val;

	fd = open("/dev/ppi0", O_RDONLY);

	if(!fd) {
		perror(NULL);
		return(1);
	}

	// turn on data bits
	val = 0xff;
	ioctl(fd, PPISDATA, &#038;val);

 	// read status flags.  if nBusy is 1, then garage is closed.
	ioctl(fd, PPIGSTATUS, &#038;val);

	if ( val &#038; nBUSY )
		printf("Garage is closed.\n");
	else
		printf("Garage is open.\n");

	// turn off data bits
	val = 0x00;
	ioctl(fd, PPISDATA, &#038;val);

	return(0);
}
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=29</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Serial LED Strip pt4</title>
		<link>http://www.synopticlabs.com/blog/?p=28</link>
		<comments>http://www.synopticlabs.com/blog/?p=28#comments</comments>
		<pubDate>Mon, 12 May 2008 05:28:22 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[LED Serial Strip]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=28</guid>
		<description><![CDATA[
Progress continues on the Serial LED strips project. I&#8217;ve assembled a fair number of the prototype strips and have been experimenting with a few ideas.  I&#8217;m really excited about this project&#8230; I keep thinking of new projects I can do with these little strips.  However for now my focus is on testing the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/2485987740" title="View 'Testing Serial Strips' on Flickr.com"><img src="http://farm4.static.flickr.com/3061/2485987740_87a2d449ba.jpg" alt="Testing Serial Strips" border="0" width="500" height="375" /></a></p>
<p>Progress continues on the Serial LED strips project. I&#8217;ve assembled a fair number of the prototype strips and have been experimenting with a few ideas.  I&#8217;m really excited about this project&#8230; I keep thinking of new projects I can do with these little strips.  However for now my focus is on testing the ones that I have in prep for a larger scale production run.</p>
<p>Also I got a lot of positive feedback from people at the Bay Area Maker Faire on the prototype strips I brought mounted on black acrylic (slapped together at the *very* last minute).</p>
<p>Today I set about testing the resistance on the power and ground rails.  The resistance on these rails imposes a maximum length of serial strips that can be chained together before power needs to be re-tapped into the chain.  Much to my pleasant surprise, the resistance that I measured closely matched my predictions.  I had predicted a resistance of 5.70 mOhm on VCC and 6.48 mOhm on GND and I measured 5.79 mOhm on VCC and 6.42 mOhm on GND respectively.  Not bad.</p>
<p>Video of the prototype strips in action after the jump.</p>
<p><span id="more-28"></span><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/6rJS4k66Cz0&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/6rJS4k66Cz0&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=28</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Breakfast with Reflow</title>
		<link>http://www.synopticlabs.com/blog/?p=27</link>
		<comments>http://www.synopticlabs.com/blog/?p=27#comments</comments>
		<pubDate>Sat, 19 Apr 2008 00:26:17 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[LED Serial Strip]]></category>
		<category><![CDATA[make]]></category>

		<guid isPermaLink="false">http://www.synopticlabs.com/blog/?p=27</guid>
		<description><![CDATA[
My prototype boards for the striplight came in this week, woohoo!  Now starts the process of putting the design through its paces and making sure it works but before that can begin the boards have to be first assembled.
According to the guys over at SparkFun there&#8217;s no better way to do bulk surface-mount soldering [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/2424358506" title="View 'My Breakfast with Reflow' on Flickr.com"><img src="http://farm4.static.flickr.com/3028/2424358506_90dbc24b64.jpg" alt="My Breakfast with Reflow" border="0" width="500" height="375" /></a></p>
<p>My prototype boards for the striplight came in this week, woohoo!  Now starts the process of putting the design through its paces and making sure it works but before that can begin the boards have to be first assembled.</p>
<p>According to the guys over at SparkFun there&#8217;s no better way to do bulk surface-mount soldering in the home than with <a href="http://www.sparkfun.com/commerce/present.php?p=Reflow%20Skillet">skillet reflow</a>.    According to universal truth, there&#8217;s no better use for a skillet than for making delicious fluffy pancakes.  Thus it follows that any activity combining the two must be a doubleplus good.</p>
<p>Besides, heavy metals poisoning is the sweetest sauce.</p>
<p><span id="more-27"></span></p>
<p><a href="http://www.flickr.com/photos/23524524@N05/2423547339" title="View 'LED Serial Striplight Prototypes' on Flickr.com"><img src="http://farm3.static.flickr.com/2244/2423547339_39ecc6b397.jpg" alt="LED Serial Striplight Prototypes" border="0" width="500" height="375" /></a></p>
<p>Seeing as this was my first foray into the world of skillet reflow I have to say that so far I&#8217;ve been impressed with the results.  The only tricky part is placing the little components on the board without bumping the ones that you&#8217;ve already placed.   Once you have the solder paste down and all of your components placed on the board, there&#8217;s nothing more to do than simply place the board on an electric skillet, turn it on, wait until all the solder has melted, then turn it off and let it cool.  That&#8217;s it.</p>
<p>The biggest obstacle was finding the soldering paste.  A number of places sell it but a lot of them insist on overnight shipping with cryo-packing and the shipping often comes out to be more expensive than the paste itself (which is already quite expensive since you&#8217;re forced to buy far more than you&#8217;ll ever use).  Phil was so kind however as to point me to <a href="http://www.ameritronics.com/">Ameritronics</a> who will gladly sell you solder paste in small quantities at a reasonable price and the stuff they sell is formulated to have a greater shelf-life without refrigeration.</p>
<p>I&#8217;ve now reflowed two complete boards and already I found the second one substantially easier to do than the first (which already wasn&#8217;t that bad).  I do still seem to have a problem in putting too much solder paste on the IC pads resulting in solder bridges.  However a little touchup with fluxed solder-wick fixes this.  I&#8217;m probably using too wide of a needle for dispensing paste.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=27</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Talking to a Cypress CYM6935</title>
		<link>http://www.synopticlabs.com/blog/?p=26</link>
		<comments>http://www.synopticlabs.com/blog/?p=26#comments</comments>
		<pubDate>Wed, 09 Apr 2008 05:42:56 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[make]]></category>

		<guid isPermaLink="false">http://www.synoptic.org/blog/index.php/2008/04/08/talking-to-a-cypress-cym6935/</guid>
		<description><![CDATA[
Rob and I have recently been talking about doing some wireless projects.  A friend loaned us a Cypress CYM6935 module which is an evaluation module for the CYWUSB6935 chip and today we attempted to hook it up.  We chose an Arduino board simply for convenience though connecting the module to it actually took [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/2401184661" title="View 'Talking to a Cypress CYM6935' on Flickr.com"><img src="http://farm3.static.flickr.com/2026/2401184661_d97018a03e.jpg" alt="Talking to a Cypress CYM6935" border="0" width="500" height="375" /></a></p>
<p>Rob and I have recently been talking about doing some wireless projects.  A friend loaned us a Cypress CYM6935 module which is an evaluation module for the CYWUSB6935 chip and today we attempted to hook it up.  We chose an Arduino board simply for convenience though connecting the module to it actually took the bulk of our time today since the 2mm pitch pin headers on the module won&#8217;t fit into a breadboard.  Also, the Arduino runs at 5V and the Cypress chip can&#8217;t tolerate voltages that high so we had to drop the 5V signals from the Arduino down to 3.3V.  Fortunately I had a <a href="http://www.futurlec.com/">Futurlec</a> 5V to 3.3V level shifter board on hand so that problem was easily solved.</p>
<p>Once we got the module wired into the Arduino we had to figure out how to communicate with it.  Thankfully, that work has largely been done already and we borrowed code written by Lars Englund (available <a href="http://code.google.com/p/cywusb">here</a>) to test the communications with the chip.  This code was written for an ATMega8 so a few of the port definitions needed to be changed to make it run on the Arduino&#8217;s ATMega168, but this was fairly painless.</p>
<p>It should be noted to avoid possible confusion that, while we used the Arduino board, we did not use the Arduino programming environment to compile and run Lars&#8217;s code.  His code is not compatible with the Arduino framework and would require significant porting.  (this is not a criticism of the code but rather a disclaimer intended for those who may find this post. It&#8217;s not commonly understood that the Arduino hardware is perfectly happy functioning without its development environment).</p>
<p>Anyways, once we got the code to compile and talk back to us via the USART and once we got the Cypress module wired up to the board, we were pretty much done.  Much to our surprise the software found the chip and was able to talk to it on the first try.  Honestly, we had expected to be chasing stupid wiring mistakes for another few hours so this was a pleasant shock.</p>
<p>That&#8217;s pretty much where we left it.  We got the software to recognize the chip and talk to it and we called it a productive day.  Now what&#8217;s left to do is get it to scan the wireless spectrum and send that data back to the host computer for analysis and display.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=26</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Explody Easter Peeps (High Speed Photography)</title>
		<link>http://www.synopticlabs.com/blog/?p=25</link>
		<comments>http://www.synopticlabs.com/blog/?p=25#comments</comments>
		<pubDate>Mon, 24 Mar 2008 00:34:19 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Tinkering]]></category>
		<category><![CDATA[make]]></category>

		<guid isPermaLink="false">http://www.synoptic.org/blog/index.php/2008/03/23/explody-easter-peeps/</guid>
		<description><![CDATA[
(Note: these photos were taken not by me but by my friend David Lindes, who has a ton of other amazing photos on Flickr)
It&#8217;s 3 a.m. and a phone rings in the White House&#8230;
Or actually, it was about 3 p.m. and a phone rang in my pocket.  By luck the phone happened to be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/23524524@N05/2355438033" title="View 'Explody Easter Peep' on Flickr.com"><img src="http://farm3.static.flickr.com/2191/2355438033_efacd1efe8_m.jpg" alt="Explody Easter Peep" border="0" width="240" height="160" /></a><a href="http://www.flickr.com/photos/23524524@N05/2356271276" title="View 'Explody Easter Peep' on Flickr.com"><img src="http://farm4.static.flickr.com/3114/2356271276_12cbfdbd9e_m.jpg" alt="Explody Easter Peep" border="0" width="240" height="160" /></a></p>
<p>(Note: these photos were taken not by me but by my friend David Lindes, who has a ton of other amazing photos <a href="http://www.flickr.com/photos/lindes/">on Flickr</a>)</p>
<p><i>It&#8217;s 3 a.m. and a phone rings in the White House&#8230;</i></p>
<p>Or actually, it was about 3 p.m. and a phone rang in my pocket.  By luck the phone happened to be mine and on the other end of it was 3ric asking if I&#8217;d be able to help with a project that evening.  Seems he had acquired about 10 liters of liquid nitrogen and among other things was hoping to use it to do some high-speed flash photography of frozen things shattering into a million pieces upon being shot with a pellet rifle.</p>
<p>All was well and good and according to plan, except for the flash trigger, which was stuck in the mail somewhere.  Could I hack one together by evening?  Thus is how I got my project for the day.</p>
<p>A flash trigger for high-speed photography is a really simple device.  Basically all you need to do is take an audio signal and use that to trigger a flash if the signal exceeds a certain level.  Rather than muck about with $10 worth of op-amps, transistors, voltage dividers and a bunch of so-called &#8220;electrical engineering&#8221;, I splurged for the $2 solution and threw the equivalent of a mid-1980&#8217;s personal computer at the problem&#8230; i.e. a microcontroller.  Specifically, a AVR ATMega168 (mounted on a $30 Arduino).</p>
<p>Long story short and after overcoming two rather significant obstacles (#1 being not having a microphone, #2 being not having a flash) we were able to kludge together a workable flash trigger in just a couple hours.  With the flash trigger in place and <a href="http://photo.lindes.net/">David</a>  at the camera, by the end of the evening we had walked away with some decent <a href="http://www.flickr.com/photos/lindes/2356323988/">shots</a>.</p>
<p>(and made one *hell* of a mess)</p>
<p>(<i><a href="http://blog.makezine.com/archive/2007/04/electrocuting_peeps.html">our peep torture from last year</a></i>)</p>
<p><span id="more-25"></span></p>
<p>Ok, short story long, about those obstacles:</p>
<p>I didn&#8217;t have a microphone for the audio part of the trigger and was taking apart various junk devices I could find looking for something that could be used.   I tried a a headset from a cell phone, a mouthpiece from an old telephone, and the miniature microphone from a junked CVS-brand single-use video camera.  Unfortunately I wasn&#8217;t able to get any of them to make any meaningful wiggles on the oscilloscope but that&#8217;s probably because I had no idea how to properly drive a microphone (and little time to research it).</p>
<p>Thankfully, Jon boldly came to the rescue and brought in a couple of microphones, one of which was perfect.  Also 3ric picked up a old guitar amp from a pawn shop which had a mic in port as well as a headphone out port so that took care of the problem of driving the mic and amplifying the signal.  The mic went into the amp, and the amp fed directly into the Arduino via the headphone-out port.  The oscilloscope showed that shouting into the amp resulted in a signal ranging between -2.5V to 2.5V on the headphone port.  Since the Arduino can&#8217;t stomach a voltage below -0.5V on any of its pins, I had to bias the input +2.5V using a capacitor and a couple resistors.</p>
<p>The flash proved to be the stickier wicket.  By around 7 p.m. I still hadn&#8217;t located a flash and the one in the disposable camera I had planned on using turned out to have been already destroyed through previous mischief.  Thankfully Jon once again swept to the rescue by running out to the store and bringing back a new disposable camera.   Taking it apart, we quickly discovered a new challenge:  the trigger circuit requires you to short two wires that have a 300V potential difference across them.  The common approach I&#8217;ve seen in other circuits people have made is to use an SCR to gate the flash pulse, but of course we didn&#8217;t have one (see a trend yet?).  To the rescue this time was <a href="http://bandgap.rsnsoft.com/drupal/">Phil</a> who picked one up from Fry&#8217;s on his way in.</p>
<p>Since I already had my hands full integrating the audio signal and writing the firmware, Phil stepped up and took a swing at the problem of hooking up the SCR to the flash.  The first attempt resulted in the unfortunate destruction of pin 7 on the Arduino.  Apparently a significant negative voltage (-10V) had developed on the gate of the SCR and, as mentioned previously, the Arduino couldn&#8217;t stomach it.  Unfortunately in the chaos I can&#8217;t remember Phil&#8217;s explanation of what went wrong but he quickly got to the bottom of it and the flash was soon triggering perfectly off of a different pin.</p>
<p>Don&#8217;t ask me why the universe works this way but at just the moment when the flash situation had been resolved, David walks into the lab and hands me a professional type flash.  His flash will not only  trigger with a 5V signal but will fire 10-20 times before the little disposable flash has recovered from firing once.  Hooking this up to the Arduino was no harder than making a two-wire cable so we went with this flash instead.</p>
<p><i>Because I promised David, here&#8217;s the schematic for the circuit I wound up with.</i><br />
<a href="http://www.flickr.com/photos/23524524@N05/2355583896" title="View 'High Speed Flash Photography' on Flickr.com"><img src="http://farm4.static.flickr.com/3071/2355583896_5c5287d510.jpg" alt="High Speed Flash Photography" border="0" width="500" height="285" /></a></p>
<p>The rest of the night was spent blowing to frozen smithereens anything we could get our hands on.</p>
<p><a href="http://www.flickr.com/photos/23524524@N05/2355543456" title="View 'High Speed Flash Photography' on Flickr.com"><img src="http://farm3.static.flickr.com/2226/2355543456_f98afc6925_m.jpg" alt="High Speed Flash Photography" border="0" width="240" height="180" /></a><a href="http://www.flickr.com/photos/23524524@N05/2355542546" title="View 'High Speed Flash Photography' on Flickr.com"><img src="http://farm3.static.flickr.com/2191/2355542546_27d11685fe_m.jpg" alt="High Speed Flash Photography" border="0" width="240" height="180" /></a><br />
<a href="http://www.flickr.com/photos/23524524@N05/2354710509" title="View 'High Speed Flash Photography' on Flickr.com"><img src="http://farm4.static.flickr.com/3131/2354710509_62ef5cc021_m.jpg" alt="High Speed Flash Photography" border="0" width="240" height="180" /></a><a href="http://www.flickr.com/photos/23524524@N05/2354709849" title="View 'High Speed Flash Photography' on Flickr.com"><img src="http://farm4.static.flickr.com/3083/2354709849_512f42263b_m.jpg" alt="High Speed Flash Photography" border="0" width="240" height="180" /></a></p>
<p>Here&#8217;s a screenshot of the simple GUI I wrote to control the flash trigger, written in Processing.  The red lines signify trigger events.  The white dots signify the audio level being read by the Arduino and the green line is the trigger threshold (adjustable by dragging with the mouse).</p>
<p><a href="http://www.flickr.com/photos/23524524@N05/2354708265" title="View 'High Speed Flash Photography' on Flickr.com"><img src="http://farm3.static.flickr.com/2072/2354708265_011df4c4d8.jpg" alt="High Speed Flash Photography" border="0" width="500" height="264" /></a></p>
<p>&#8230; and, for completeness, the source code for the firmware for Arduino and the GUI, in case anybody wants to horrify themselves with the abomination that is my rushed code.</p>
<p><a href="http://new.synopticlabs.com/blog/wp-content/uploads/2008/03/simple-flash-trigger-src.zip" title="simple_flash_trigger_src.zip">simple_flash_trigger_src.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.synopticlabs.com/blog/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
