<?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>justDIY Project Log &#187; Microcontroller</title>
	<atom:link href="http://projects.dimension-x.net/archives/category/project/microcontroller/feed" rel="self" type="application/rss+xml" />
	<link>http://projects.dimension-x.net</link>
	<description>Thoughts, ideas, projects, pictures.</description>
	<lastBuildDate>Fri, 18 Sep 2009 19:09:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Mint Tin Bike Light Continues</title>
		<link>http://projects.dimension-x.net/archives/249</link>
		<comments>http://projects.dimension-x.net/archives/249#comments</comments>
		<pubDate>Fri, 18 Sep 2009 19:09:39 +0000</pubDate>
		<dc:creator>justDIY</dc:creator>
				<category><![CDATA[LEDs]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Power]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Prototyping]]></category>

		<guid isPermaLink="false">http://projects.dimension-x.net/?p=249</guid>
		<description><![CDATA[As the (normal) bicycling season draws to a close for my latitude, I&#8217;m nearing completion on my bicycle taillight project. I sent out a few weeks ago for some professionally fabricated pcbs and as usual, they look great. There were a few bugs that were entirely my fault, but nothing serious enough to stop the [...]]]></description>
			<content:encoded><![CDATA[<p>As the (normal) bicycling season draws to a close for my latitude, I&#8217;m nearing completion on my bicycle taillight project.  I sent out a few weeks ago for some professionally fabricated pcbs and as usual, they look great.  There were a few bugs that were entirely my fault, but nothing serious enough to stop the pcb from doing its job.</p>
<p><img src="http://projects.dimension-x.net/pictures/bikelite/new_taillight_asm1_sm.jpg" alt="bicycle taillight pcb assembled" /></p>
<p>I added two &#8220;features&#8221; to the pcb before sending the design out, both of which were untested in the initial prototypes.  The main feature I wanted to have was &#8220;motion detection&#8221;, so the taillight would shut down should the bike become idle for a period of time.  No need to be wasting precious photons while the bike is leaned up against a tree or parked in a bike rack.  Motion detection is provided by a roller ball switch, intended to replace the old fashioned mercury switch.  A tiny gold plated ball rolls around in a plastic and metal cage, completing electrical circuits during its travel.  The light&#8217;s micro-controller recognizes these impulses and continues to let the light function.  As soon as the tilt switch stops changing state, resting as either a short or open circuit, the uC begins a count.  When that count totals some arbitrary number, the light returns to a standby mode with the SMPS in shutdown.  The uC then watches the tilt sensor for the state to change again and upon a change, resumes the previous operational mode.</p>
<p>The second feature is a battery minder circuit.  Using a 2.5v precision reference, the micro-controller samples the battery voltage using its on board ADC.  The idea is to detect a weak battery condition and operate the SMPS at a lower duty cycle, to make the most of the remaining power.  The assumption here is that some light is better than no light in terms of safety.  One of my pcb bugs lies in this circuit.  The Microchip 12F683 uC I selected for this project is an 8 pin device.  Its voltage reference pin is also multiplexed with the programming clock.  In my design, I had made the error of connecting the vref pin directly to the voltage reference output, which is biased with a 1k resistor to the Vdd rail (bat +).  So effectively, I have a very strong pull-up to 2.5v on that pin.  This made programming the PIC impossible as it could not detect clock transitions.  I will try salvaging these PCBs by changing to a 10k or 20k bias resistor on the reference, or cutting the trace leading to the Vref pin and soldering a 10k+ resistor in series, since we don&#8217;t need any current on that pin, just voltage.</p>
<p><img src="http://projects.dimension-x.net/pictures/bikelite/new_taillight_asm2_sm.jpg" alt="" /></p>
<p>Once I polish the code a bit more, I&#8217;ll be looking for a few folks to send a sample units to in exchange for reviews and feedback, down the road I would like to sell these either as a kit or a pre-assembled unit.</p>
<img src="http://projects.dimension-x.net/?ak_action=api_record_view&id=249&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://projects.dimension-x.net/archives/249/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mint Tin Bike Light 3</title>
		<link>http://projects.dimension-x.net/archives/230</link>
		<comments>http://projects.dimension-x.net/archives/230#comments</comments>
		<pubDate>Fri, 28 Aug 2009 02:48:00 +0000</pubDate>
		<dc:creator>justDIY</dc:creator>
				<category><![CDATA[LEDs]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Power]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Prototyping]]></category>

		<guid isPermaLink="false">http://projects.dimension-x.net/?p=230</guid>
		<description><![CDATA[I completed PCB revision three of the mint tin bike light on Tuesday, but due to lack of batteries for the camera, no pictures were taken! Luckily I&#8217;ve found and recharged a second set of batteries and the camera is once again operational. Feature-wise, this revision adds nothing over the previous light, all the changes [...]]]></description>
			<content:encoded><![CDATA[<p>I completed PCB revision three of the mint tin bike light on Tuesday, but due to lack of batteries for the camera, no pictures were taken!  Luckily I&#8217;ve found and recharged a second set of batteries and the camera is once again operational.</p>
<p><a href="http://projects.dimension-x.net/pictures/bikelite/rev3_complete_lg.jpg"><img src="http://projects.dimension-x.net/pictures/bikelite/rev3_complete_sm.jpg" alt="" /></a></p>
<p>Feature-wise, this revision adds nothing over the previous light, all the changes are in board design.  Firstly, the artwork was redone using polygon pours instead of straight point to point wiring (traces).  The revision two switcher was running pretty warm, mostly because it didn&#8217;t have much copper to dump the heat into.  </p>
<p><img width=600 src="http://projects.dimension-x.net/pictures/bikelite/taillight_revd_brd_sm.png" alt="" /></p>
<p>The switcher&#8217;s ground pin is now tied directly into a very large copper pour, as are the Vin and Switch pins.  Using a burning finger temperature probe, the chip remained at or below T<sub>body</sub> even operating in constant on mode at full power.  Compared to the revision two board which saw the switcher running quite hot in constant on mode.</p>
<p><img src="http://projects.dimension-x.net/pictures/bikelite/rev3_nobatts_sm.jpg" alt="" /></p>
<p>The current sensing resistor was moved a lot closer to the feedback pin.  With a feedback voltage of 190mV, the tiny resistance of the trace was actually affecting output.  Shortening the trace to roughly 1mm has helped a great deal.</p>
<p>Finally, the layout for the battery clips was fixed, and generous polygon pours were drawn around the pads.  The spring clips are now soldered down very firmly and hold the batteries quite well.  I have yet to take this unit on the trail, so we&#8217;ll see if a rubber band is required or not to retain the batteries while bouncing along.</p>
<p>I plan on making one more prototype before sending the design off to Custom PCB or Gold Phoenix.  I think I&#8217;ll eliminate the battery clips on the chance excessive force could cause one to separate from the laminate and severely damage the pcb.  I also want to try a board that hosts both driver circuit and LEDs.  Additionally, I plan to add a tilt / vibration sensing switch (roller ball switch), so inactivity of the bike can be detected and the light switched off to save on batteries.</p>
<p>Thanks for reading!</p>
<img src="http://projects.dimension-x.net/?ak_action=api_record_view&id=230&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://projects.dimension-x.net/archives/230/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mint Tin Bike Light</title>
		<link>http://projects.dimension-x.net/archives/211</link>
		<comments>http://projects.dimension-x.net/archives/211#comments</comments>
		<pubDate>Thu, 20 Aug 2009 13:29:05 +0000</pubDate>
		<dc:creator>justDIY</dc:creator>
				<category><![CDATA[LEDs]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Power]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Prototyping]]></category>

		<guid isPermaLink="false">http://projects.dimension-x.net/archives/211</guid>
		<description><![CDATA[I started this project a little more than a year ago, but shelved it because it wasn&#8217;t working right and I didn&#8217;t have the correct components. It was a seasonal project that would have little use over the winter, so I sort of forgot about it. This year I&#8217;ve been going on a lot of [...]]]></description>
			<content:encoded><![CDATA[<p>I started this project a little more than a year ago, but shelved it because it wasn&#8217;t working right and I didn&#8217;t have the correct components.  It was a seasonal project that would have little use over the winter, so I sort of forgot about it.</p>
<p>This year I&#8217;ve been going on a lot of bike rides with friends, sometimes on public roadways, sometimes after dark.  My bike has a nine watt 500 some odd lumen headlight, which makes it easy to see where I&#8217;m going, and definitely makes me visible head on.  The tail of my bike however still has the stock reflector, plus the little reflector stripes in my shoes, not exactly high visibility.  Not wanting to pale in comparison to the headlight, the taillight is a three watt 140 lumen beast powered by three AA rechargeable batteries.</p>
<p>The light is based on a boost converter from National Semiconductor, the LM3410.  I&#8217;m using the 525kHz SOT-23 version, the LM3410Y.   Originally I had trouble with the chip self destructing, as discussed on the Linear1 <a href="http://forums.linear1.org/index.php/topic,1592.0.html">forums</a>.  It was hypothesized either the inductor was underrated or the diode was too slow.  Ordering parts for another project later in 2008, I bought some better inductors and diodes, which more closely resembled the specs of parts used in National&#8217;s <a href="http://led.national.com">web bench simulator</a>.  So, lacking sufficient rear light, I rekindled this project and have a &#8220;working prototype&#8221; that&#8217;s gone on two rides with me so far.</p>
<p><a href="http://projects.dimension-x.net/pictures/bikelite/taillight_revc_sch.png"><img width=600 src="http://projects.dimension-x.net/pictures/bikelite/taillight_revc_sch_sm.png" alt="bike taillight schematic small" /></a></p>
<p>The basic function is fairly simple.  The 3410 is a constant current boost (step-up) driver.  A small inductor is used to ramp up the input voltage, from 3.6vdc nominal to 15.4v at approximately 200mA.  The current is monitored by a one ohm resistor.  A pair of output capacitors help smooth out the ripple and an input capacitor helps the batteries cope with the high demand current (as high as 1.5a in some cases).  I&#8217;m using nickle metal hydride batteries, which have a rather low internal resistance &#8211; they&#8217;re designed for high demand applications and when fresh, barely sag at all under the load.</p>
<p><img width=600 src="http://projects.dimension-x.net/pictures/bikelite/taillight_revc_brd_sm.png" alt="bike taillight pcb layout small" /></p>
<p>Originally I had planned on carrying the batteries directly on the PCB, using some through-hole spring clip battery holders I found in the Sparkfun library.  However, AA batteries must be bigger in Colorado than they are in Michigan, because using Sparkfun&#8217;s layout gave me about a quarter inch gap between the spring and the battery.  The pads were also woefully undersized for physically mounting the clip and holding it securely enough to survive the stress of batter insertion and extraction.  So I dropped their layout and drew my own that looks exactly like it, but is based on measurements from a real AA battery.</p>
<p><img width=600 src="http://projects.dimension-x.net/pictures/bikelite/taillight_just_washed.jpg" alt="" /></p>
<p>Along for the ride is a Microchip PIC microcontroller, the 12F683.  It provides a bit of user interface for the light, creating different blink patterns as well as putting the light into a &#8220;stand by&#8221; mode, with the switcher shut down.  I&#8217;ve programmed several blinking patterns, and somewhat organized them into &#8220;modes&#8221; which I can select using the little button.</p>
<p><img width=600 src="http://projects.dimension-x.net/pictures/bikelite/taillight_mint_tin_open.jpg" alt="" /></p>
<p>A year ago, I didn&#8217;t have any sort of enclosure in mind.  The led array was assembled on a &#8216;standard&#8217; sized protoboard, so I probably thought about using a plastic or aluminum prototype enclosure.  However, this year, I was thinking it would be a nice fit for a large mint tin.  After printing out some mock-ups and messing around with battery configurations, I settled on using three batteries and having the electronics crammed into one side of the tin with the led array mounted in the lid of the tin.  This setup might have worked, except for the battery snafu.  I&#8217;m using a plastic three cell holder right now, and the extra thickness it adds is preventing the lid from completely closing.  It closes enough that the light is easily held shut by some big rubberbands, and it survived bouncing around under my seat for two short rides.  The next revision will have the battery situation resolved and I might have a better mounting solution by then too.</p>
<p><img width=600 src="http://projects.dimension-x.net/pictures/bikelite/taillight_mint_tin_closed.jpg" alt="" /></p>
<p>Overall I&#8217;m very pleased with the outcome of this project.  I have more parts on order to make a few more lights for my other bikes and friends, and I want to experiment with other array configurations and colors.  There are a two videos of the light on my <a href="http://www.youtube.com/justdiy">youtube channel</a>, but they&#8217;re nothing to get excited about.</p>
<p>Thanks for reading!</p>
<img src="http://projects.dimension-x.net/?ak_action=api_record_view&id=211&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://projects.dimension-x.net/archives/211/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>LED Cube</title>
		<link>http://projects.dimension-x.net/archives/114</link>
		<comments>http://projects.dimension-x.net/archives/114#comments</comments>
		<pubDate>Sun, 30 Dec 2007 20:51:36 +0000</pubDate>
		<dc:creator>justDIY</dc:creator>
				<category><![CDATA[Display]]></category>
		<category><![CDATA[LEDs]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://projects.dimension-x.net/archives/114</guid>
		<description><![CDATA[I was trying come up with something impressive to write about, after having the blog dormant since July. I tossed around a lot of different ideas&#8230; Although I haven&#8217;t been writing, I&#8217;ve been dabbling in a number of different projects. None of them are really in a state I&#8217;m ready to write about. That brings [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying come up with something impressive to write about, after having the blog dormant since July.  I tossed around a lot of different ideas&#8230; Although I haven&#8217;t been writing, I&#8217;ve been dabbling in a number of different projects.  None of them are really in a state I&#8217;m ready to write about.  That brings me to something I saw a few months ago on MAKE:.  Bre and associates had constructed a simple <a href="http://blog.makezine.com/archive/2007/09/make_a_pocket_led_cube_we.html">3x3x3 led cube</a>, re-purposing a POV toy to drive the leds.</p>
<p>I figured this would be a good easy project I could finish in a day, so I drilled out a piece of pine board and set to soldering up some 3mm leds.  I wasn&#8217;t very careful, so the little matrices look kind of ugly, but it all works and you can&#8217;t see the wires in the dark!</p>
<p><img src="/pictures/ledcube/3x3x3_start_sm.jpg" alt="3x3 led matrix building" /></p>
<p>It didn&#8217;t take very long to toss three of these nine led matrices together.  Assembling them into a twenty-seven led cube was a bit trickier.  I used some gator clips to hold parts of the cube while I soldered it.  Eventually I finished all the connections and had a passable cube with fairly even spacing.</p>
<p><img src="/pictures/ledcube/3x3x3_finished_sm.jpg" alt="3x3x3 led cube finished" /></p>
<p>Assembling the matrix is a pretty straight forward task.  All you really do is tie all the cathodes together.  Each matrix will become one row in the finished cube.  Electrically, the cube is built as a 3&#215;9 array, three rows and nine columns.  You could probably build it the other way around, anode rows and cathode columns, but it is easier to sink a large current than source it.  I think the MAKE: software only lights one led at a time, since they&#8217;re relying on the microcontroller to both source and sink current.  My design is a bit different.  The mcu sources current to each anode column, and N channel fets sink current for the entire row.  The N channel is easily able to sink a few amps, so the cube can light an entire row at once without having to multiplex the individual leds.</p>
<p><a href="/pictures/ledcube/3x3x3_control_sch.png"><img src="/pictures/ledcube/3x3x3_control_sch_sm.png" alt="" /></a></p>
<p>In order to keep the PCB layout simple, the connections are spread all over the place in terms of the registers inside the pic.  It would have been cleaner to organize eight of the nine columns as a single 8bit register on the pic, leaving only one bit left over to deal with.  Instead, I&#8217;ve created symbols for each column, and set them individually from 9bit numbers.</p>
<p><img src="/pictures/ledcube/3x3x3_control_layout.png" alt="" /></p>
<p>Each anode column is current limited by a 75 ohm resistor.  The value chosen was rather arbitrary, since the leds have such a low duty cycle, a lower value would have afforded me more brightness when the cube is battery powered.  I can tweak the brightness a bit in the software, changing the scan rate the rows are multiplexed at.</p>
<p><img src="/pictures/ledcube/3x3x3_control_top_sm.jpg" alt="" /></p>
<p>That&#8217;s pretty much it.  I&#8217;ve found there&#8217;s not a lot you can do with only 3x3x3 and 1 color, but it&#8217;s still kind of fun.  Trying to think in three dimensions while drawing the animation frames is kind of tricky.  I started with excel, but that wasn&#8217;t very useful &#8211; I spent more time copy and pasting formulas than I did &#8216;drawing&#8217;.  Luckily my buddy Dan helped me out with that.  He whipped up an <a href="/cube/index.php" target="_new">awesome little php script</a> that lets you draw animations 27 leds at a time, and it formats the resulting numbers so I can copy and paste them right into the code.  </p>
<p>There&#8217;s a few videos of the cube doing various things on my <a href="http://www.youtube.com/justDIY">Youtube Channel</a>.  Here is perhaps the most interesting one so far.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/BqsCc2MNsTo&#038;ap=%2526fmt%3D18&#038;rel=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/BqsCc2MNsTo&#038;ap=%2526fmt%3D18&#038;rel=0" type="application/x-shockwave-flash" wmode="transparent" width="480" height="385"></embed></object></p>
<p>Thanks for reading, and Happy New Year!</p>
<img src="http://projects.dimension-x.net/?ak_action=api_record_view&id=114&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://projects.dimension-x.net/archives/114/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>LED Clock; Firmware taking shape</title>
		<link>http://projects.dimension-x.net/archives/108</link>
		<comments>http://projects.dimension-x.net/archives/108#comments</comments>
		<pubDate>Tue, 05 Jun 2007 19:52:20 +0000</pubDate>
		<dc:creator>justDIY</dc:creator>
				<category><![CDATA[Display]]></category>
		<category><![CDATA[Interface]]></category>
		<category><![CDATA[LEDs]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://projects.dimension-x.net/archives/108</guid>
		<description><![CDATA[The firmware for my LED Sign / Clock project is taking shape.  I&#8217;ve worked out my initial wishlist of features, and put together a basic menu structure.  I figured a menu is the  easiest way to access a lot of options, while only relying on two buttons. The basic menu consists of options for setting [...]]]></description>
			<content:encoded><![CDATA[<p>The firmware for my LED Sign / Clock project is taking shape.  I&#8217;ve worked out my initial wishlist of features, and put together a basic menu structure.  I figured a menu is the  easiest way to access a lot of options, while only relying on two buttons.</p>
<p>The basic menu consists of options for setting the time and date; minute, hour, day, date, month, year.   The basic options are pretty self explanatory.  I have also planned some more advanced options:</p>
<p>1. Adjustable display brightness &#8211; Varying the duty cycle and refresh rate of the matrix can effect its brightness.  I need to make a simple scale for these variances to allow for two or three brightness levels.</p>
<p>2. Adjustable scrolling speed &#8211; The program draws the same information several hundred times per &#8216;scroll&#8217;, changing this counter affects how fast the display appears to scroll.</p>
<p>3. Selectable time format &#8211; User can choose between 12 hour AM/PM time and 24 hours &#8216;Military&#8217; formats</p>
<p>4. Message Mode &#8211; User can enable / disable scrolling messages as well as display a single message, a random message or messages in sequence.</p>
<p>Other than that, the code is still pretty basic.  I&#8217;ve completed a bunch of internal fixes, like the scrolling code now handles messages of variable lengths. up to sixteen characters.  I&#8217;ve also created i2c eeprom reading routines to extract menu prompts and other text strings I&#8217;ve stored in the eeprom to save flash space on the chip.</p>
<img src="http://projects.dimension-x.net/?ak_action=api_record_view&id=108&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://projects.dimension-x.net/archives/108/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
