<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>wemakethings</title>
 <link href="http://wemakethings.net/atom.xml" rel="self"/>
 <link href="http://wemakethings.net"/>
 <updated>2013-05-18T18:37:14+03:00</updated>
 <id>http://wemakethings.net</id>
 <author>
   <name>The WMT folk</name>
   <email>wmt at this domain</email>
 </author>

 
 <entry>
   <title>dmx-dimmer 19-inch rack mount case</title>
   <link href="http://wemakethings.net/2013/05/18/dmx-dimmer-case"/>
   <updated>2013-05-18T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2013/05/18/dmx-dimmer-case</id>
   <content type="html">&lt;p&gt;I first thought of buying a pre-made 19-inch rack mount case, 3U high, 19 inches deep, but those were unavailable locally, and shipping such a large item would cost a fortune. Even if one was available, I&amp;#8217;d still have to cut out holes for screws and air vents, which would take too much time.&lt;/p&gt;

&lt;p&gt;Instead, &lt;em&gt;pwf&lt;/em&gt; suggested I order a custom-made one, cut out with a water jet and folded at a shop that specialises in doing just that.&lt;/p&gt;

&lt;p&gt;The shop needed an AutoCAD .dawg file for their machines. I don&amp;#8217;t have AutoCAD, so used &lt;a href='http://free-cad.sourceforge.net/'&gt;FreeCAD&lt;/a&gt; instead. It went better than &lt;a href='/2012/12/06/merry-go-round/'&gt;last time&lt;/a&gt;, especially since this time I used its sketch feature and constraints a-la SolidWorks.&lt;/p&gt;

&lt;p&gt;But it doesn&amp;#8217;t export directly to .dwg, only .dxf. &lt;a href='http://www.draftsight.com/'&gt;Draftsight&lt;/a&gt; can handle both, though, so I exported to .dxf in FreeCAD, imported that in Draftsight, moved things around to coloured layers, exported to .dwg and sent the file to the shop. A little convoluted, sure. The files are available &lt;a href='https://github.com/rxdtxd/rack3u/'&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The shop didn&amp;#8217;t quite do it by-the drawing, since I didn&amp;#8217;t include a 3D view of what I was expecting. (DraftSight is essentially AutoCAD for 2D, at least the free version.) Also, I made some poor design choices in my drawing, so there was more work to do on the case than initially anticipated.&lt;/p&gt;

&lt;p&gt;First, I didn&amp;#8217;t specify the bending radii, and didn&amp;#8217;t account for the thickness (1 mm) of the sheet metal in the cutout. Then, I went for the bottom-and-four-sides being one piece, instead of bottom-and-two-sides, so the shop couldn&amp;#8217;t fold the box perfectly. I had to align it up before welding two adjacent sides.&lt;/p&gt;

&lt;p&gt;Also note that had I gone the bottom-and-two-sides + top-and-two-sides route, no welding would have been necessary. Maybe I&amp;#8217;ll fix that in some future revision of the drawing, if I ever need a 19&amp;#8221; rack again.&lt;/p&gt;

&lt;p&gt;&lt;img alt='A large clamp for initial alignment' src='/assets/images/2013.05.18-1-clamp.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Sheet metal doesn&amp;#8217;t dissipate heat so well. To prevent warpage, I clamped in a brass &amp;#8220;heatsink&amp;#8221; on the backside:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Two clamps holding a brass piece at a corner' src='/assets/images/2013.05.18-2-clamp.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Clamps are good arm rests, too:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Using a clamp for very comfortable' src='/assets/images/2013.05.18-3-clamp-hand-rest.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I also didn&amp;#8217;t include two mounting brackets for the DIN rail holding the circuit breakers, so had to hammer those out and plug-weld them from the front side of the case:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Brackets inside the case to attach a din rail with circuit breakers' src='/assets/images/2013.05.18-4-din-rail-brackets.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Then, I forgot to include screw holes for the top, so had to drill and tap those. Here&amp;#8217;s how it looks:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Case with top lid' src='/assets/images/2013.05.18-5-case.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Bent a few pieces of 6 mm rod, tapped their ends, cut out a front plate from 2 mm sheet metal, drilled two pairs of holes on either side and welded the rods in as handles. Also drilled a two pairs of holes for the rack mounting screws, and cut out rectangular pieces for the front panel stuff:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Front plate, showing how the handles attach it to the case' src='/assets/images/2013.05.18-6-panel-with-handles.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Cleaned the case, covered in primer, painted black. Got no photos of that.&lt;/p&gt;

&lt;p&gt;Mounted the electonics inside. The bottom looks screwed:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Bottom of the case' src='/assets/images/2013.05.18-7-bottom.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Those rectangular holes are for air flow, they&amp;#8217;re right beneath the triacs&amp;#8217; heatsinks.&lt;/p&gt;

&lt;p&gt;&lt;img alt='All modules mounted in case, the wires still a mess' src='/assets/images/2013.05.18-8-wires-mess.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The wires were a mess, tidied them up with zip-ties, attached to these neat little adhesive zip-tie holders:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Wires tidied up with zip ties' src='/assets/images/2013.05.18-9-wires-tidy.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The original Sherlock Holmes Pipe is included for size comparison.&lt;/p&gt;

&lt;p&gt;That&amp;#8217;s almost it! Once I get to run a final power test, with the top lid screwed in place, I&amp;#8217;ll do a final rant, promise to update the schematics, PCB layout and case drawing, conveniently forget all of that, and move on to other extremely time-consuming stuff.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>dmx-dimmer power tests</title>
   <link href="http://wemakethings.net/2013/04/13/dmx-dimmer-power-tests"/>
   <updated>2013-04-13T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2013/04/13/dmx-dimmer-power-tests</id>
   <content type="html">&lt;p&gt;&lt;a href='/2013/03/03/winding-chokes-for-the-dmx-dimmer/'&gt;Last time&lt;/a&gt; I mentioned the chokes were buzzing too much, so I&amp;#8217;d have to dip them in epoxy. Doing that helped somewhat with the noise, and I expect it to be a non-issue once they&amp;#8217;re in a closed case.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Three slaves without heatsinks, with chokes covered in epoxy' src='/assets/images/2013.04.13-chokes_in_epoxy.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;It took me a few days or so to wire it all up &amp;#8211; stripping wires, checking the power cable, yada-yada.&lt;/p&gt;

&lt;p&gt;I couldn&amp;#8217;t run it at full-power just yet. Software was being non-cooperative. Previously, I&amp;#8217;ve tested the system with the master and just one slave. Now, with three slaves connected, there were conflicts. One of them was all the slaves using the same physical OK line. (After the master sends an interrupt, the slave uses that to signal it&amp;#8217;s ready to receive data.) How silly of me. Luckily, there were still some unused pins on the master board, so I didn&amp;#8217;t have to invent a yet another multiplexer, and just use separate OK lines. It&amp;#8217;s all in the &lt;a href='https://github.com/rxdtxd/dmx-dimmer'&gt;code&lt;/a&gt; now, and the schematic, too, but I haven&amp;#8217;t propagated it to the PCB (as of this writing).&lt;/p&gt;

&lt;p&gt;That didn&amp;#8217;t fix another problem: the master locking up, as if all slaves were receiving an interrupt, even though separate lines have always been used for that. After a few days of bewilderment, I decided to do the one thing which is known to solve issues almost universally. Namely, get drunk.&lt;/p&gt;

&lt;p&gt;The hangover helped me in looking over the design calmly and realising that, although the interrupt lines are separate, the Master-In-Slave-Out is connected to all three slaves, and they are not in Hi-Z state by default. There is no reason for the master to receive data from slaves, really, other than verifying the slave is functional. But rather than disconnecting the MISO line, I fixed it in software.&lt;/p&gt;

&lt;p&gt;After that, I was finally able to run the full-power tests. The heatsink goes to 50 °C in half an hour, and stays that way, with 8 kW (4 channels set at 100%). Triacs&amp;#8217; package was 5-10 °C above that. So with heatsinks as big as these, I might not even need a fan in the case, alhough that is yet to be proven.&lt;/p&gt;

&lt;p&gt;&lt;img alt='45 degrees celsius on the heatsink' src='/assets/images/2013.04.13-45_deg.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Still there were 3 more things to do with software:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DMX address selection &amp;#8211; turned out two address lines got accidentally swapped; fixed in software, not fixed in hardware;&lt;/li&gt;

&lt;li&gt;setting preheat an maximum value &amp;#8211; involved mucking with ADC multiplexing, and I eventually convinced myself this is &lt;em&gt;not&lt;/em&gt; needed at all, and should be handled by the lighting console anyway; the UNIX philosophy works in hardware, too: do one thing and do it well (well, try at least);&lt;/li&gt;

&lt;li&gt;setting a light curve &amp;#8211; chopping a sinusoid&amp;#8217;s half-period in 256 equal parts means the lower and upper percentage changes give a small delta in output power, whereas the middle is rather sensitive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last one is rather important, and I thought it could be solved by chopping the half-period in non-equal parts. That didn&amp;#8217;t work: either the timer interrupt routine wasn&amp;#8217;t fast enough, or you can&amp;#8217;t really change a timer&amp;#8217;s TOP value while the timer is running in CTC mode. Turning the timer off, changing the TOP and then turning it back on helped, but it introduced an unacceptable lag. Modifying the timer value to accomodate the lag sounds like too much guesswork. Bored with the project by now, I decided not to implement this feature.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a dirty Python script I used to generate the timer&amp;#8217;s values. Note that a 16 bit timer is required with these if no prescaling is used.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='python'&gt;&lt;span class='c'&gt;#!/usr/bin/env python&lt;/span&gt;

&lt;span class='kn'&gt;import&lt;/span&gt; &lt;span class='nn'&gt;math&lt;/span&gt;

&lt;span class='n'&gt;a&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;
&lt;span class='n'&gt;b&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;
&lt;span class='c'&gt;# tmp = 0&lt;/span&gt;
&lt;span class='n'&gt;step&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mf'&gt;2.0&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='mi'&gt;256&lt;/span&gt;
&lt;span class='n'&gt;durzc&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[]&lt;/span&gt;   &lt;span class='c'&gt;# duration (total time) passed from zero crossing&lt;/span&gt;
&lt;span class='n'&gt;delays&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[]&lt;/span&gt;  &lt;span class='c'&gt;# duration between two durzc values&lt;/span&gt;
&lt;span class='n'&gt;cycles&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mf'&gt;6000000.0&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;2&lt;/span&gt;&lt;span class='o'&gt;*&lt;/span&gt;&lt;span class='mi'&gt;50&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;  &lt;span class='c'&gt;# cycles between two zero crossings&lt;/span&gt;

&lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;n&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='nb'&gt;range&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mi'&gt;255&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
    &lt;span class='n'&gt;b&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;math&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;acos&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;math&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;cos&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;a&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='n'&gt;step&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='c'&gt;# print(n, a, b)  # debug&lt;/span&gt;
    &lt;span class='n'&gt;durzc&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;append&lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='n'&gt;b&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='n'&gt;math&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;pi&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='o'&gt;*&lt;/span&gt; &lt;span class='n'&gt;cycles&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
    &lt;span class='n'&gt;a&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;b&lt;/span&gt;

&lt;span class='n'&gt;durzc&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;append&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mf'&gt;1.0&lt;/span&gt; &lt;span class='o'&gt;*&lt;/span&gt; &lt;span class='n'&gt;cycles&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;
&lt;span class='c'&gt;# print(durzc)  # debug&lt;/span&gt;

&lt;span class='n'&gt;delays&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;append&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;durzc&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;])&lt;/span&gt;
&lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;n&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='nb'&gt;range&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='mi'&gt;256&lt;/span&gt;&lt;span class='p'&gt;):&lt;/span&gt;
    &lt;span class='n'&gt;delays&lt;/span&gt;&lt;span class='o'&gt;.&lt;/span&gt;&lt;span class='n'&gt;append&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;durzc&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;n&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt; &lt;span class='o'&gt;-&lt;/span&gt; &lt;span class='n'&gt;durzc&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;n&lt;/span&gt;&lt;span class='o'&gt;-&lt;/span&gt;&lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;])&lt;/span&gt;
&lt;span class='n'&gt;delays&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='nb'&gt;round&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;x&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='k'&gt;for&lt;/span&gt; &lt;span class='n'&gt;x&lt;/span&gt; &lt;span class='ow'&gt;in&lt;/span&gt; &lt;span class='n'&gt;delays&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt;
&lt;span class='k'&gt;print&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;delays&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt;

&lt;span class='c'&gt;# for n in range(0,256):&lt;/span&gt;
&lt;span class='c'&gt;#     tmp += delays[n]&lt;/span&gt;
&lt;span class='c'&gt;# print(tmp)  # debug&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Its output, slightly formatted:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[2389, 992, 762, 644, 569, 515, 475, 443,
417, 395, 376, 360, 346, 334, 323, 313,
304, 296, 288, 281, 275, 269, 264, 258,
254, 249, 245, 241, 237, 234, 230, 227,
224, 221, 218, 216, 213, 211, 209, 207,
204, 202, 201, 199, 197, 195, 194, 192,
190, 189, 187, 186, 185, 183, 182, 181,
180, 179, 178, 177, 176, 175, 174, 173,
172, 171, 170, 169, 169, 168, 167, 166,
166, 165, 164, 164, 163, 162, 162, 161,
161, 160, 160, 159, 159, 158, 158, 157,
157, 156, 156, 156, 155, 155, 155, 154,
154, 154, 153, 153, 153, 153, 152, 152,
152, 152, 151, 151, 151, 151, 151, 150,
150, 150, 150, 150, 150, 150, 150, 150,
149, 149, 149, 149, 149, 149, 149, 149,
149, 149, 149, 149, 149, 149, 149, 149,
150, 150, 150, 150, 150, 150, 150, 150,
150, 151, 151, 151, 151, 151, 152, 152,
152, 152, 153, 153, 153, 153, 154, 154,
154, 155, 155, 155, 156, 156, 156, 157,
157, 158, 158, 159, 159, 160, 160, 161,
161, 162, 162, 163, 164, 164, 165, 166,
166, 167, 168, 169, 169, 170, 171, 172,
173, 174, 175, 176, 177, 178, 179, 180,
181, 182, 183, 185, 186, 187, 189, 190,
192, 194, 195, 197, 199, 201, 202, 204,
207, 209, 211, 213, 216, 218, 221, 224,
227, 230, 234, 237, 241, 245, 249, 254,
258, 264, 269, 275, 281, 288, 296, 304,
313, 323, 334, 346, 360, 376, 395, 417,
443, 475, 515, 569, 644, 762, 992, 2389]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And, finally, the whole thing, all wired and waiting for a case:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Dimmer completely wired, still on the cardboard' src='/assets/images/2013.04.13-wired.jpg' /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Welding a Palm Sunday bouquet</title>
   <link href="http://wemakethings.net/2013/03/09/welding-a-palm-sunday-bouquet"/>
   <updated>2013-03-09T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/03/09/welding-a-palm-sunday-bouquet</id>
   <content type="html">&lt;p&gt;A &lt;a href='https://en.wikipedia.org/wiki/Easter_palm'&gt;&amp;#8216;Palm Sunday bouquet&amp;#8217;&lt;/a&gt;, an &amp;#8216;Easter palm&amp;#8217;, &lt;em&gt;&amp;#8216;verba&amp;#8217;&lt;/em&gt; or &lt;em&gt;&amp;#8216;Palma wielkanocna&amp;#8217;&lt;/em&gt; is a Lithuanian/Polish contraption used by local Catholics for Easter rituals. Since no palm trees grow here, people started making their own out of willow and juniper branches, dried herbs and flowers and other stuff. They are, as a rule, ugly dust collectors (the bouquets).&lt;/p&gt;

&lt;p&gt;Several years ago I thought about welding them from junk and putting them up for sale during a spring fair, simply for fun. Now, I couldn&amp;#8217;t weld two things together without melting half of the planet, but &lt;em&gt;pwf&lt;/em&gt; can and so he made an Easter palm out of old cutlery we had around. Just for the sake of implementing the idea.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Easter palm1' src='/assets/images/2013-03-09-palm1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;He washed away the old fat and dust, then cut off the plastic handles and welded spoons/knifes/forks together with a TIG welder. There was also a selling story about Lithuanian bridal customs and killing wild elks with a &lt;em&gt;verba&lt;/em&gt;, but it was lost during a period of inebriation that followed.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Winding chokes for the dmx-dimmer</title>
   <link href="http://wemakethings.net/2013/03/03/winding-chokes-for-the-dmx-dimmer"/>
   <updated>2013-03-03T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/03/03/winding-chokes-for-the-dmx-dimmer</id>
   <content type="html">&lt;p&gt;It&amp;#8217;s that time of the year again, and I&amp;#8217;ve been working these past few weeks on the dmx-dimmer project: putting it together on a piece of cardboard a-la science fair, re-designing the power dimmer module, and running power tests.&lt;/p&gt;

&lt;p&gt;&lt;a href='/2012/04/09/dmx-dimmer-ready-for-testing/'&gt;Last visit&lt;/a&gt; I mentioned winding my own chokes (inductors). These will be used for rush current suppression in the power line, so they need not be precise and uniform.&lt;/p&gt;

&lt;p&gt;We salvage ferrites among other things, and there was enough wire laying around. If I had to buy either of these, doin&amp;#8217; it myself would&amp;#8217;ve been more expensive that buying pre-made ones &amp;#8211; provided, of course, the local shop carries them at all.&lt;/p&gt;

&lt;p&gt;Anyway, I started out by smoothing the straight edges on my ferrites, otherwise laquer on the wires would&amp;#8217;ve gotten damaged during bending, which means spark gaps. Used a small round file for the first one, but it took too long, so switched to a hand-held rotary tool with a sanding stone drillbit. On the image below, the smoothed toroid is on the right.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Toroidal ferrite cores' src='/assets/images/2013.03.03-1-ferrite_cores.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Then I cut two pieces of 1 mm copper wire, both 90 cm long (determined by trial). I removed laquer on their ends using sand paper, since none of the solvents we had on hand worked. &lt;em&gt;ioch&lt;/em&gt; speculated it could be done in boiling base, but we haven&amp;#8217;t tried that.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Core in a vise, two copper wires with laquer stripped at the ends' src='/assets/images/2013.03.03-2-core_and_clean_wires.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I clamp the ferrite in a vise with some padding, put a pair of straigtened wires through the hole and, well, start winding. This requires both hands to constantly press the wire to the ferrite, keep gaps as small as possible, prevent wire arcing and bending, get equal spacing and many other things that take many other words to describe.&lt;/p&gt;

&lt;p&gt;If you intend doing something like this, I suggest practice first. There&amp;#8217;s nothing about chokes but getting the hang of it.&lt;/p&gt;

&lt;p&gt;&lt;img alt='A core is a vise with double wire wrapped halfway around the toroid' src='/assets/images/2013.03.03-3-choke_half_wound.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;After one half is done, turn it around in the vise. Ideally, it should be perfectly symmetric when finished. In practice, one of my first chokes looked something like this:&lt;/p&gt;

&lt;p&gt;&lt;img alt='A finished choke on graph paper' src='/assets/images/2013.03.03-4-choke_wound.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Not too bad, really.&lt;/p&gt;

&lt;p&gt;Before I solder them into the boards, I decided to check if any laquer got damaged after all, and see if they burn. So I cut them into the phase line of the mains, one at a time:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Choke in series with mains' src='/assets/images/2013.03.03-5-choke_temp_measure.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;On the other end sits a 2 kW load of light fixtures. The chokes heat up to 40 °C. The blown socket in the picture above is from an unrelated experiment.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve also tested one with the new dimmer module, and it works, but noisily (as in sound). Which means I&amp;#8217;ll be dipping them into epoxy.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Three populated slave boards, a dozen chokes and one 4-channel dimmer board, populated except for a few headers and the chokes' src='/assets/images/2013.03.03-6-results.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;In the image above, from bottom to top: three populated slave boards; a dozen chokes; and one 4-channel dimmer board, missing a few caps, a few headers, and the inductors, of course.&lt;/p&gt;

&lt;p&gt;As always, all &lt;a href='https://github.com/rxdtxd/dmx-dimmer'&gt;design files are available on GitHub&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>How does an ADC work?</title>
   <link href="http://wemakethings.net/2013/02/25/how-does-adc-work"/>
   <updated>2013-02-25T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/02/25/how-does-adc-work</id>
   <content type="html">&lt;p&gt;This is a little experiment on how does a SAR ADC work.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='true' frameborder='0' height='315' src='http://www.youtube.com/embed/VpfKXuaalJo' width='420'&gt;e&lt;/iframe&gt;&lt;/center&gt;
&lt;p&gt;A register, a DAC, a comparator and some control logic make an ADC. To perform a conversion, a binary search is performed. Bits in the register are turned on consecutevely from most significant bit to least significant one. If the voltage at the DAC output is higher than the voltage ADC is digitizing, the bit is turned off, if it&amp;#8217;s lower, the bit is left on.&lt;/p&gt;

&lt;p&gt;What I don&amp;#8217;t mention in the video is how accuracy of resistors is important and how different kinds of errors creep in, but it&amp;#8217;s a very broad topic on itself. Suffice to say that resistors should be as accurate as possible to get a linear response with low offset and gain errors.&lt;/p&gt;

&lt;p&gt;One more thing to mention is that usually there is a so called &amp;#8220;sample and hold&amp;#8221; capacitor at the &amp;#8220;unknown voltage&amp;#8221; input of ADC where the voltage is sampled before the conversion so that rapidly changing input does not affect the reading.&lt;/p&gt;

&lt;p&gt;This is schematic and Arduino code if someone wants to try it themselves.&lt;/p&gt;

&lt;p&gt;&lt;img alt='adc schematic' src='/assets/images/2013-02-25-adc-schematic.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='adc breadboard' src='/assets/images/2013-02-15-adc-breadboard.jpg' /&gt;&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='c'&gt;&lt;span class='cp'&gt;#define COMPARATOR 8&lt;/span&gt;
&lt;span class='cp'&gt;#define BUTTON 9&lt;/span&gt;

&lt;span class='cm'&gt;/* button states */&lt;/span&gt;
&lt;span class='cp'&gt;#define PRESSED 1&lt;/span&gt;
&lt;span class='cp'&gt;#define MAYBE_PRESSED 2&lt;/span&gt;
&lt;span class='cp'&gt;#define RELEASED 3&lt;/span&gt;
&lt;span class='cp'&gt;#define MAYBE_RELEASED 4&lt;/span&gt;
&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;RELEASED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;lastButtonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;RELEASED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='cm'&gt;/* the mask bit we are shifting each step */&lt;/span&gt;
&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;mask&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b10000000&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

&lt;span class='kt'&gt;void&lt;/span&gt; &lt;span class='nf'&gt;setup&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='n'&gt;DDRD&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mh'&gt;0xFF&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//port D set to output (digital outputs 0 to 7)&lt;/span&gt;
  &lt;span class='n'&gt;PORTD&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;   &lt;span class='c1'&gt;//all bits off&lt;/span&gt;
  &lt;span class='n'&gt;pinMode&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;COMPARATOR&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;INPUT&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='n'&gt;pinMode&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;BUTTON&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;INPUT&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='n'&gt;digitalWrite&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;BUTTON&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;HIGH&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt; &lt;span class='c1'&gt;//turn a puu up for a button on&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='kt'&gt;void&lt;/span&gt; &lt;span class='nf'&gt;loop&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='n'&gt;PORTD&lt;/span&gt; &lt;span class='o'&gt;|=&lt;/span&gt; &lt;span class='n'&gt;mask&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//turn on one bit&lt;/span&gt;
  &lt;span class='k'&gt;while&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='n'&gt;buttonPress&lt;/span&gt;&lt;span class='p'&gt;()){&lt;/span&gt; &lt;span class='c1'&gt;//wait for the button press for demo purposes&lt;/span&gt;
    &lt;span class='c1'&gt;//NOTHING&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;LOW&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;digitalRead&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;COMPARATOR&lt;/span&gt;&lt;span class='p'&gt;))&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='n'&gt;PORTD&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;=&lt;/span&gt; &lt;span class='o'&gt;~&lt;/span&gt;&lt;span class='n'&gt;mask&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//if comparator turns on, turn off the bit&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='n'&gt;mask&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;mask&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//shift for next bit&lt;/span&gt;
  
  &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;mask&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;while&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='n'&gt;buttonPress&lt;/span&gt;&lt;span class='p'&gt;()){&lt;/span&gt;
      &lt;span class='c1'&gt;//NOTHING&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='n'&gt;mask&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b10000000&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='n'&gt;PORTD&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;while&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='o'&gt;!&lt;/span&gt;&lt;span class='n'&gt;buttonPress&lt;/span&gt;&lt;span class='p'&gt;()){&lt;/span&gt;
      &lt;span class='c1'&gt;//NOTHING&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;

&lt;span class='cm'&gt;/* button debouncing routine */&lt;/span&gt;
&lt;span class='n'&gt;boolean&lt;/span&gt; &lt;span class='nf'&gt;buttonPress&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;button&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;digitalRead&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;BUTTON&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='k'&gt;switch&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;buttonState&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;case&lt;/span&gt; &lt;span class='n'&gt;MAYBE_PRESSED&lt;/span&gt;:
      &lt;span class='n'&gt;delay&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
      &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;LOW&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;button&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PRESSED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;else&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;RELEASED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt;
      &lt;span class='k'&gt;break&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;case&lt;/span&gt; &lt;span class='n'&gt;PRESSED&lt;/span&gt;:
      &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;HIGH&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;button&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;MAYBE_RELEASED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt;
      &lt;span class='k'&gt;break&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;case&lt;/span&gt; &lt;span class='n'&gt;MAYBE_RELEASED&lt;/span&gt;:
      &lt;span class='n'&gt;delay&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
      &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;HIGH&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;button&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;RELEASED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;else&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PRESSED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt;
      &lt;span class='k'&gt;break&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='k'&gt;case&lt;/span&gt; &lt;span class='n'&gt;RELEASED&lt;/span&gt;:
      &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;LOW&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;button&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;MAYBE_PRESSED&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt;
      &lt;span class='k'&gt;break&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;
  &lt;span class='n'&gt;boolean&lt;/span&gt; &lt;span class='n'&gt;ret&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;lastButtonState&lt;/span&gt; &lt;span class='o'&gt;!=&lt;/span&gt; &lt;span class='n'&gt;buttonState&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class='n'&gt;PRESSED&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;buttonState&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='n'&gt;lastButtonState&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;buttonState&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

  &lt;span class='k'&gt;return&lt;/span&gt; &lt;span class='n'&gt;ret&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Near Earth objects impact probabilities</title>
   <link href="http://wemakethings.net/2013/02/22/neo-impact-probabilities"/>
   <updated>2013-02-22T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/02/22/neo-impact-probabilities</id>
   <content type="html">&lt;p&gt;&lt;a href='http://www.astronomynotes.com/solfluf/s5.htm'&gt;Collisions with rocks from space&lt;/a&gt; are hot news these days. &lt;em&gt;rxdtxd&lt;/em&gt; posted the link to &lt;a href='http://neo.ssa.esa.int/web/guest/risk-page'&gt;ESA Near Earth Objects risk table&lt;/a&gt;, I started playing with it since it was a new shiny distraction, and because we are quite oblivious to what the raw data has to say.&lt;/p&gt;

&lt;p&gt;Humans are rather incapable at internalising numbers &amp;#8211; we did not evolve to manage risks rationally. We skim over tables with horrifying observations (say, ocean acidification) and shrug, but duck and run from a tiger-shaped bush, because it suddenly seems so urgent and personal.&lt;/p&gt;

&lt;p&gt;&lt;img alt='ESA log probabilities' src='/assets/images/2013-02-22-esa_probs.png' /&gt;&lt;/p&gt;

&lt;p&gt;These are logarithms of impact probabilities over the next 100 years or so, based on ESA data. Sizes of dots are proportional to volumes of meteorites (&lt;a href='https://en.wikipedia.org/wiki/Spherical_cow'&gt;assuming they are spherical&lt;/a&gt;): the largest one corresponds to &lt;a href='http://neo.ssa.esa.int/web/guest/search-for-objects?sum=1&amp;amp;des=2010AU118'&gt;2010AU118&lt;/a&gt;, a 1200 m diameter rock that&amp;#8217;s supposed to fly nearby sometime in 2015. The smallest object in the sample is 2 meters across.&lt;/p&gt;

&lt;p&gt;NASA also maintains &lt;a href='http://neo.jpl.nasa.gov/risk/'&gt;its impact risk table&lt;/a&gt;, without any machine-friendly download options, however. &lt;em&gt;rxdtxd&lt;/em&gt;, being a very technical boy, used a &lt;a href='https://github.com/rxdtxd/asterisks/blob/master/chewnasa.sh'&gt;tangle of regexps&lt;/a&gt; to parse it (I&amp;#8217;d have gone with &lt;a href='http://www.crummy.com/software/BeautifulSoup/'&gt;the Beautiful Soup&lt;/a&gt;, as I&amp;#8217;m lazy). Some of the objects in these tables match.&lt;/p&gt;

&lt;p&gt;The NASA table is curious: they do not provide possible impact dates, only intervals when an object might be of any danger. And they probably calculate impact probabilities in a different way than ESA. I used the middle year of those intervals as a possible impact date in the following plot, which throws the NASA and ESA data together.&lt;/p&gt;

&lt;p&gt;&lt;img alt='ESA and NASA log probabilities' src='/assets/images/2013-02-22-probs_nasa_esa.png' /&gt;&lt;/p&gt;

&lt;p&gt;A possibility of an impact tells us pretty nothing: the consequences depend on the atmospheric entry angle, composition and velocity of the object, impact location (water or rock), etc. (I didn&amp;#8217;t know before that asteroids can &lt;a href='http://www.phys.ncku.edu.tw/~astrolab/mirrors/apod_e/ap090302.html'&gt;graze Earth&amp;#8217;s atmosphere and fly away&lt;/a&gt;). I couldn&amp;#8217;t find the exact energy yield equations during a quick browse-around, but here are a few &lt;a href='http://impact.ese.ic.ac.uk/ImpactEffects/'&gt;more&lt;/a&gt; or &lt;a href='http://janus.astro.umd.edu/astro/impact/'&gt;less&lt;/a&gt; serious calculators and &lt;a href='http://articles.adsabs.harvard.edu//full/1958IrAJ....5...14O/0000021.000.html'&gt;an article by E. Oepik from 1958&lt;/a&gt;. He was an Estonian astronomer way ahead of his time. We are actually quoting his letter on galaxy inclinations from &lt;strong&gt;1923&lt;/strong&gt; in one of our scholarly papers!&lt;/p&gt;

&lt;p&gt;Both NASA and ESA datasets offer two scales to evaluate the actual threats raised by near-Earth objects, that is, the &lt;a href='https://en.wikipedia.org/wiki/Torino_Scale'&gt;Torino&lt;/a&gt; and &lt;a href='http://en.wikipedia.org/wiki/Palermo_scale'&gt;Palermo&lt;/a&gt; scales, both combining impact probabilities and yields (kinetic energies). The former, I think, is for the mainstream media mainly &amp;#8211; it gives a convenient, quite subjective indication of level of concern warranted. Currently there is &lt;strong&gt;1&lt;/strong&gt; known object with a non-zero Torino scale rating.&lt;/p&gt;

&lt;p&gt;The Palermo scale is rather complex, but more objective: it denotes relative risks with respect to background. &lt;a href='http://neo.jpl.nasa.gov/risk/doc/palermo.html'&gt;Go read more about it here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img alt='ESA and NASA Palermo scale ratings' src='/assets/images/2013-02-22-nasa_esa_palermo.png' /&gt;&lt;/p&gt;

&lt;p&gt;The ESA and NASA Palermo ratings do not match, though they correlate: they must be calculating the impact probabilities differently, and NASA does not provide timing for separate impact events.&lt;/p&gt;

&lt;p&gt;If one sums up the impact probabilities, she gets 0.101-0.09 for ESA and NASA respectively. These are probabilities that we will be hit by an object we already know about. However, here&amp;#8217;s the cumulative probability chart for ESA data:&lt;/p&gt;

&lt;p&gt;&lt;img alt='ESA cumulative probabilities' src='/assets/images/2013-02-22-esa_cum_prob.png' /&gt;&lt;/p&gt;

&lt;p&gt;The gaps denote years that have no impact probability data, nevermind them. As you can see, the majority of that 0.101 probability is due to &lt;a href='http://neo.ssa.esa.int/web/guest/search-for-objects?sum=1&amp;amp;des=2010RF12'&gt;2010RF12&lt;/a&gt;, which is a 9 m diameter rock (&lt;a href='http://www.esa.int/Our_Activities/Operations/Russia_asteroid_impact_ESA_update_and_assessment'&gt;Chelyabinsk meteorite is assumed&lt;/a&gt; to be twice larger, although it entered at a very low angle). Which is to say, we&amp;#8217;ll probably will be hit by a similar-sized meteorite before RF12&amp;#8217;s presumed impact date (well, we were hit last week without any warning!).&lt;/p&gt;

&lt;p&gt;The following is rather speculative.&lt;/p&gt;

&lt;p&gt;I noticed that there is an overdensity of impact probabilities around 2080. The saying goes, &amp;#8216;if you don&amp;#8217;t know what to do with your data, do a Fourier transform&amp;#8217;. Since FT does not work well on unevenly-spaced data, I used &lt;a href='https://en.wikipedia.org/wiki/Least-squares_spectral_analysis'&gt;Lomb-Scargle analysis&lt;/a&gt; instead. Spectral analysis, such as L-S or Fourier analysis, is used in order to find any periodicities in time-series data, that is, finding dominant subcomponents of a signal, if there are any.&lt;/p&gt;

&lt;p&gt;&lt;img alt='LSSA periodogram' src='/assets/images/2013-02-22-lomb-scargle.png' /&gt;&lt;/p&gt;

&lt;p&gt;There might be a periodicity of ~37 years in the impact probabilities data, or it might be an artifact of rather short (~100 years) time interval available. It can be spurious, or maybe there is some orbital resonance with a group of NEOs.&lt;/p&gt;

&lt;p&gt;One reason for the higher number of probable impact events at the end of this century might be the fact that impact probabilities are initially given larger values, and then revised downwards. As we learn of a flyby of a space rock, we know about its orbit with some certainty, and some close encounters alter the orbit of the asteroid enough to warrant attention later. (If you&amp;#8217;re interested in what &lt;a href='http://spaceguard.rm.iasf.cnr.it/tumblingstone/issues/num20/eng/keyhole.htm'&gt;&amp;#8216;a keyhole&amp;#8217; is, start here&lt;/a&gt;.) So far, chances that a known small asteroid will come back are smaller than chances of being hit by an unknown rock.&lt;/p&gt;

&lt;p&gt;All code we used &lt;a href='https://github.com/astrolitterbox/Asteroids/'&gt;is here&lt;/a&gt;. I probably won&amp;#8217;t be bothered to make it tidy.&lt;/p&gt;

&lt;p&gt;Now the disclaimer: my research area is the galaxies and quasars. I know squat about the Solar System, except that Pluto is not a planet anymore. Don&amp;#8217;t panic, but don&amp;#8217;t throw away your Kalashnikov and the cans of condensed milk yet.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Stepper motors as rotary encoders</title>
   <link href="http://wemakethings.net/2013/02/18/steppers-as-rotary-encoders"/>
   <updated>2013-02-18T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/02/18/steppers-as-rotary-encoders</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve spent some time playing around the idea of using stepper or brushless motors as rotary encoders.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='true' frameborder='0' height='315' src='http://www.youtube.com/embed/K_WDn_PbUO0' width='420'&gt;e&lt;/iframe&gt;&lt;/center&gt;
&lt;p&gt;Stepper acts as a high impedance AC voltage source outputing sinusoidal waveform, it&amp;#8217;s just a matter of apmlifying and converting this signal to a square wave:&lt;/p&gt;

&lt;p&gt;&lt;img alt='schematics' src='/assets/images/2013-02-18-stepper-encoder-schematics.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;R1 and R2 set up a reference voltage, R3 and C2 low-pass filter the signal from a motor - when this signal goes above the reference voltage, comparator changes it&amp;#8217;s output producing a nice square wave.&lt;/p&gt;

&lt;p&gt;The same effect can be obtained using a high gain noninverting op amp circuit, but as opamps are not really ment to be operated in saturation regions, I&amp;#8217;ve decided to go with a comparator.&lt;/p&gt;

&lt;p&gt;You have to do this to two phases of a stepper motor - one phase will lag the other - this way you can determine a direction of rotation.&lt;/p&gt;

&lt;p&gt;Here is a piece of arduinized avr code that reads the encoder and drives a single digit 7 segment display:&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='c'&gt;&lt;span class='kt'&gt;void&lt;/span&gt; &lt;span class='nf'&gt;setup&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='n'&gt;DDRD&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mh'&gt;0xFF&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;&lt;span class='c1'&gt;//setup port D as ouput for 7-seg display&lt;/span&gt;
  &lt;span class='n'&gt;pinMode&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;8&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;INPUT&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;&lt;span class='c1'&gt;//motor phase 1 on PORTC 0&lt;/span&gt;
  &lt;span class='n'&gt;pinMode&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;9&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt; &lt;span class='n'&gt;INPUT&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;&lt;span class='c1'&gt;//motor phase 2 on PORTC 1&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;


&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;digits&lt;/span&gt;&lt;span class='p'&gt;[]&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b00000011&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//0&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b11110011&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//1&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b10000101&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//2&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b00001101&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//3&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b00111001&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//4&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b01001001&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//5&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b01000001&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//6&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b00011111&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//7&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b00000001&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//8&lt;/span&gt;
  &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='n'&gt;b00001001&lt;/span&gt;&lt;span class='p'&gt;,&lt;/span&gt;&lt;span class='c1'&gt;//9&lt;/span&gt;
&lt;span class='p'&gt;};&lt;/span&gt;

&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;t&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//step counter&lt;/span&gt;
&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;lastVal&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//last value of motor phase inputs&lt;/span&gt;
&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;b&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//segment which is displayed&lt;/span&gt;
&lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;digit&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt; &lt;span class='c1'&gt;//digit that is displayed&lt;/span&gt;

&lt;span class='kt'&gt;void&lt;/span&gt; &lt;span class='nf'&gt;loop&lt;/span&gt;&lt;span class='p'&gt;()&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
  &lt;span class='c1'&gt;//flash one segment every loop&lt;/span&gt;
  &lt;span class='n'&gt;PORTD&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;digits&lt;/span&gt;&lt;span class='p'&gt;[&lt;/span&gt;&lt;span class='n'&gt;digit&lt;/span&gt;&lt;span class='p'&gt;]&lt;/span&gt; &lt;span class='o'&gt;|&lt;/span&gt; &lt;span class='o'&gt;~&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mh'&gt;0x01&lt;/span&gt; &lt;span class='o'&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class='n'&gt;b&lt;/span&gt;&lt;span class='p'&gt;);&lt;/span&gt;
  &lt;span class='n'&gt;b&lt;/span&gt;&lt;span class='o'&gt;++&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;b&lt;/span&gt; &lt;span class='o'&gt;&amp;gt;&lt;/span&gt; &lt;span class='mi'&gt;7&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='n'&gt;b&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;1&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;

  &lt;span class='c1'&gt;//read status of motor pins  &lt;/span&gt;
  &lt;span class='n'&gt;byte&lt;/span&gt; &lt;span class='n'&gt;val&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;PINB&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&lt;/span&gt; &lt;span class='mh'&gt;0x03&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;

  &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='n'&gt;val&lt;/span&gt; &lt;span class='o'&gt;!=&lt;/span&gt; &lt;span class='n'&gt;lastVal&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
    &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='n'&gt;val&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mi'&gt;3&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class='n'&gt;lastVal&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mi'&gt;2&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
      &lt;span class='c1'&gt;//t is just a step counter, we change the digit every 3 steps&lt;/span&gt;
      &lt;span class='n'&gt;t&lt;/span&gt;&lt;span class='o'&gt;++&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
      &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;4&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;t&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='n'&gt;t&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='n'&gt;digit&lt;/span&gt;&lt;span class='o'&gt;++&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;10&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;digit&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
          &lt;span class='n'&gt;digit&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;0&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
      &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt; &lt;span class='k'&gt;else&lt;/span&gt; &lt;span class='k'&gt;if&lt;/span&gt; &lt;span class='p'&gt;((&lt;/span&gt;&lt;span class='n'&gt;val&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mi'&gt;2&lt;/span&gt; &lt;span class='o'&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class='n'&gt;lastVal&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='mi'&gt;3&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
        &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;t&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
          &lt;span class='n'&gt;t&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;4&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
          &lt;span class='k'&gt;if&lt;/span&gt;&lt;span class='p'&gt;(&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt; &lt;span class='o'&gt;==&lt;/span&gt; &lt;span class='n'&gt;digit&lt;/span&gt;&lt;span class='p'&gt;)&lt;/span&gt; &lt;span class='p'&gt;{&lt;/span&gt;
            &lt;span class='n'&gt;digit&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='mi'&gt;10&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
          &lt;span class='p'&gt;}&lt;/span&gt;
          &lt;span class='n'&gt;digit&lt;/span&gt; &lt;span class='o'&gt;--&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
        &lt;span class='p'&gt;}&lt;/span&gt;
        &lt;span class='n'&gt;t&lt;/span&gt;&lt;span class='o'&gt;--&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
    &lt;span class='p'&gt;}&lt;/span&gt;
    &lt;span class='n'&gt;lastVal&lt;/span&gt; &lt;span class='o'&gt;=&lt;/span&gt; &lt;span class='n'&gt;val&lt;/span&gt;&lt;span class='p'&gt;;&lt;/span&gt;
  &lt;span class='p'&gt;}&lt;/span&gt;
&lt;span class='p'&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Auto-off bike light</title>
   <link href="http://wemakethings.net/2013/02/03/auto-off-bike-light"/>
   <updated>2013-02-03T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/02/03/auto-off-bike-light</id>
   <content type="html">&lt;p&gt;&lt;img alt='device' src='/assets/images/2013-02-03-device.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I wanted to make an auto-off bike light because I just keep forgetting to switch it off and the batteries are constantly flat. And I hate dynamos.&lt;/p&gt;

&lt;p&gt;I was looking into accelerometers, but couldn&amp;#8217;t find one that would enter sleep mode and give me interrupts with zero configuration. This implies using microcontroller and it gets boring pretty fast. So I decided to choose the low-tech way. All I needed was a switch that would close when disturbed mechanically. After digging in various junk bins I found a spring and came up with this solution:&lt;/p&gt;

&lt;p&gt;&lt;img alt='switch circuit' src='/assets/images/2013-02-03-switch.jpg' /&gt; The schematics are simple:&lt;/p&gt;

&lt;p&gt;&lt;img alt='schematics' src='/assets/images/2013-02-03-schematics.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The resistor keeps the mosfet off. When the switch is closed briefly, capacitor instantly charges up above the mosfet&amp;#8217;s gate threshold voltage, the mosfet turns on the LED. Then the capacitor discharges slowly through the resistor until its voltage drops below the gate threshold voltage, causing the mosfet to turn off. So if my spring switch closes rapidly while I ride (say, at least once in a minute), the light stays on. If I stop for more than a minute, the light goes off. I chose a 10 megaohm resistor and a 22uF capacitor, in theory this should give about 30 seconds until the threshold voltage is reached.&lt;/p&gt;

&lt;p&gt;This is the switch with the circuit soldered:&lt;/p&gt;

&lt;p&gt;&lt;img alt='circuit' src='/assets/images/2013-02-03-switch_circuit.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;A copper clad board, a knife and smd components&amp;#8230;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Open source Lithium battery charger modules</title>
   <link href="http://wemakethings.net/2013/02/02/lithium-battery-chargers"/>
   <updated>2013-02-02T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/02/02/lithium-battery-chargers</id>
   <content type="html">&lt;p&gt;&lt;img alt='retarded charger' src='/assets/images/2013.02.02-li-ion-charger.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;For a long time I wanted to enter the 21st century by stopping using NiCad or NiMH batteries and upgrading to Lithium accumulators as they provide more power per volume and are cool in general. Constant flow of obsolete cell phones provides a nice source of reasonably high-performance batteries for free - I felt compelled to tap into this resource for my battery operated projects.&lt;/p&gt;

&lt;p&gt;Well, there are a couple of issues you have to take care of when moving to Li-ion or LiPoly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you have to charge them in a particular specific way they like&lt;/li&gt;

&lt;li&gt;you can&amp;#8217;t discharge them below a certain threshold&lt;/li&gt;

&lt;li&gt;oh, yeah, did I mention they blow up violently if you screw up?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What&amp;#8217;s nice about cell phone batteries is that they usually come with a protection circuitry that protects them when they are overdischarged and short-circuited. Once we tried to blow up a cell phone battery by shorting it, connecting to external power supply in proper polarity, then in reverse polarity, then directly to 240V - the sucker just didn&amp;#8217;t blow up! This is just how good protection circuit on cell phone batteries is.&lt;/p&gt;

&lt;p&gt;Ok, enough of this retarded shit. I needed a proper way to charge batteries, and I&amp;#8217;ve chosen USB from a computer as the primary power source since those are ubiquitous. So, to get the job done I chose to test three (essentially two) popular Li-ion charging ICs: &lt;a href='http://www.maximintegrated.com/datasheet/index.mvp/id/4002'&gt;MAX1551&lt;/a&gt;, &lt;a href='http://www.maximintegrated.com/datasheet/index.mvp/id/4002'&gt;MAX1555&lt;/a&gt; and &lt;a href='http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en024903'&gt;MCP73831&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are loads of the charger designs based on these ICs on the net, but I couldn&amp;#8217;t find one that would meet my requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;made in Eagle&lt;/li&gt;

&lt;li&gt;DIY toner transfer friendly&lt;/li&gt;

&lt;li&gt;charging/finished indication&lt;/li&gt;

&lt;li&gt;jumper/resistor selectable charging current&lt;/li&gt;

&lt;li&gt;optional USB connector&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I made my own and am posting them online for people to use: &lt;a href='https://github.com/Miceuz/USBLiPoCharger'&gt;https://github.com/Miceuz/USBLiPoCharger&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='all the boards' src='/assets/images/2013.02.02-boards.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;MAX1551 does not provide feedback about charging status, so there&amp;#8217;s no point talking about it. MAX1555 does provide charging status though, so I took some effort to make use of it:&lt;/p&gt;

&lt;p&gt;&lt;img alt='max1555 schematics' src='/assets/images/2013.02.02-MAX1555-schematics.png' /&gt;&lt;/p&gt;

&lt;p&gt;MAX1555 CHG pin is an open drain output that goes low while the battery is charging, stays high impedance otherwise. While the battery is charging, Q1 is off as its gate is pulled low, lucky combination of LEDs and MOSFETs salvaged from some motherboards allows for Q2 to turn on and light up the LED_CHARGING. When the CHG pin goes high impedance, gate of Q1 is pulled up by R2, Q1 turns on while turning on LED_CHARGED and pulling down the gate of Q2.&lt;/p&gt;

&lt;p&gt;The MOSFETs I used are of jelly-bean kind with &amp;#8220;702&amp;#8221; marking on them, the LED_CHARGED has a voltage drop of about 1.6V, this makes a gate voltage of 5V - 1.6V = 3.4V apparently this is enough for 702 to turn on.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve added a solder jumper that can be used to change charging current mode.&lt;/p&gt;

&lt;p&gt;MCP73831 has a tri-state STAT output, this makes indication trivial:&lt;/p&gt;

&lt;p&gt;&lt;img alt='mcp73831 schematics' src='/assets/images/2013.02.02-MCP73831-schematics.png' /&gt;&lt;/p&gt;

&lt;p&gt;Another nice thing about MCP73831 is that it provides a possibility to tune the charging current for the size of your battery - if the battery is small, you don&amp;#8217;t want to charge it at very high currents, probably you&amp;#8217;d aim for 0.8 x battery capacity to be on the safe side. This can be done by selecting a suitable resistor on PROG pin - consult the datasheet. Note that you can easily violate the USB specification which does not allow for devices to draw currents higher that 100mA without negotiation. But all the USB hosts in computers I&amp;#8217;ve met usually don&amp;#8217;t care.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m not sure about MAX155X, but I can tell from personal experience that MCP73831 does not have any internal protection form reversed battery. It goes poof! with a tiny trace of smoke.&lt;/p&gt;

&lt;p&gt;This is a photo of one of my projects - TV-B-Gone packed into a Nokia phone case utilising the original battery:&lt;/p&gt;

&lt;p&gt;&lt;img alt='tvbgone' src='/assets/images/2013.02.02-tvbgone.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;This is a photo of a raw phone battery cell charging. The battery was old and was outputing no voltage, but after I ripped out the protection circuitry, the cell showed some 2.5V - just on the edge of becoming useless. I was able to charge it without any problems - no heating, etc. I don&amp;#8217;t recommend this way of using old batteries, it&amp;#8217;s here just to show how retarded I am.&lt;/p&gt;

&lt;p&gt;&lt;img alt='raw battery' src='/assets/images/2013.02.02-rawbattery.jpg' /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Three classic fixes for SMD PCB mishaps</title>
   <link href="http://wemakethings.net/2013/02/02/classic_pcb_fix"/>
   <updated>2013-02-02T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/02/02/classic_pcb_fix</id>
   <content type="html">&lt;p&gt;Now, don&amp;#8217;t tell me you&amp;#8217;ve seen this one!..&lt;/p&gt;

&lt;p&gt;After a long hiatus, I wanted to get back to electronics for a while. Finish &lt;a href='/2012/04/09/dmx-dimmer-ready-for-testing'&gt;dmx-dimmer&lt;/a&gt; and all. For warm-up, I decided to put together a &lt;a href='/2012/10/04/catnip'&gt;CatNip kit&lt;/a&gt; that &lt;em&gt;miceuz&lt;/em&gt; gave me.&lt;/p&gt;

&lt;p&gt;A few sloppy minutes later I was de-soldering one side of a &lt;a href='http://en.wikipedia.org/wiki/Quad_Flat_Package'&gt;TQFP package&lt;/a&gt; (ARM chip), which was placed on a bed of SMD paste and slipped a bit. It was all going well, then a trace flaked off the board. Oops.&lt;/p&gt;

&lt;p&gt;No biggie, just solder in a thin wire. 0.1 mm will do just fine. It&amp;#8217;s commonly available in the form of transformer refuse.&lt;/p&gt;

&lt;p&gt;&lt;img alt='CatNip development board, with GPIO2.0 output connector wired-up directly to the microcontroller' src='/assets/images/2013.02.02-wire.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I kept on soldering, listening to psytrance, minding my own business, when suddenly and for no apparent reason a 0603 resistor jumped right at me, and was gone the second after. Bad luck, it was 2 kΩ, and &lt;strike&gt;I didn't have any more of those on hand&lt;/strike&gt; I was too lazy to look for one. I did have several 1 kΩ and a pin handy, so I hooked these up in series.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Two SMD resistors standing vertically, connected by a clipped-off pin' src='/assets/images/2013.02.02-resistor_series.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;After having populated most of the board, I noticed one resistor was still missing. 150 Ω, wasn&amp;#8217;t in the kit. For demo purpose only, I decided to connect several larger-value resistors in parallel.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Several SMD resistors stacked atop one another, dont get annoyed by the following line' src='/assets/images/2013.02.02-resistor_parallel.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;What I did here, as you most probably see, is stack five 1 kΩ resistors atop one another. Could have gone with six, but this is just current limiting for a LED, so the same precise value is not strictly required.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the complete board before I rub it with acetone and glue the frankensteins:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Resulting board, with all three quirks visible' src='/assets/images/2013.02.02-result.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Does it work? Well, it powers up and enumerates as USB storage, so I guess it does. No way to be sure, got no toolchain.&lt;/p&gt;

&lt;p&gt;To give some context, here&amp;#8217;s a lamp&amp;#8217;s-eye view.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Big-picture shot of the workspace' src='/assets/images/2013.02.02-big_picture.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;That thing with a black/yellow handle? Unregulated 40 W noname, stock tip, China Export certified. The iron I was using. A close-up&amp;#8230;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Iron tip and SMD component comparison, a white smurf is seen lurking in the background over my Cortex' src='/assets/images/2013.02.02-iron_tip.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Why in the world?.. For fun mostly, so that I truly can.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A wide-angle, low-pressure shower head</title>
   <link href="http://wemakethings.net/2013/01/30/shower_head"/>
   <updated>2013-01-30T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/01/30/shower_head</id>
   <content type="html">&lt;p&gt;We wanted a shower head that doesn&amp;#8217;t feel like you&amp;#8217;re in the sink under the tap. We ordered one from DealExtreme, but it never arrived, and they didn&amp;#8217;t return our calls. We shopped around, but they all cost like a washing machine.&lt;/p&gt;

&lt;p&gt;Therefore this. Stainless steel, no filters, no frills. 16 cm wide, 188 1 mm holes. Four common HSS drill bits broke while doing the plate.&lt;/p&gt;

&lt;p&gt;Smooth.&lt;/p&gt;

&lt;p&gt;&lt;img alt='A wide shower head, front' src='/assets/images/2013.01.30-shower_head_front.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='A wide shower head, back' src='/assets/images/2013.01.30-shower_head_back.jpg' /&gt;&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='yes' frameborder='0' height='315' src='https://www.youtube.com/embed/i9K286oTpJc' width='420'&gt;Wide shower head demo video, on YouTube.&lt;/iframe&gt;&lt;/center&gt;</content>
 </entry>
 
 <entry>
   <title>A moka pot stove from a clothing iron</title>
   <link href="http://wemakethings.net/2013/01/24/moka-pot-stove-from-clothing-iron"/>
   <updated>2013-01-24T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2013/01/24/moka-pot-stove-from-clothing-iron</id>
   <content type="html">&lt;p&gt;I am a scientist, and I&amp;#8217;m powered by coffee. The problem was, the only source of coffee at my venerable institution is a vending machine that spits back some brownish, watery Scheisse-coffee for 0.4 euro. Either that, or drinking coffee the Polish way, what will rot one&amp;#8217;s stomach and soul eventually.&lt;/p&gt;

&lt;p&gt;One way to build a stove is to go back to the basics and make the heating plate from nichrome wire, similar to what we did with the &lt;a href='http://wemakethings.net/2012/04/01/cat-heater'&gt;cat heater&lt;/a&gt;. After an evening spent with &lt;em&gt;ioch&lt;/em&gt; calculating resistances and cross-sections I decided that handling 80m of wire is too much and went with &lt;em&gt;pwf&amp;#8217;s&lt;/em&gt; suggestion, that is, using a clothing iron. Such a stove wasn&amp;#8217;t a new thing for us &amp;#8211; we got the same idea from &lt;a href='http://www.millionreasonswhylithuaniaisthebestcountryintheworld.com/lt/678/'&gt;some Lithuanian students&lt;/a&gt;. Adapting a clothing iron makes perfect sense: it uses a kW or so, so it is quite efficient, the surface is non-sticky and it has inbuilt temperature control. Besides, who irons their clothes nowadays anyway?&lt;/p&gt;

&lt;p&gt;One gloomy Sunday we went to a &lt;a href='http://people.cs.uct.ac.za/~bfry/dseaward/insidestuff/wintermarket.html'&gt;Gibsonesque Turkish flea market&lt;/a&gt; nearby and bought a spanking new clothing iron, made in GDR, for a few euros. I took it apart immediately &amp;#8211; there weren&amp;#8217;t much more than the heating plate with the heating element around it (seen here as the circular bulge between the rivets), the bi-metal plate that is probably the most basic temperature controller, a small lightbulb that we kept and the remnants of a temperature control wheel (you know, the silk-wool-cotton-linen sequence). The case is held together with the heating plate by the prominent screw. The plastic parts &amp;#8211; the handle and such &amp;#8211; were lost immediately so I can&amp;#8217;t say anything about them.&lt;/p&gt;

&lt;p&gt;&lt;img alt='The disassembled clothing iron' src='/assets/images/2013-01-24-breakdown.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Since I have access to a ceramic kiln and several pounds of clay, it seemed a natural choice: clay is heat and water resistant, an insulator, easy to mold and clean. I used grainy (~2mm chamotte fraction) stoneware, as it&amp;#8217;s cheap and contracts less than regular fine clay. All flat parts were rolled with an empty bottle, cut by hand and glued together with stoneware slip. This part of the process is hard to describe, so I&amp;#8217;ll throw in a couple of pictures instead.&lt;/p&gt;

&lt;p&gt;&lt;img alt='The upper plate' src='/assets/images/2013-01-24-plate0.jpg' /&gt; &lt;img alt='The top plate with the triangular hole in it' src='/assets/images/2013-01-24-plate1.jpg' /&gt; &lt;img alt='The final structure: it has way too many support points, I should had stayed with three. On the other hand, some sanding and filing after the firing made things OK.' src='/assets/images/2013-01-24-plate2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I left it to dry for a few days, fired once at 960C, forgot about it, went to Israel, then glazed it one night and fired again up to 1020C.&lt;/p&gt;

&lt;p&gt;The problem with ceramics is that the stoneware shrinks during the drying and firing. Nevertheless, this project was not a precision mechanics endeavour anyway &amp;#8211; so we cut and drilled a metal plate and fastened it to the belly of the heating plate so that it looked horizontal and would not fall off.&lt;/p&gt;

&lt;p&gt;&lt;img alt='The fired piece' src='/assets/images/2013-01-24-fired-parts.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='All in one, the cutting edge of low tech' src='/assets/images/2013-01-24-underbelly.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I had made some nichrome loops inside, so we tied the cord in with some zip ties, checked if the tiny indication light was working and made a test run:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Waiting' src='/assets/images/2013-01-24-coffee-test0.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Here it goes' src='/assets/images/2013-01-24-coffee-test1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;It takes about 2 minutes for this moka pot to boil. &lt;em&gt;ioch&lt;/em&gt; and &lt;em&gt;pwf&lt;/em&gt; already suggested adding an alarm clock w/ a relay to it, so that one&amp;#8217;s coffee is ready after the first &amp;#8216;snooze&amp;#8217;. I&amp;#8217;m also considering making a whale-shaped one, using a steam iron for some second degree burns.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>How to set up an open-source Stellaris Launchpad toolchain on Arch Linux</title>
   <link href="http://wemakethings.net/2012/12/30/stellaris_launchpad_on_arch_linux"/>
   <updated>2012-12-30T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/12/30/stellaris_launchpad_on_arch_linux</id>
   <content type="html">&lt;p&gt;We got some &lt;a href='http://www.ti.com/ww/en/launchpad_site/stellaris.html'&gt;Stellaris&lt;/a&gt; boards from Texas Instruments. Two each, of course. We put &amp;#8216;em in the closet until the dev chain matures. After getting a nudge from &lt;em&gt;miceuz&lt;/em&gt;, I finally decided to try it out. It turns out that setting up on Arch Linux has now become trivial.&lt;/p&gt;

&lt;p&gt;There are many ways to get it working. I prefer open-source. The AUR is a total mess of &lt;a href='https://aur.archlinux.org/packages.php?O=0&amp;amp;L=0&amp;amp;detail=1&amp;amp;C=0&amp;amp;K=eabi&amp;amp;SeB=nd&amp;amp;SB=n&amp;amp;SO=a&amp;amp;PP=30&amp;amp;do_Search=Go'&gt;EABI packages&lt;/a&gt;. As per &lt;a href='https://wiki.archlinux.org/index.php/Cross_Compiling_Tools_Package_Guidelines#Package_naming'&gt;cross-compiling tool guidelines&lt;/a&gt;, the proper name for this toolchain is &lt;code&gt;arm-none-eabi&lt;/code&gt; (if no vendor is specified). This name is taken by the &lt;a href='http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/'&gt;Sourcery CodeBench&lt;/a&gt; stuff. Note also that it&amp;#8217;s a binary redistribution.&lt;/p&gt;

&lt;p&gt;Another set of packages (more widely adopted) is &lt;code&gt;cross-arm-none-eabi-*&lt;/code&gt;. This is what I want. It is based on the &lt;a href='https://github.com/esden/summon-arm-toolchain'&gt;summon-arm-toolchain script&lt;/a&gt; and uses the GCC toolchain.&lt;/p&gt;

&lt;p&gt;To debug, you will also need &lt;a href='http://openocd.sourceforge.net/'&gt;OpenOCD&lt;/a&gt;. To flash, &lt;a href='https://github.com/utzig/lm4tools'&gt;lm4tools&lt;/a&gt;. Create a few config files, and you are go.&lt;/p&gt;

&lt;p&gt;So, the procedure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;As a bare minimum, get the following from AUR: &lt;code&gt;cross-arm-none-eabi-gcc&lt;/code&gt; &lt;code&gt;lm4flash-git&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;For debugging, also get these: &lt;code&gt;cross-arm-none-eabi-gdb&lt;/code&gt; &lt;code&gt;openocd-git&lt;/code&gt;. I asked &lt;em&gt;veox&lt;/em&gt; to pack the latter. By the time you read this, the stable &lt;code&gt;openocd&lt;/code&gt; from &lt;code&gt;community&lt;/code&gt; will probably support Stellaris, so just use &lt;code&gt;pacman&lt;/code&gt;. There is also &lt;code&gt;lmicdiusb-git&lt;/code&gt;, but I haven&amp;#8217;t tried that.&lt;/li&gt;

&lt;li&gt;Add a &lt;a href='http://kernelhacks.blogspot.com/2012/11/the-complete-tutorial-for-stellaris.html'&gt;udev rule&lt;/a&gt;, so you don&amp;#8217;t have to &lt;code&gt;sudo&lt;/code&gt; all the time.&lt;/li&gt;

&lt;li&gt;&lt;a href='http://scompoprojects.wordpress.com/2012/11/07/debugging-a-program-on-the-stellaris-launchpad-board/'&gt;Test your debugger&lt;/a&gt;. As per the guide, I used &lt;a href='https://github.com/scompo/stellaris-launchpad-template-gcc'&gt;stellaris-launchpad-template-gcc&lt;/a&gt; to avoid obscure TI licenses.&lt;/li&gt;

&lt;li&gt;Optionally, get the official &lt;a href='http://www.ti.com/tool/sw-lm3s'&gt;StellarisWare&lt;/a&gt; library. The page has broken JavaScript &lt;em&gt;and wants you to log in&lt;/em&gt;, which I couldn&amp;#8217;t. If you do manage to accompish this feat, know that you won&amp;#8217;t be able to use their code for &lt;em&gt;anything&lt;/em&gt; &amp;#8211; just read the license. I propose we ditch it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now just figure out why use this instead of &lt;a href='/2012/10/04/catnip/'&gt;your usual workhorse&lt;/a&gt;. Perhaps a &lt;a href='http://www.fischl.de/arm/can_bus_interface_for_stellaris_launchpad/'&gt;CAN bus interface by Thomas Fischl&lt;/a&gt;, the guy who gave us &lt;a href='http://www.fischl.de/usbasp/'&gt;USBasp&lt;/a&gt;?..&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Merry-go-round electronics</title>
   <link href="http://wemakethings.net/2012/12/08/merry-go-round-electronics"/>
   <updated>2012-12-08T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/12/08/merry-go-round-electronics</id>
   <content type="html">&lt;p&gt;It&amp;#8217;s an electronics part of merry-go-round saga. Read &lt;a href='http://wemakethings.net/2012/12/06/merry-go-round'&gt;the first part about mechanics&lt;/a&gt; before.&lt;/p&gt;

&lt;h1 id='the_task'&gt;The task&lt;/h1&gt;

&lt;p&gt;When &lt;em&gt;pwf&lt;/em&gt; asked me if I&amp;#8217;d like to put some thought into this merry-go-round affair they were going to pull of, I didn&amp;#8217;t hesitate much - the project was a good test of my electronics skills and my niggaz needed me - how could I refuse?&lt;/p&gt;

&lt;p&gt;The task at hand was like this - the carousel hangs from a ceiling, it is driven by a variable frequency drive, there is a stage wheel beneath it which rotates, the carousel has to rotate together with the stage wheel in one mode and has to rotate fast (how fast is too fast?) in the other mode.&lt;/p&gt;

&lt;p&gt;At first we were going to take readings from the shaft of the motor that drives the stage wheel (i&amp;#8217;d even quickly made a tachometer from parts from a junk bin), but after inspection of all the mechanisms we understood that there was no chance - the age of the system approaches the years when people were walking on the Moon and it hasn&amp;#8217;t seen much love from any caring engineer during all this time.&lt;/p&gt;

&lt;p&gt;We decided to take the readings by attaching a rubber wheel with a rotary encoder to the steel bottom rim of the stage wheel - this way we could be sure that we get the exact measurements of movement of the edge of the stage wheel.&lt;/p&gt;

&lt;p&gt;What about the carousel? We&amp;#8217;ve chosen a variable frequency drive with a modbus option, so we could control it remotely, but what about the feedback? Luckily it came to me early enough in the process: we need a closed loop system for synchronization to work properly. It &lt;em&gt;might&lt;/em&gt; have worked in the open loop mode, but the system was unknown, there was no time for testing, so &lt;em&gt;when in doubt - overengineer&lt;/em&gt; - we&amp;#8217;ll have another rotary encoder that&amp;#8217;s reading the rotation of the carousel. This way we have a PID system that ensures that both the stage wheel and carousel have rotated exactly the same amount. Provided encoder readings correspond to a real rotation. Read on.&lt;/p&gt;

&lt;h1 id='reading_encoders'&gt;Reading encoders&lt;/h1&gt;

&lt;p&gt;Ok, how do you transfer pulses from the encoder that might be up to 100m from the control panel? When in doubt&amp;#8230; I&amp;#8217;ve decided to use RS485 as a wire protocol for that. Quickly enough nice folks from Linear Technology and Maxim-ic have provided me with free engineering samples of receivers, drivers and transceivers. Far quicker than buying from distributors. And free.&lt;/p&gt;

&lt;p&gt;We used a high-end encoder from &lt;a href='http://metrology.precizika.lt/pdf/A58_EN.pdf'&gt;precizika&lt;/a&gt;. Conveniently it was outputting a differential signal, so I&amp;#8217;ve used &lt;a href='http://www.maximintegrated.com/datasheet/index.mvp/id/1852'&gt;MAX3095&lt;/a&gt; to read it and &lt;a href='http://www.linear.com/product/LTC486'&gt;LTC486&lt;/a&gt; to transmit it down the line.&lt;/p&gt;

&lt;p&gt;I had time to take some nice pictures:&lt;/p&gt;

&lt;p&gt;&lt;img alt='encoder adapter' src='/assets/images/2012.12.08-encoder-adapter1.jpg' /&gt; &lt;img alt='encoder adapter' src='/assets/images/2012.12.08-encoder-adapter2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;But that&amp;#8217;s boring. The fun part was designing all the protection - the thing was meant to be used in a theatre and things &lt;em&gt;do&lt;/em&gt; get messed up in a theatre. The adapter uses the same RJ45 connectors for input and output, I know it&amp;#8217;s a &lt;em&gt;BAD THING(tm)&lt;/em&gt;, but those connectors were too convenient to not to use them, so I&amp;#8217;ve had a nice afternoon designing a foolproof protection from reverse connections. And a fault indication. &lt;img alt='encoder adapter protection' src='/assets/images/2012.12.08-encoder-adapter-protection.png' /&gt; It&amp;#8217;s an encoder-side connector that usually &lt;em&gt;outputs&lt;/em&gt; voltage. If the system sees voltage on 1 and 2 pins (this happens if you reverse connectors), the FUBLIA LED lights up and bad things do not happen.&lt;/p&gt;

&lt;p&gt;Another fun part was developing an edge detector to blink some LEDs when pulses from the encoder are coming: &lt;img alt='encoder adaptor edge detector' src='/assets/images/2012.12.08-encoder-adapter-edge-detector.png' /&gt; Note the extensive use of PNP transistors - I have a pile of them left after a project before, had to use &amp;#8216;em up!&lt;/p&gt;

&lt;h1 id='control_unit'&gt;Control unit&lt;/h1&gt;

&lt;p&gt;The control part is really boring, it&amp;#8217;s just my &lt;a href='http://wemakethings.net/2012/09/26/catnip/'&gt;CatNip&lt;/a&gt; board with a special &amp;#8216;kitteh&amp;#8217; - a &amp;#8216;shield&amp;#8217; to condition RS485 signals, read some buttons and blink some LEDs. I&amp;#8217;ve used &lt;a href='http://www.linear.com/product/LTC488'&gt;LTC488&lt;/a&gt; receiver to match the Linear Technology driver on the encoder adapter and &lt;a href='http://www.linear.com/product/LTC485'&gt;LTC485&lt;/a&gt; to talk to the variable frequency drive. I&amp;#8217;ve written a of &lt;a href='https://github.com/Miceuz/LPC1343CodeBase/blob/karusele/modbus.c'&gt;couple semi decent modbus functions&lt;/a&gt;. The whole code is at my &lt;a href='https://github.com/Miceuz/LPC1343CodeBase/tree/karusele'&gt;github repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is a picture of our control panel:&lt;/p&gt;

&lt;p&gt;&lt;img alt='control box' src='/assets/images/2012.12.08-carousel-control.jpg' /&gt; &lt;img alt='control box inside' src='/assets/images/2012.12.08-carousel-control-internals.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Well, all of this was a &amp;#8220;clean room&amp;#8221; design exercise - as the guys in the workshop were cutting and welding steel like real men, I had to emulate the unknown parts of the system. When I came to the workshop, the carousel was in rather early stages of being complete, so I had to spend some time writing utilities to graph step response, read on control systems theory and design a DMX LED dimmer while eating spacecake. I didn&amp;#8217;t have an opportunity to run my system until the carousel, still hot from welding, was brought and installed in the destination place.&lt;/p&gt;

&lt;h1 id='the_motorized_plow'&gt;The Motorized Plow&lt;/h1&gt;

&lt;p&gt;That&amp;#8217;s where the fun started. My system worked quite well, but there was a problem with a stage wheel - the steel rim we were running our encoder wheel on was not that round after all. One fourth of the circle was squashed inside, so the carousel would go with the stage within the error of 10cm for 3/4 of the circle and run away in the last quarter. I could have thought of some trick in software, but because of sleep deprivation my skull was full of scrambled eggs instead of brains. So either you &lt;em&gt;solve optic problems with optics, mechanical with mechanics and electrical with electronics or you solve all the problems in software&lt;/em&gt;. This time we went the former way - &lt;em&gt;pwf&lt;/em&gt; added one more degree of freedom to the encoder wheel fixture, changed its angle and orientation on the rim and we were able to follow the wheel for two to three rotations within allowance of 20cm. Which was totally OK for our purposes, but it left a bad taste in my mouth. Check out &lt;a href='http://wemakethings.net/2012/12/06/merry-go-round'&gt;the first part&lt;/a&gt; for the crappy video of synchronization in action.&lt;/p&gt;

&lt;p&gt;When I got up in the theatre (I&amp;#8217;ve slept there, because I was too exhausted to go home), I was greeted by a flock of 50-year old males in formal suits - the theatre management. They brought an old man with them, who still works there as an electrician, but probably still remembers the times when men were walking on the Moon. This old man started telling me story about how he managed to build himself a motorized plow for his garden out of ropes and pulleys. Aha! That&amp;#8217;s why stage wheel is in such a sorry state&amp;#8230;&lt;/p&gt;

&lt;p&gt;There is some pr0n to look at in the meantime:&lt;/p&gt;

&lt;p&gt;&lt;img alt='VFD pr0n' src='/assets/images/2012.12.08-carousel-vfd-pron.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here you can see an AC induction motor, variable frequency drive for it, a reduction box with a chain to drive the carousel and a box that will hold electronics for a DMX LED dimmer.&lt;/p&gt;

&lt;h1 id='dmx_led_dimmer'&gt;DMX LED dimmer&lt;/h1&gt;

&lt;p&gt;How long does it take to design and make a fully functional DMX LED dimmer? Two nights while eating spacecake to draw a PCB, one day to get the parts, etch and solder the boards and one day and one night to write firmware, test and install it.&lt;/p&gt;

&lt;p&gt;As an optional bonus there had to be LED strips on the carousel, controllable via DMX. Well, how do you transfer power to a rotating thing? Ground goes through the frame, and live wire goes through a graphite brush on a slip ring. How much resistance/voltage drop do you get when the carousel rotates? Unknown. When in doubt&amp;#8230; overengineer! We got this beefy transformer out of a trashed guitar amplifier, it was outputting 30V. And we hooked up a constant current source that would compensate for the voltage drop through the slip ring and bearings. And we made a nice 50W heater out of 4 parallel MOSFETs and a huge heatsink. But what if one of several LED strips is not connected? You get the same current pushed through the remaining ones of course. Hm.. no good, let&amp;#8217;s put a PTC on every LED strip.&lt;/p&gt;

&lt;p&gt;This is a constant current source:&lt;/p&gt;

&lt;p&gt;&lt;img alt='dmx dimmer current source' src='/assets/images/2012.12.08-dmx-led-power.png' /&gt;&lt;/p&gt;

&lt;p&gt;As for DMX part - it&amp;#8217;s nothing fancy - just an AVR atmega8 hooked up via &lt;a href='http://www.maximintegrated.com/datasheet/index.mvp/id/1852'&gt;MAX3095&lt;/a&gt; to DMX line via an optocoupled open collector output to pull the gates of MOSFETs down via PWM.&lt;/p&gt;

&lt;p&gt;&lt;img alt='dmx led dimmer pwm' src='/assets/images/2012.12.08-dmx-led-pwm.png' /&gt;&lt;/p&gt;

&lt;p&gt;I used some &lt;em&gt;rxdtxd&amp;#8217;s&lt;/em&gt; &lt;a href='https://github.com/rxdtxd/dmx-dimmer'&gt;DMX decoding code&lt;/a&gt;. The whole thing is on github if someone is interested: &lt;a href='https://github.com/Miceuz/DmxLedDimmerBasic'&gt;https://github.com/Miceuz/DmxLedDimmerBasic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PTC&amp;#8217;s on the strips paid off nicely as one of those crap Chinese strips was shorting to the frame! Now just imagine all the things we said after discovering this at 5 o&amp;#8217;clock in the morning!&lt;/p&gt;

&lt;h1 id='aftermath'&gt;Aftermath&lt;/h1&gt;

&lt;p&gt;Well, it was a nice hell of a deathmarch involving a bunch of people, using a load of different skills and techniques. There was too much of things we didn&amp;#8217;t know beforehand and no time to test ideas. Nevertheless, we are very lucky to have pulled this off. When in doubt&amp;#8230; overengineer!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Merry-go-round</title>
   <link href="http://wemakethings.net/2012/12/06/merry-go-round"/>
   <updated>2012-12-06T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/12/06/merry-go-round</id>
   <content type="html">&lt;h1 id='introduction'&gt;Introduction&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Gotta get off, gotta get off, gotta get off of this merry-go-round&amp;#8230;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is another big one, and it came in together with the &lt;a href='/2012/11/18/chairs_on_rails/'&gt;rails&lt;/a&gt;, so you can guess why there ain&amp;#8217;t many pictures. We had our hands full of tools more labour-worthy than a camera.&lt;/p&gt;

&lt;p&gt;Anyway, a &lt;a href='http://en.wikipedia.org/wiki/Carousel'&gt;carousel&lt;/a&gt; was to be made in &lt;strike&gt;little&lt;/strike&gt; no time. It had to be 4 meters across. It had to spin, at various speeds. It had to sync with a revolving stage. It had to be stable enough during rotation that articles of fine modern furniture could be suspended from it.&lt;/p&gt;

&lt;p&gt;My part in this was the rotating circle and its suspension to the axis. The rotor, in short.&lt;/p&gt;

&lt;h1 id='blueprints_what_blueprints_a_freecad_review'&gt;Blueprints? What blueprints? (A FreeCAD review)&lt;/h1&gt;

&lt;p&gt;In short: there were none.&lt;/p&gt;

&lt;p&gt;For all I intended to do, I really wanted some: we&amp;#8217;re talking circles here, people! Lots of angles cut at precise lengths, and most of them in volume. But, alas, every artist is his own engineer.&lt;/p&gt;

&lt;p&gt;I tried some open-source CAD programs, spending most time on &lt;a href='http://free-cad.sourceforge.net/'&gt;FreeCAD&lt;/a&gt; (version 0.12.5284), and the verdict is: not stage-ready.&lt;/p&gt;

&lt;p&gt;First off, FreeCAD is a front-end with frills, written in Python 2 (and Qt). The back-end is &lt;a href='http://www.opencascade.org/'&gt;OpenCascade&lt;/a&gt;. There are big issues with both.&lt;/p&gt;

&lt;p&gt;The biggest one with me is this. Since FreeCAD is written in Python (essentially a &lt;em&gt;prototyping&lt;/em&gt; language, in my view), it breaks a lot. My system is probably quite different from that of the current developers&amp;#8217;, and it dumped core once every three minutes (on average). Filing bug reports would have been useless: there were at least ten different exceptions in trace-backs, and we would have spent hours arguing whether this is a misconfiguration. Of Python.&lt;/p&gt;

&lt;p&gt;If you do decide to try out FreeCAD, have the following in mind.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Do &lt;em&gt;not&lt;/em&gt; upgrade your real work parts to a combined part, upgrade copies instead and hide the originals. If you decide to edit the combined part later, exploding it will give you &lt;strike&gt;feces&lt;/strike&gt; faces instead of solid objects.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Making a lot of copies at once might not copy everything, but it fills the object list anyway. Deleting objects that are listed but don&amp;#8217;t exist drops core.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;It seems there&amp;#8217;s no way to specify an arbitrary reference axis when rotating, which caused me a lot of grief.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;You either rotate in the current view&amp;#8217;s plane, or one of pre-defined XY/XZ/YZ, which are also called top/front/side elsewhere. Confusing.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Rotating multiple objects in the same plane by a certain angle does not always result in them rotating the same angle. If it sounds wrong, that&amp;#8217;s because it is.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Snapping uses algebraic units and doesn&amp;#8217;t take the current view&amp;#8217;s zoom level into account.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;A lot of essential functionality is implemented as macros, which are not included in the basic package. &lt;a href='http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Macro_Solid_Sweep'&gt;Solid Sweep&lt;/a&gt; proves useful, if you can get used to it.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Boolean operations on solids do not always work, which is mentioned in &lt;a href='http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=FAQ#My_boolean_operations_fail.2C_or_give_weird_results'&gt;the FAQ&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Also, they sometimes drop core.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After several hours of cursing, I got this.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Merry-go-round rotor in FreeCAD, partially' src='/assets/images/2012.12.06-00-freecad-drawing.png' /&gt;&lt;/p&gt;

&lt;p&gt;Which is, in my book, too long for too little. I eventually drew and calculated everything I &lt;em&gt;really&lt;/em&gt; needed on paper.&lt;/p&gt;

&lt;p&gt;Why not AutoCAD? Because I don&amp;#8217;t use Windows. Why not Google SketchUp? Because that doesn&amp;#8217;t have Boolean operations on solids in the freeware version. Why not DraftSight? Because that has very limited 3D functionality. Why open-source? Because we don&amp;#8217;t really get anything but experience points for this.&lt;/p&gt;

&lt;p&gt;Sorry for the long-wrought review, I just had it sitting in my home dir for three months. Back to the topic.&lt;/p&gt;

&lt;h1 id='a_slice_of_pi'&gt;A slice of Pi&lt;/h1&gt;

&lt;p&gt;As soon as metal got into the shop, I set out to cut those beautiful long slender things into stacks of beautiful short identical things.&lt;/p&gt;

&lt;p&gt;Remember, it&amp;#8217;s a &amp;#8220;circle&amp;#8221; 4 meters across, made of short straight segments. A polygon, right. The circle&amp;#8217;s perimeter is d * π = 4 π. We decided 24 corners is circular enough.&lt;/p&gt;

&lt;p&gt;Technically, it was possible to take a square pipe blank and &lt;a href='http://en.wikipedia.org/wiki/Metal_rolling'&gt;roll&lt;/a&gt; it to achieve desired curvature, but we don&amp;#8217;t have the equipment, and there were no resourses to order from a specialised shop.&lt;/p&gt;

&lt;p&gt;As always, we designed it so that it could be taken apart (into four parts). This has a few advantages.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;It takes less space in the storage room when not needed. You don&amp;#8217;t hang stuff you don&amp;#8217;t need from a high ceiling, do you?..&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;It fits through the workshop&amp;#8217;s door, and also into our painting chamber, in case we had time and paint to paint it (we didn&amp;#8217;t).&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Splitting the circle into four arcs that have a length of π is a nice inside joke. It lets us feel like we know what we&amp;#8217;re doing.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I then tack-welded these pieces into eight arcs, and tack-welded those parallel, in couples. It didn&amp;#8217;t go too well. I made a jig to weld the short segments together into long arcs at a precise angle. The angle was good, but the jig was too short &amp;#8211; it could only support three segments until the arc would start to curve due to its own weight. I set up a convoluted system of props to keep the dangling end from bending too much. This unwanted curvature was reduced somewhat, but still demanded an array of clamps to hold paired arcs together during welding.&lt;/p&gt;

&lt;p&gt;Long story short: I was too lazy to set up one proper jig, and so had to set up two instead.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;eggman&lt;/em&gt; cut and drilled eight plates for segment connections. In the image below, you can see the four tack-welded segments, clamped together with the plates in between. The clamping was also needed for alignment. Luckily, it was just tack-welded, which allowed for fine adjustment (two holding and one adjusting with rebar). The hammer, fridge and van are for size reference.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Segments of the pie, clamped together on the floor' src='/assets/images/2012.12.06-01-circle-clamped.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Most of it was rectangular profile, 30x15x1,5 mm. Pretty lightweight, and considerably more flexible along its 15 mm side compared to the 30 mm side. 6 pieces per arc, with end pieces slightly shorter than the middle ones, to accommodate the thickness of the connection assembly. The connection plates are just lengths of a wide strip, something like 5 or 6 mm thick. It will be slightly clearer from later images.&lt;/p&gt;

&lt;h1 id='suspension_lower_bearing_mount'&gt;Suspension: lower bearing mount&lt;/h1&gt;

&lt;p&gt;The axis at the center had two machined bearing mounts, one at the top, one at the bottom. The circle connects to both with a total of 16 profiles (30x30x2 mm). We called them &amp;#8220;strings&amp;#8221;. 8 strings to the top, 8 to the bottom.&lt;/p&gt;

&lt;p&gt;I started with the bottom mount, once again only tack-welding connection pates to the side.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Lower bearing mount, with string connection plates being welded to its side' src='/assets/images/2012.12.06-02-lower-bearing.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;There were holes for the bearing&amp;#8217;s lid in the mount, which came handy for a kind of piggy-back-ride alignment job: screw on two alignment brackets, put a connection plate in the middle, tack, turn, repeat. It is hard to see in the image above, but there are also two pieces of metal, cut to the same length, held at the other side of the bearing mount with welding magnets. So the connection plate is right in the middle. It turned out later most of this wasn&amp;#8217;t exactly necessary, and the connection plates could have been welded at the edge just as well.&lt;/p&gt;

&lt;p&gt;I then put the bearing mount in the middle of the circle, cut four strings, with different angles at both ends, and welded plates with holes to those. Then four more strings, with yet another set of angles. It came together like this.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Circle connected to lower bearing mount with 8 strings, top-side view' src='/assets/images/2012.12.06-03-lower-bearing-mount-with-strings.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;What I leave out of the picture here is engineering: measuring the exact angles and lengths, taking the thickness of connecting pates and plane rotations into account, and all the running back and forth in between.&lt;/p&gt;

&lt;p&gt;Four strings connect to the top of the circle at the middle of its segments, and four more connect to the bottom where segments meet.&lt;/p&gt;

&lt;p&gt;What&amp;#8217;s also different is we put in diagonals into the rectangles, to improve rigidity. It would have probably been even better if they were put in rotated 90 degrees along their own axes, so that the 30x15 profile&amp;#8217;s flat side was co-planar with the circle&amp;#8217;s imaginary cylinder. That would give rigidity in a plane tangent to said cylinder&amp;#8217;s surface. But it would also mean we&amp;#8217;d have to cut the ends of the diagonal profiles at two different angles, four times per diagonal, a total of 96 cuts. There was no time for that.&lt;/p&gt;

&lt;h1 id='inside_the_circles_angle'&gt;Inside the circle&amp;#8217;s angle&lt;/h1&gt;

&lt;p&gt;I must have been waiting for something, since I have many pictures of this stage.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s another angle of the previous photo. It shows a closer view of all the connections mentioned thus far.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Circle connected to lower bearing mount with 8 strings, side view' src='/assets/images/2012.12.06-04-circle-side-view.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s how the pie segments connect:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Circle segments connection' src='/assets/images/2012.12.06-05-circle-segments-connection.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Connection plates have three screws. This way, you can always take one screw out, and the other two will still be holding the thing together.&lt;/p&gt;

&lt;p&gt;Also visible is one end of the lower string, screwed to the segment&amp;#8217;s connection plate. Since a screw hole was available here, we thought it could as well be used for something other than just sticking two circle segments together.&lt;/p&gt;

&lt;p&gt;It wasn&amp;#8217;t so easy in the middle of the segments, where the other four strings go:&lt;/p&gt;

&lt;p&gt;&lt;img alt='String connection to top of circle' src='/assets/images/2012.12.06-06-circle-string-top.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;An additional (thick) plate had to be welded to the (thin) profile here, and &lt;em&gt;inside the circle&amp;#8217;s angle&lt;/em&gt;. Took some fiddling, and I eventually settled on high-frequency pulse welding.&lt;/p&gt;

&lt;p&gt;It all comes together at the bearing mount:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Lower bearing mount, with strings attached' src='/assets/images/2012.12.06-07-lower-bearing-mount-with-strings.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;There were also pieces of rod under the connection plates, to fill the gaps:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Lower bearing mount, side view with connection plates' src='/assets/images/2012.12.06-08-lbm-side.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='stator_and_axis'&gt;Stator and axis&lt;/h1&gt;

&lt;p&gt;What I was waiting for was for the stator and axis assembly to be finished. &lt;em&gt;pwf&lt;/em&gt; did all of it, except for a few small parts I made while there was nothing else to do.&lt;/p&gt;

&lt;p&gt;We initially planned the axis to be 2 meters high, but later settled on 1,5 m to reduce weight. This quickly proved to be the right choice, since the entire length could be reached from the floor. A shaky ladder was involved, sure, but only later on, during some final welding, and wasn&amp;#8217;t required to hang the stator on a girder.&lt;/p&gt;

&lt;p&gt;Anyway, here it is, upside down:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Stator assembly' src='/assets/images/2012.12.06-09-check-alignment-1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;On the right is the motor and gearbox. On the left, the axis and upper bearing mount. The latter&amp;#8217;s alignment is being checked.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Upper bearing mount, checking alignment' src='/assets/images/2012.12.06-10-check-alignment-2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;In the measured plane, the maximum deviation was 0,032 mm.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve also tacked four plates for strings to the upper mount by this point.&lt;/p&gt;

&lt;h1 id='death_march'&gt;Death march&lt;/h1&gt;

&lt;p&gt;We were running out of time, so there are no more pictures of the build process. I&amp;#8217;m also not sure what happened after what exactly.&lt;/p&gt;

&lt;p&gt;What I do have on the hard drive is many pictures of couplers.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Couplers and finished lower bearing mount' src='/assets/images/2012.12.06-11-couplers.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;These would eventually be used in suspending the carousel. Can&amp;#8217;t tell much about why and how many, since I had nothing to do with it. There were 16 of them, I think. I do remember &lt;em&gt;various artists&lt;/em&gt; cutting machined cylinders lengthwise.&lt;/p&gt;

&lt;p&gt;Also visible is the lower bearing mount, with plates welded all the way.&lt;/p&gt;

&lt;p&gt;Fast-forward to a full assembly, past the night when everything that was tacked got welded.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Merry go round, ready for lift-off' src='/assets/images/2012.12.06-12-mgr-lowered.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Eight more strings, to the upper bearing mount. Four of them straight, just as the lower ones. Four more at a tangent to the upper bearing mount, an almost 90° angle, because we thought this would be useful in rotation moment transfer. A few helical spirals would have been better, of course, but that would have been too much.&lt;/p&gt;

&lt;p&gt;Several couplers are also visible. Well, almost. The hatched system of &lt;a href='http://en.wikipedia.org/wiki/Batten_(theater)'&gt;battens&lt;/a&gt; is required for weight distribution. When lifted, the merry-go-round&amp;#8217;s rotation may introduce swinging, so the pipes have to be attached to a static structure with strip belts (one, orange, can be seen hanging in the image above).&lt;/p&gt;

&lt;p&gt;Here it is again, in all its glare:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Merry go round, high in the sky' src='/assets/images/2012.12.06-13-mgr-raised.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='whats_not_in_the_description'&gt;What&amp;#8217;s not in the description&lt;/h1&gt;

&lt;p&gt;Everything mechanical and &lt;a href='/2012/12/08/merry-go-round-electronics/'&gt;electrical&lt;/a&gt; &amp;#8211; essentially rotation and synchronising with the revolving stage. Also, everything that got hung (a Styrofoam closet can be seen, though). I was not involved in those parts.&lt;/p&gt;

&lt;p&gt;I did manage to get a few crappy videos, though.&lt;/p&gt;

&lt;p&gt;First, stuffed animals spinning at half of maximum speed.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='yes' frameborder='0' height='315' src='https://www.youtube.com/embed/A3kV4P62szk' width='420'&gt;Washing machine drum coffee roaster (live run), on YouTube.&lt;/iframe&gt;&lt;/center&gt;
&lt;p&gt;Second, rotation tracking. A stuffed flamingo is propped up on a box that stands on the stage, and suspended from a cord that is attached to the carousel at the same time.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='yes' frameborder='0' height='315' src='https://www.youtube.com/embed/4m1l4z-jkvo' width='420'&gt;Washing machine drum coffee roaster (live run), on YouTube.&lt;/iframe&gt;&lt;/center&gt;</content>
 </entry>
 
 <entry>
   <title>Chairs on rails, and other stuff</title>
   <link href="http://wemakethings.net/2012/11/18/chairs_on_rails"/>
   <updated>2012-11-18T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/11/18/chairs_on_rails</id>
   <content type="html">&lt;p&gt;I accidentally lost the habit of taking photos, which is an important accessory with cameras. So this isn&amp;#8217;t going to be too concise.&lt;/p&gt;

&lt;p&gt;Anyway, we&amp;#8217;ve been up to this:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rails, ready for welding' src='/assets/images/2012.11.18-1_rails.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;What is this blurry picture? It&amp;#8217;s rails! (Ruby didn&amp;#8217;t make it.) There are five segments like this one, 10 meters total. They connect with a simple &lt;strike&gt;pipe-walks-into-bar&lt;/strike&gt; bar-goes-into-pipe joint. (No picture.)&lt;/p&gt;

&lt;p&gt;As you might expect, the tolerance for rail-to-rail distance is really tight. One millimeter of deviation is near-disastrous. A manned chair rolls on top (as you might have guessed from the title), so it is imperative the thing be straight. To achieve that, we used precision-machined cylinders paired into guides.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rail guides for welding' src='/assets/images/2012.11.18-2_rail_guides.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The cylinders, alas, were not precise enough. A few let the pipe slide in just right, most had too small a hole, and one was being an ass altogether. I used files (a few) and sandpaper (lots) to make &amp;#8216;em spec. It took half a day. You see, had any wobble been introduced, I&amp;#8217;d have a big fat ring instead, and I don&amp;#8217;t wear jewellery.&lt;/p&gt;

&lt;p&gt;There were also other goofs with the machinist&amp;#8217;s work, and that had to be worked around as well. (No picture.) This gave me a lot of time to think on various kinds of jobs and how you naturally expect a certain degree of precision, how big a millimeter really is, and stuff.&lt;/p&gt;

&lt;p&gt;Anyway, making four guides with the same rail-to-rail distance was not exactly hard once I had the cylinders. A few clamps and a few magnets, basically (no picture).&lt;/p&gt;

&lt;p&gt;The guides are then put on a pair of awry rails and straighten those out. If you&amp;#8217;re wondering, the cross section looks like this:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rail cross section: a pipe welded onto a T-bar' src='/assets/images/2012.11.18-3_rail_cross_section.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I used the same cylinders mentioned above, before they became paired guides, to weld a pipe to a T-bar.&lt;/p&gt;

&lt;p&gt;With the rails aligned and the section&amp;#8217;s diagonals measured, I put &lt;a href='http://en.wikipedia.org/wiki/Track_(rail_transport)'&gt;sleepers&lt;/a&gt; on top. The guides are cut in two and removed.&lt;/p&gt;

&lt;p&gt;Repeat five times, have a little fun in the workshop. Repeat a hundred times, start a mining operation.&lt;/p&gt;

&lt;p&gt;Oh, there were also two contraptions where the railroad ends, to stop incoming locomotives. (No picture.) A little piece of it, though, aligned for welding:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rail stop piece alignment' src='/assets/images/2012.11.18-4_rail_stop_align.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The final thing, cropped for image size (again, Ruby didn&amp;#8217;t make it):&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rail stop piece alignment' src='/assets/images/2012.11.18-5_chair_on_rails.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I didn&amp;#8217;t do the chairs, so there&amp;#8217;s not a lot I can write about them, except that they roll on four wheels, have eight additional bearings for alignment, and have been deemed safe for use in long-distance travel.&lt;/p&gt;

&lt;h1 id='gear_review'&gt;Gear review&lt;/h1&gt;

&lt;p&gt;Working at the railroad was not the true reason we did this project. At the end of the day, it all boils down to how my gloves do in the workshop.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Guide 5005, new and used' src='/assets/images/2012.11.18-8_guide_gloves.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;On the left is a pair of brand-new, never-before-used Guide gloves, model 5005. On the right, a pair of same gloves, two months into regular hard work. From experience, this is a month into posthumous life.&lt;/p&gt;

&lt;p&gt;If you asked me, these are good enough for general metalwork. I think the box said the palm side is synthetic leather and covered in Teflon. I&amp;#8217;ve literally soaked them in oil twice (during drilling) and they didn&amp;#8217;t turn into stone (as natural leather tends to).&lt;/p&gt;

&lt;p&gt;To the touch, they&amp;#8217;re pretty thin, so they won&amp;#8217;t do at the wood shop, but they hold up reasonably well otherwise. Those holes on the knuckles are from grinder sparks (the backhand is, of course, nylon or polyester or something like that). The holes on the fingers are from turning tight screws, so these won&amp;#8217;t do in the auto shop, either.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve done quite some welding with these gloves, too. A thing I learned is they let heat through, to the point where I got light burns on my palms, but the gloves themselves didn&amp;#8217;t burn or shrink (as, again, natural leather would).&lt;/p&gt;

&lt;p&gt;Another weird thing is they are lightly metallic. Put these on, and you&amp;#8217;re a magnet magnet!..&lt;/p&gt;

&lt;p&gt;P.S. If you&amp;#8217;re a Guide representative, please send various models from your catalogue in our general direction. Size 9. Thank you.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A simple car battery charger</title>
   <link href="http://wemakethings.net/2012/11/13/a_simple_car_battery_charger"/>
   <updated>2012-11-13T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/11/13/a_simple_car_battery_charger</id>
   <content type="html">&lt;p&gt;&lt;img alt='Lead-acid battery charger' src='/assets/images/2012.11.14-auto_battery_charger.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;This is about making a very simple charger for lead-acid batteries, commonly used in automobiles.&lt;/p&gt;

&lt;p&gt;In case you can&amp;#8217;t parse the picture, the setup is simple: mains power is connected to a &lt;a href='http://en.wikipedia.org/wiki/Autotransformer'&gt;variable autotransformer&lt;/a&gt;, then in series to a transformer, a &lt;a href='http://en.wikipedia.org/wiki/Diode_bridge'&gt;diode bridge&lt;/a&gt;, an ammeter (not visible in the picture), and a battery. There are also capacitors and a voltmeter in parallel with the bridge&amp;#8217;s output.&lt;/p&gt;

&lt;p&gt;The purpose of each block is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the autotransformer is used to regulate voltage and current, simultaneously;&lt;/li&gt;

&lt;li&gt;the transformer drops voltage;&lt;/li&gt;

&lt;li&gt;the diode bridge rectifies AC;&lt;/li&gt;

&lt;li&gt;capacitors smooth out the rectified waveform;&lt;/li&gt;

&lt;li&gt;the ammeter and voltmeter are for monitoring;&lt;/li&gt;

&lt;li&gt;the battery is the load.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have no idea whatsoever what the exact parameters of each block are, except that most of them are big.&lt;/p&gt;

&lt;p&gt;Both transformers&amp;#8217; wire windings should be thick enough to withstand the current pumped through them.&lt;/p&gt;

&lt;p&gt;The step-down transformer should have a ratio such that it can drop mains voltage to a value slightly above the desired output voltage. This accounts for the voltage drop on the bridge and the fact that to charge a battery in reasonable time, a higher than rated voltage has to be applied.&lt;/p&gt;

&lt;p&gt;My diode bridge here is four individual diodes whose ratings are certainly overkill for the task. Voltage drop on the bridge is twice the drop on a single diode.&lt;/p&gt;

&lt;p&gt;The caps are rated for 400V &amp;#8211; that&amp;#8217;s what I found in the bin. They can surely be quite smaller, but at least twice the maximum voltage.&lt;/p&gt;

&lt;p&gt;The ammeter was also available in the bin. It&amp;#8217;s analog, with a dial and a maximum value of 10 A. If you intend to use a multimeter as an ammeter, know that they might not have the appropriate circuitry inside, even if it&amp;#8217;s on the dial. Also, there might be a cigarette butt instead of a fuse if a friend of yours blows it and decides to play a prank on you.&lt;/p&gt;

&lt;p&gt;The voltmeter is an el-cheapo multimeter from the store. (EDIT: I eventually swapped that out for an analog voltmeter, so the multimeter could be used elsewhere.) Its range should be bigger than the charger&amp;#8217;s maximum output voltage.&lt;/p&gt;

&lt;p&gt;In desperate times, all of this can be done with just a voltage-down transformer and a diode bridge. Everything else is optional, if you&amp;#8217;re careful. Otherwise, you&amp;#8217;ll zap batteries, since 1925:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Zap batteries!' src='/assets/images/2012.11.14-zap_batteries.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;If a transformer&amp;#8217;s winding is too thin (say, less than 1 mm&lt;sup&gt;2&lt;/sup&gt; with 5 amps DC on the output), you&amp;#8217;ll fry it:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Fry transformers!' src='/assets/images/2012.11.14-burnt.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;On a whole different note: is this all we&amp;#8217;ve been up to last month? A makeshift car battery charger?.. Of course not.&lt;/p&gt;

&lt;p&gt;What was it? Well, tune up your internet receivers, it&amp;#8217;s &lt;a href='/2012/11/18/chairs_on_rails/'&gt;coming soon&lt;/a&gt;!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>CatNip ADC performance measurement</title>
   <link href="http://wemakethings.net/2012/10/12/catnip-adc"/>
   <updated>2012-10-12T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/10/12/catnip-adc</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve quickly measured ADC performance by putting a 2 x 10K voltage divider into ADC0 and taking 64K samples. This by no means is a proper test, but let the images speak for themselves.&lt;/p&gt;

&lt;p&gt;ADC performance of Microbuilder&amp;#8217;s design on a board fabricated by us before:&lt;img alt='ADC performance Microbuilder' src='/assets/images/2012.10.12-adc-microbuilder.png' /&gt;&lt;/p&gt;

&lt;p&gt;ADC performance of &lt;a href='http://wemakethings.net/2012/10/04/catnip'&gt;CatNip&lt;/a&gt;:&lt;img alt='ADC performance CatNip' src='/assets/images/2012.10.12-adc-catnip.png' /&gt;&lt;/p&gt;

&lt;p&gt;Here is the histogram comparison:&lt;img alt='ADC performance CatNip' src='/assets/images/2012.10.12-adc-histogram.png' /&gt;&lt;/p&gt;

&lt;p&gt;It seams, the effort I put while routing ADC traces is paying off&amp;#8230;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>CatNip - LPC1343 development board</title>
   <link href="http://wemakethings.net/2012/10/04/catnip"/>
   <updated>2012-10-04T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/10/04/catnip</id>
   <content type="html">&lt;p&gt;Roughly a year ago we have &lt;a href='http://wemakethings.net/2012/01/17/modifying-the-lpc1343-devboard/'&gt;expressed our interest&lt;/a&gt; in ARM based micro controllers and a concern in shortage of devboards of these to order. After doing a couple of projects on our &lt;a href='http://wemakethings.net/2012/02/02/lpc1343-devboard-continued/'&gt;cheapo-pro&lt;/a&gt; made boards I&amp;#8217;ve stumbled on lack of some features I want and I ran out of my boards. I wanted an ARM devboard tailored for my purposes. So, what does one do in such circumstances in our open hardware world of freedom? Roll your own of course! After a week long routing and 5 months wait for the customs and post offices to resolve &amp;#38;#279; in my name, today I&amp;#8217;ve accidentally met the postman and saved myself a trip to a post office:&lt;/p&gt;

&lt;p&gt;&lt;img alt='CatNip' src='/assets/images/2012.10.04-catnip_board.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;So, the devboard is based on &lt;a href='http://www.microbuilder.eu/projects/LPC1343ReferenceDesign/'&gt;LPC1343 Reference Design&lt;/a&gt; by Microbuilder and the main differences are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;USB connection header is added in order to facilitate adding an external case mounted USB connector that is placed far away from the board&lt;/li&gt;

&lt;li&gt;RESET pin is in a breakout in order to allow putting a reset button on the device case&lt;/li&gt;

&lt;li&gt;non-usb power is connected via screw terminals&lt;/li&gt;

&lt;li&gt;eeprom in SO8 package is used as it&amp;#8217;s more common&lt;/li&gt;

&lt;li&gt;separate power header is added to export regulated and incoming voltages to daughter boards&lt;/li&gt;

&lt;li&gt;most of 3.3 V and GND connections removed from breakout as it encourages ground loops, GND connections are left near communication pins (SPI, I2C, RXTX) for easier prototyping, 3.3 V connection is left near ADC inputs as it&amp;#8217;s handy to limit ADC input to 3.3 V by adding a diode&lt;/li&gt;

&lt;li&gt;all UART pins except RX and TX are reclaimed for other purposes&lt;/li&gt;

&lt;li&gt;more ADC pins added&lt;/li&gt;

&lt;li&gt;onboard LED pin is added to header&lt;/li&gt;

&lt;li&gt;JTAG connector removed and it&amp;#8217;s pins reclaimed for GPIO/ADC (I don&amp;#8217;t have a JTAG programmer currently)&lt;/li&gt;

&lt;li&gt;an effort has been made to not to route digital lines under ADC lines in order to achieve ADC performance that &lt;a href='http://wemakethings.net/2012/10/12/catnip-adc/'&gt;sucks less&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted myself a board that I could use in projects I do and leave it there, the board should be big enough to support expansion &amp;#8220;shields&amp;#8221; and it had to be easy to put the board into random box that has all connectors mounted - I didn&amp;#8217;t like the idea of exposing on-board mini-USB connector to hostile outside world, neither I liked the idea of 2.5mm power jack. I like to connect analog and digital grounds at power supply, hence the single power export to daughter boards.&lt;/p&gt;

&lt;p&gt;The eagle files are available on my github: &lt;a href='https://github.com/Miceuz/CatNip'&gt;https://github.com/Miceuz/CatNip&lt;/a&gt;. The board is compatible with original &lt;a href='https://github.com/microbuilder/LPC1343CodeBase'&gt;firmware library by Microbuilder&lt;/a&gt;, but you also can check my own fork: &lt;a href='https://github.com/Miceuz/LPC1343CodeBase]'&gt;https://github.com/Miceuz/LPC1343CodeBase&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In general, what I like most about this design is that LPC1343 micro has USB 2.0 hardware inside and together with eeprom chip onboard, it let&amp;#8217;s you perform configuration of your device &amp;#8220;in the field&amp;#8221;. Microbuilder has started a good initiative by writing an easy and flexible command line framework, so a standard blinky example comes with a command line interface that you can access by virtual serial port. I&amp;#8217;m working on adding various peripheral functions like ADC, SPI, PWM, I2C to the command line so it has some resemblance to bus pirate for free. Another thing - it has internal boot loader by NXP, that makes the chip to appear as a mass storage device in programming mode - you just copy your new firmware and reset the chip - no external programmer hardware is required. On compiling side - GNU development environment is available. Oh, BTW, did I mention that you can find LPC1343 for cheaper than ATMEGA328?&lt;/p&gt;

&lt;p&gt;I have parts and PCBs for 10 boards and currently have no intention to sell them. The price I was able to achieve is $12.20 per board on this small run, so if someone would like to get one for $25 or so, ping me or get ir from &lt;a href='https://tindie.com/miceuz/lpc1343-arm-devboard/'&gt;tindie.com&lt;/a&gt;, I might do another run. But you can hardly beat TI stellaris launchpad for five bucks and free shipping&amp;#8230;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Capacitance measurement using low pass filter</title>
   <link href="http://wemakethings.net/2012/09/26/capacitance_measurement"/>
   <updated>2012-09-26T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/09/26/capacitance_measurement</id>
   <content type="html">&lt;p&gt;Update 2012-11-30 &lt;strong&gt;A new working vesion of &lt;a href='http://wemakethings.net/chirp'&gt;plant watering alarm&lt;/a&gt; is available for sale! It&amp;#8217;s open source and it goes &lt;a href='http://wemakethings.net/chirp'&gt;Chirp!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So I&amp;#8217;m building the new version of my &lt;a href='http://wemakethings.net/2012/06/21/plant_watering_alarm'&gt;Plant Watering Alarm&lt;/a&gt;. I&amp;#8217;m doing it based on capacitive humidity sensing - damp soil acts as an electrolyte increasing the capacitance of some makeshift capacitor made of couple of traces on PCB. I&amp;#8217;m currently just counting amount of processor ticks while charging the capacitor till 0.63Vcc and it&amp;#8217;s working quite OK, but a few days ago I have stumbled on this technique to measure capacitance:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Capacitance measurement idea' src='/assets/images/2012.09.26-capacitance_measurement_idea.png' /&gt;&lt;/p&gt;

&lt;p&gt;Idea is straight forward - you feed square wave into low pass filter composed of a resistor and your probe as capacitor C1. As capacitance of C1 changes, so does cut off frequency of this low pass filter, lowering the peaks of output waveform, then this kinda-triangular waveform is rectified by a diode D1 and a capacitor C2 to give voltage estimation of capacitance of C1. Here you can see an approximation of what I saw on my shabby analog scope:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Filter output' src='/assets/images/2012.09.26-triangular_wave_plot.png' /&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve instantly put together a circuit using 555 timer to generate a square wave. While playing with the circuit I&amp;#8217;ve noticed that when I increase C1 or R1, peak values do not go lower linearly, then I&amp;#8217;ve noticed, that capacitor does not discharge fully as square wave is exactly 50% - so the peak-to-peak value is changing, not zero-to-peak. This creates some problems as voltage on the rectified output would not swing as much as it could, we are loosing dynamic range&amp;#8230;&lt;/p&gt;

&lt;p&gt;The fix was easy - just discharge C1 on zero phase of square wave. You could use a PNP transistor for that:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Add a PNP transistor' src='/assets/images/2012.09.26-capacitance_measurement_pnp.png' /&gt;&lt;/p&gt;

&lt;p&gt;It looked much better on the scope, but there is one slight problem - emitter-base junction will conduct until there is more than 0.7V difference between them. So, I&amp;#8217;m left with constant 0.7V on C1 after each charge/discharge cycle. Ok, lets use two transistors:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Proper way to discharge this cap' src='/assets/images/2012.09.26-capacitance_measurement_npn.png' /&gt;&lt;/p&gt;

&lt;p&gt;Q3 acts as a logic NOT component outputting HIGH, when the square wave goes LOW - this turns Q2 on really hard and capacitor discharges until it reaches Vce of the transistor which is much lower than 0.7V. OK, so far so good, I can go on with calculations: &lt;strong&gt;what is the most optimal value for R1 so I would have the biggest voltage swing in my capacitance range?&lt;/strong&gt; Here comes The Formula (taken from the great &lt;a href='http://www.electronics-tutorials.ws/rc/rc_1.html'&gt;Electronics Tutorial about the RC Time Constant&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;img alt='The Formula' src='/assets/images/2012.09.26-the_formula.png' /&gt;&lt;/p&gt;

&lt;p&gt;Vc is voltage across capacitor, Vs is square wave HIGH voltage, t is time, R and C are resistance and capacitance of your RC network. OK, lets &lt;a href='http://www.wolframalpha.com/share/clip?f=d41d8cd98f00b204e9800998ecf8427ecrdgbr1joh'&gt;put it&lt;/a&gt; into Wolframalpha:&lt;/p&gt;

&lt;p&gt;&lt;img alt='8mhz 4.1K' src='/assets/images/2012.09.26-WolframAlpha--3__1_-_e-162510-94152C_C710-12_to_4210-12--2012-09-26_1702.png' /&gt;&lt;/p&gt;

&lt;p&gt;This is a graph of Vc for t=62.5ns, R=4.1K and capacitance from 7pF to 42pF as this is my current probe capacitance range when in air and when fully submersed in water. Not too linear, but oh well, tradeoffs must be made.&lt;/p&gt;

&lt;p&gt;I know 4.1K is optimal because of &lt;a href='http://www.wolframalpha.com/share/clip?f=d41d8cd98f00b204e9800998ecf8427ebdqno2m8mv'&gt;this graph&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img alt='deltaV' src='/assets/images/2012.09.26-WolframAlpha--plot_3__1_-_e-62510-9R710-12_-_3__1_-_e-162510-9R4210-12_R_100_to_8000--2012-09-26_1406.png' /&gt;&lt;/p&gt;

&lt;p&gt;On Y axis there is a voltage difference between points at 7pF and 42pF and on X axis is resistance of R1. Heck, I can calculate that &lt;a href='http://www.wolframalpha.com/share/clip?f=d41d8cd98f00b204e9800998ecf8427e1sauhq2cg8'&gt;precisely&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Exact value for R1' src='/assets/images/2012.09.26-maximize.png' /&gt;&lt;/p&gt;

&lt;p&gt;So, optimal value for R1 is 4.1K and voltage swing is from 2.66V to 1.57 minus the diode drop. The response is not linear, so R1 could be chosen smaller so the graph would shift to more linear region or it can be handled in software.&lt;/p&gt;

&lt;p&gt;On final note, I&amp;#8217;m yet to build a prototype based on this technique. I&amp;#8217;m not sure if all of this will go into Plant Watering Alarm as it&amp;#8217;s working quite ok in its current iteration. 1.75V is 1.74/(3V/1024)=596 values on Attiny44 10 bit ADC, it could be improved by adding an external voltage reference or doing some op-amp shifting/scaling kung fu, but it&amp;#8217;s not really feasible for such a simple device as Plant Watering Alarm is ment to be. Maybe I will get on building a high end soil moisture probe, so let me know if you would be interested in that.&lt;/p&gt;

&lt;p&gt;Meanwhile here&amp;#8217;s a sneak peak preview of current iteration of Plant Watering Alarm:&lt;/p&gt;

&lt;p&gt;&lt;img alt='plant watering alarm' src='/assets/images/2012.09.26-plant_watering_alarm.jpg' /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Phono preamp as a first electronics project</title>
   <link href="http://wemakethings.net/2012/09/21/phono_preamp"/>
   <updated>2012-09-21T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/09/21/phono_preamp</id>
   <content type="html">&lt;p&gt;&lt;em&gt;Mr. Hat&lt;/em&gt; contacted me asking for a help in building a phono preamp for his vinyl record player that he recovered from oblivion somewhere.&lt;/p&gt;

&lt;p&gt;As you probably know, there are some issues with vinyl records that require audio tracks to be mastered in certain way before they are put into a disc. Particularly, you have to attenuate low frequencies, so that the needle won&amp;#8217;t jump between tracks when that kick drum is really delivering, and you have to amplify high frequencies so that they rise above the noise floor. When you want to play a record back, you have to reverse this process - amplify lows and attenuate highs - that&amp;#8217;s why you need a phono preamplifier.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Mr. Hat&lt;/em&gt; has chosen &lt;a href='http://www.recordingmag.com/resources/resourceDetail/319.html'&gt;this design&lt;/a&gt; for his build. There are lots of other phono preamp designs that have a potential to be better, but I&amp;#8217;ve told him to simmer down - when you are building your First Project, you want results and you want them fast. So I skipped on all that fancy unobtanium audio purposed polystyrene capacitors and designed in simple plain ceramics with horrible tolerances that I believe will make real audiophiles turn blue. I&amp;#8217;ve etched a couple PCBs so he wouldn&amp;#8217;t need to make a mess on a protoboard.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Phono preamp schematics' src='/assets/images/2012.09.21-phono_preamp_schematics.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;This was my first attempt at designing for success from the first try and I&amp;#8217;ve failed miserably in designing a two rail power supply. At first the footprint for bridge rectifier was wrong, then I&amp;#8217;ve discovered that pinouts for LM79XX parts differ from LM78XX. Yeah, never assume anything and double check the pinout ant footprint. The power supply turned out as retarded as it can go - when cutting traces to fix the LM79XX pinout I&amp;#8217;ve cut the wrong traces! Later i&amp;#8217;ve discovered that LM79XX parts need more capacitance on the output than LM78XX, as negative rail was oscillating like hell!&lt;/p&gt;

&lt;p&gt;&lt;img alt='Retarded power supply' src='/assets/images/2012.09.21-phono_power.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Not so good split power supply' src='/assets/images/2012.09.21-phono_power_schematics.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;And finally, relaying on this design for two rail power supply is just dumb as output tolerances for LM78XX and LM79XX are 2% to 4% when you get them from reliable manufacturer, in other words, you won&amp;#8217;t have you rail voltages to be equal unless you handpick the matching parts. I&amp;#8217;d better just put a 24V linear regulator, split its output via 1% tolerance resistors and buffered that with op-amp.&lt;/p&gt;

&lt;p&gt;I made &lt;em&gt;Mr. Hat&lt;/em&gt; to solder his first project in SMD and he managed it ok, but goofed up the wires horribly.&lt;/p&gt;

&lt;p&gt;&lt;img alt='First time SMD soldering' src='/assets/images/2012.09.21-phono_preamp.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Later he made an enclosure from copper clad board.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Phono preamp in a box' src='/assets/images/2012.09.21-phono_case.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;It didn&amp;#8217;t work on the first try - &lt;em&gt;Mr. Hat&lt;/em&gt; had messed up some mechanics in a turntable and outputs were shorted, but after some poking with multimeter and a little bit of common sense, we have found a part that was upside down. After dealing with that, we&amp;#8217;ve heard that special popping sound of vinyl and the first chords - the eyes of &lt;em&gt;Mr. Hat&lt;/em&gt; were glowing and the mouth had that sleazy smile - it works!&lt;/p&gt;

&lt;p&gt;If someone is interested in ready made Eagle files, you can get them form my github repository: &lt;a href='https://github.com/Miceuz/PhonoPreamp'&gt;https://github.com/Miceuz/PhonoPreamp&lt;/a&gt; (power bugs were fixed)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Bus Pirate and random plasma TV indicator</title>
   <link href="http://wemakethings.net/2012/08/20/bus_pirate_and_random_plasma_tv_indicator"/>
   <updated>2012-08-20T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/08/20/bus_pirate_and_random_plasma_tv_indicator</id>
   <content type="html">&lt;p&gt;We found a plasma TV by the dumpster. Lots of neat stuff inside. Say, this here 6-LED indicator with a M62320FP chip, an I/O port expander for I2C. Not to mention all the aluminum&amp;#8230;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Bus Pirate v3.5' src='/assets/images/2012.08.20-bus_pirate.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='6 LEDs, one I2C demultiplexer' src='/assets/images/2012.08.20-indicator.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Very conveniently, BP has a BASIC interpreter, enough to goof around.&lt;/p&gt;
&lt;div class='highlight'&gt;&lt;pre&gt;&lt;code class='vbnet'&gt;&lt;span class='mi'&gt;10&lt;/span&gt;   &lt;span class='c'&gt;REM PROGRESSBAR&lt;/span&gt;
&lt;span class='mi'&gt;20&lt;/span&gt;   &lt;span class='k'&gt;LET&lt;/span&gt; &lt;span class='n'&gt;A&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;116&lt;/span&gt;
&lt;span class='mi'&gt;30&lt;/span&gt;   &lt;span class='k'&gt;LET&lt;/span&gt; &lt;span class='n'&gt;M&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;255&lt;/span&gt;
&lt;span class='mi'&gt;40&lt;/span&gt;   &lt;span class='k'&gt;LET&lt;/span&gt; &lt;span class='n'&gt;V&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;63&lt;/span&gt;
&lt;span class='mi'&gt;50&lt;/span&gt;   &lt;span class='n'&gt;START&lt;/span&gt;
&lt;span class='mi'&gt;60&lt;/span&gt;   &lt;span class='n'&gt;SEND&lt;/span&gt; &lt;span class='n'&gt;A&lt;/span&gt;
&lt;span class='mi'&gt;70&lt;/span&gt;   &lt;span class='n'&gt;SEND&lt;/span&gt; &lt;span class='n'&gt;M&lt;/span&gt;
&lt;span class='mi'&gt;80&lt;/span&gt;   &lt;span class='n'&gt;SEND&lt;/span&gt; &lt;span class='n'&gt;V&lt;/span&gt;
&lt;span class='mi'&gt;90&lt;/span&gt;   &lt;span class='k'&gt;STOP&lt;/span&gt;
&lt;span class='mi'&gt;100&lt;/span&gt;  &lt;span class='n'&gt;DELAY&lt;/span&gt; &lt;span class='mi'&gt;500&lt;/span&gt;
&lt;span class='mi'&gt;120&lt;/span&gt;  &lt;span class='c'&gt;REM IF V=0 THEN GOTO 150&lt;/span&gt;
&lt;span class='mi'&gt;121&lt;/span&gt;  &lt;span class='k'&gt;IF&lt;/span&gt; &lt;span class='n'&gt;V&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;0&lt;/span&gt; &lt;span class='k'&gt;THEN&lt;/span&gt; &lt;span class='k'&gt;LET&lt;/span&gt; &lt;span class='n'&gt;V&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='mi'&gt;127&lt;/span&gt;
&lt;span class='mi'&gt;125&lt;/span&gt;  &lt;span class='k'&gt;LET&lt;/span&gt; &lt;span class='n'&gt;V&lt;/span&gt;&lt;span class='o'&gt;=&lt;/span&gt;&lt;span class='n'&gt;V&lt;/span&gt;&lt;span class='o'&gt;/&lt;/span&gt;&lt;span class='mi'&gt;2&lt;/span&gt;
&lt;span class='mi'&gt;130&lt;/span&gt;  &lt;span class='k'&gt;GOTO&lt;/span&gt; &lt;span class='mi'&gt;50&lt;/span&gt;
&lt;span class='mi'&gt;150&lt;/span&gt;  &lt;span class='k'&gt;END&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Should have made a cylon, yeah.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Drum coffee roaster, complete</title>
   <link href="http://wemakethings.net/2012/07/27/coffee_roaster_complete"/>
   <updated>2012-07-27T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/07/27/coffee_roaster_complete</id>
   <content type="html">&lt;p&gt;We are almost out of coffee again, so &lt;a href='/2012/07/14/coffee_roaster_revisited/'&gt;the fixed roaster&lt;/a&gt; is going for a hot run. On a sunny day, we took our green beans, 4,5 kg this time, and went outside the workshop.&lt;/p&gt;

&lt;p&gt;The setup consists of the roaster itself, a propane gas stove, an electricity extension cord for the motor, and a big pan to rapidly cool the beans when they&amp;#8217;re done (to prevent overroasting).&lt;/p&gt;

&lt;p&gt;One can spin the pan and submerge it in water, exactly what we did on our &lt;a href='/2012/07/04/coffee_roaster/'&gt;first attempt&lt;/a&gt;. This time, though, the pan is made of cast iron (heavy). So instead, we used a compressed air gun.&lt;/p&gt;

&lt;p&gt;There was also a chess table and refreshments, so we could do something while we do nothing.&lt;/p&gt;

&lt;p&gt;We started off by putting a batch of green beans in, 1,5 kg at a time. I&amp;#8217;m sure it could take more, but we didn&amp;#8217;t know the dynamics yet.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Space monkeys, ready to be shot into space' src='/assets/images/2012.07.27-green_coffee_beans_in_roaster.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;And the dynamics, I must tell you, are quite something.&lt;/p&gt;

&lt;p&gt;The first batch took us something like 90 minutes &amp;#8211; on a steady fire that was probably too low. The roast is moderate to medium light, according to &lt;a href='https://en.wikipedia.org/wiki/Coffee_roasting#Degree_of_roast_pictorial'&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The second batch saw a lot more fiddling with the fire. A miniscule turn on the stove&amp;#8217;s handle, and the beans go from moderate light to Spanish black in a matter of minutes. There was also a lot of smoke, but nothing a compressor-powered air gun can&amp;#8217;t handle.&lt;/p&gt;

&lt;p&gt;The third went a lot smoother. We had a handfull of roasted beans from our previous trials, a reference colour to aim for. It still took quite long, almost an hour, since we didn&amp;#8217;t want to screw up the last batch. And it was an hour of playing chess, watching a drum spin, which beats anything.&lt;/p&gt;

&lt;p&gt;After a batch is done in the roaster, we dump it in our pan and cool it.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Roasted coffee beans in a pan' src='/assets/images/2012.07.27-grade4.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Then it goes into an airtight container. In the image below, left to right: batches 1, 3, 2.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Roasted coffee beans in airtight containers' src='/assets/images/2012.07.27-coffee_grades.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a short video of the process.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='yes' frameborder='0' height='315' src='https://www.youtube.com/embed/YDnRKhIKVdw' width='420'&gt;Washing machine drum coffee roaster (live run), on YouTube.&lt;/iframe&gt;&lt;/center&gt;</content>
 </entry>
 
 <entry>
   <title>Upgrade boot process from BIOS+MBR+GRUB to UEFI+GPT+GRUB2 in Arch Linux</title>
   <link href="http://wemakethings.net/2012/07/23/mbr-to-uefi"/>
   <updated>2012-07-23T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/07/23/mbr-to-uefi</id>
   <content type="html">&lt;p&gt;I have a 64-bit system running Arch Linux. MBR and its extended partition is a PITA. I&amp;#8217;ve been using GRUB-Legacy far too long to see its limitations. &lt;a href='https://www.archlinux.org/news/grub-legacy-no-longer-supported/'&gt;Official support was recently dropped&lt;/a&gt;. So now is a good time to update from both in one go.&lt;/p&gt;

&lt;p&gt;This is my log of how I did it. It worked for me, it might not work for you. I omit the details and specific commands and provide source links instead. Have a general understanding of what you are doing. If you do not need/want UEFI, or GPT, or GRUB2, if you don&amp;#8217;t see the benefits of either, or if you not know what &lt;code&gt;modprobe&lt;/code&gt; does, this &amp;#8220;guide&amp;#8221; is not for you.&lt;/p&gt;

&lt;p&gt;Read the entire post before you do anything.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make full system backup.&lt;/li&gt;

&lt;li&gt;Make rescue media. I have &lt;a href='http://gparted.sourceforge.net/livecd.php/'&gt;GParted Live&lt;/a&gt;, &lt;a href='http://www.sysresccd.org/SystemRescueCd_Homepage'&gt;SystemRescueCD&lt;/a&gt;, &lt;a href='https://wiki.archlinux.org/index.php/Archboot'&gt;Archboot&lt;/a&gt;, &lt;a href='http://www.linuxmint.com/download.php'&gt;Linux Mint&lt;/a&gt; and &lt;a href='http://www.ubuntu.com/download'&gt;Ubuntu&lt;/a&gt;. Get your own and learn to use it.&lt;/li&gt;

&lt;li&gt;Edit partition table. Make space for a &lt;a href='https://wiki.archlinux.org/index.php/UEFI'&gt;UEFISYS partition&lt;/a&gt;, leave space at the beginning and end of hard drive for the &lt;a href='https://wiki.archlinux.org/index.php/GUID_Partition_Table'&gt;GPT&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;&lt;a href='https://wiki.archlinux.org/index.php/Grub#Backup_Important_Data'&gt;Backup MBR&lt;/a&gt;. Also, copy this backup to external backup media.&lt;/li&gt;

&lt;li&gt;Reboot, enable EFI and see if you can boot. If so, you&amp;#8217;re good to go. If not, reboot in BIOS mode. Continue at your own risk. You will have to use GRUB rescue mode later.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;modprobe efivars&lt;/code&gt; to enable &lt;code&gt;efibootmgr&lt;/code&gt; operation. If &lt;code&gt;/sys/firmware/efi&lt;/code&gt; is populated, you&amp;#8217;re good to go. If not, continue at your own risk. You will have to use GRUB rescue mode later.&lt;/li&gt;

&lt;li&gt;&lt;a href='https://wiki.archlinux.org/index.php/GUID_Partition_Table#Convert_from_MBR_to_GPT'&gt;Convert from MBR to GPT&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;&lt;a href='https://wiki.archlinux.org/index.php/UEFI#Create_an_UEFI_System_Partition_in_Linux'&gt;Create the UEFISYS partition&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;&lt;a href='https://wiki.archlinux.org/index.php/Grub#Backup_Important_Data'&gt;Backup GRUB-Legacy&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;&lt;a href='https://wiki.archlinux.org/index.php/Grub#UEFI_systems_2'&gt;Install &lt;code&gt;grub-efi-x86_64&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;If &lt;code&gt;&amp;#39;modprobe efivars&amp;#39;&lt;/code&gt; worked previously, you&amp;#8217;re more or less done.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If it didn&amp;#8217;t work, &lt;code&gt;&amp;#39;grub-install&amp;#39;&lt;/code&gt; will fail with&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Fatal: Couldn&amp;#39;t open either sysfs or procfs directories for accessing EFI variables.&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After all, it&amp;#8217;s still booted in BIOS mode without UEFI.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reboot, enter UEFI menu and boot through &lt;a href='https://bbs.archlinux.org/viewtopic.php?id=85603'&gt;GRUB2 rescue mode&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;&lt;a href='https://wiki.archlinux.org/index.php/Grub#Install_grub-uefi_boot_files'&gt;Reinstall &lt;code&gt;grub-uefi&lt;/code&gt; boot files&lt;/a&gt;.&lt;/li&gt;

&lt;li&gt;Break open the champagne. If not, set yourself on fire and run in circles.&lt;/li&gt;
&lt;/ol&gt;</content>
 </entry>
 
 <entry>
   <title>Drum coffee roaster, revisited</title>
   <link href="http://wemakethings.net/2012/07/14/coffee_roaster_revisited"/>
   <updated>2012-07-14T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/07/14/coffee_roaster_revisited</id>
   <content type="html">&lt;h1 id='manual_mode_trials'&gt;Manual mode trials&lt;/h1&gt;

&lt;p&gt;My &lt;a href='/2012/07/04/coffee_roaster/'&gt;previous attempts at mechanising coffee bean roasting&lt;/a&gt; were unsuccessful, so I slapped on a handle to rotate the drum manually.&lt;/p&gt;

&lt;p&gt;It worked pretty well until I noticed something odd: beans started falling out of the drum, like if there was a hole big enough. I know there weren&amp;#8217;t any, at least until I hadn&amp;#8217;t put a gas stove under the drum.&lt;/p&gt;

&lt;p&gt;Turned out the doors of the drum were attached to its frame with plastic. Plastic! It wouldn&amp;#8217;t melt at the measly 90°C inside a washing machine. But it did in my case.&lt;/p&gt;

&lt;p&gt;So I took the doors out and continued with the operation, now rocking the handle back and forth at an appropriate speed, so the beans would keep roasting. I later used a propane torch to burn all the plastic out, then washed the drum with water to remove any residue.&lt;/p&gt;

&lt;p&gt;It became evident at this point that the 2 RPM motor I intended to use previously would have been too slow, and my coffee would have burned. So fortunate it didn&amp;#8217;t work.&lt;/p&gt;

&lt;p&gt;Besides all that, it actually requires two people for this mode of operation: one rocking the handle, and one checking if the beans are done, taking a small batch of them out with a spoon and comparing color to the reference.&lt;/p&gt;

&lt;p&gt;If I had to continue with the roaster like this, I would have turned those four big screws by the doors around, so they would act as stops, bumping into those &amp;#8220;ribs&amp;#8221; that hold the device together, preventing the hole which was previously a door from pointing downwards and dumping all the beans directly on top of the stove.&lt;/p&gt;

&lt;p&gt;But really, for a lazy engineer like me, all of this was too much physical labour. I took it back to the workshop.&lt;/p&gt;

&lt;h1 id='doors'&gt;Doors&lt;/h1&gt;

&lt;p&gt;First thing first, I fixed the doors. That is, I put a 5 mm stainless steel rod and a few bushings in.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Drum door with stainless steel rod, damaged spring visible' src='/assets/images/2012.07.14-damaged_spring_on_drum.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The spring that opens the door had to be cut, since &lt;em&gt;ioch&lt;/em&gt; damaged half of it while trying to scrape the plastic out. I just burnt it out later, but the spring was already twisted.&lt;/p&gt;

&lt;h1 id='motor_mounting'&gt;Motor mounting&lt;/h1&gt;

&lt;p&gt;We also got a new motor: 4,0 W (although looks like 40), 975 RPM, with a reduction gearbox that brings it down to 10 RPM. Solid-core Soviet unobtanium, made in 1979. I cut and tapped a mounting bracket that attaches to the legs with two screws.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Motor and mounting bracket' src='/assets/images/2012.07.14-motor_mount.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Mounted, it looks like so.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Motor, mounted on the side' src='/assets/images/2012.07.14-motor_attached.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='motor_coupling'&gt;Motor coupling&lt;/h1&gt;

&lt;p&gt;What I forgot to photograph in the previous post and therefore couldn&amp;#8217;t properly explain was how the drum was being rotated. So here&amp;#8217;s the catch.&lt;/p&gt;

&lt;p&gt;The shaft of the motor had a small steel gear attached to it.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Gear on motor shaft' src='/assets/images/2012.07.14-motor_shaft_gear.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I took it off and welded two thick strips of steel to it.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Modified gear to go back on the motors shaft' src='/assets/images/2012.07.14-spinner_grip_head_welded.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Why would I do that? Here&amp;#8217;s why.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Shaft-drum coupling method' src='/assets/images/2012.07.14-spinner_grip_head_in_action.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;This is how the motor is coupled to the drum. A T-shape is screwed to the axis shaft of the drum, and the motor shaft&amp;#8217;s head (modified gear in this case) has a &amp;#8220;prong&amp;#8221;. As the motor rotates, the prong pushes on the T-shape, forcing the drum to rotate.&lt;/p&gt;

&lt;p&gt;This method has a lot of slack, an advantage in this case, since things aren&amp;#8217;t perfectly centered. It&amp;#8217;s probably been patented by some wanker, too.&lt;/p&gt;

&lt;h1 id='the_test'&gt;The test&lt;/h1&gt;

&lt;p&gt;There were no coffee beans around this time, so I used a box of screws. It felt something like 1,5 kg. And it worked! The motor spins.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='yes' frameborder='0' height='315' src='https://www.youtube.com/embed/Q8UA0ub4j-Q' width='420'&gt;Washing machine drum coffee roaster (test run), on Youtube.&lt;/iframe&gt;&lt;/center&gt;
&lt;p&gt;It is still to be &lt;a href='/2012/07/27/coffee_roaster_complete/'&gt;tested with real beans&lt;/a&gt;, though.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Drum coffee roaster</title>
   <link href="http://wemakethings.net/2012/07/04/coffee_roaster"/>
   <updated>2012-07-04T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/07/04/coffee_roaster</id>
   <content type="html">&lt;p&gt;There are two reasons why this contraption came to be.&lt;/p&gt;

&lt;p&gt;First, we like coffee. We like a lot of coffee, a lot. Ground coffee from the shop is crap, most of it. Unground beans are twice as expensive. What do you usually do in this case?&lt;/p&gt;

&lt;p&gt;You &lt;a href='http://www.cafe-libertad.de/shop/'&gt;buy it online&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Second, you eventually buy several bags of unground beans, and then realise you have no idea how to roast them.&lt;/p&gt;

&lt;p&gt;There are a lot of simple and time-consuming methods. Roasting &lt;a href='https://www.youtube.com/watch?v=LMEpSuGboZc'&gt;in a frying pan&lt;/a&gt; takes, say, 3 hours of non-stop work to make a kilo of the good stuff. You can&amp;#8217;t stick a lot &lt;a href='https://www.youtube.com/watch?v=gslCRG1aBBE'&gt;in the oven&lt;/a&gt;, too. One could even do it &lt;a href='https://www.youtube.com/watch?v=D0Y5ojdVWxE'&gt;in a popcorn popper&lt;/a&gt; or &lt;a href='https://www.youtube.com/watch?v=Vd4_CWEnaYg'&gt;between two meshes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This last video got me thinking. A cross between that and an &lt;a href='https://www.youtube.com/watch?v=DYsWECLaakI'&gt;industrial drum&lt;/a&gt; would be nice. Perhaps a top-loaded washing machine drum, with an electric motor on the side and a gas stove beneath.&lt;/p&gt;

&lt;h1 id='drums_and_bearings'&gt;Drums and bearings&lt;/h1&gt;

&lt;p&gt;Consequently, I was much pleased when this appeared in the workshop.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Washing machine drum, covered in lime and soap' src='/assets/images/2012.07.04-washmachine_drum.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Oh, the things that break and get thrown out!.. My heart sings as I wash them in acid.&lt;/p&gt;

&lt;p&gt;This stainless steel drum has a bearing on either side of the axis. You can see one in the picture above. We got two precision circular mounts for the bearings, made by a professional machinist.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Bearing mounts' src='/assets/images/2012.07.04-bearing_mounts.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;There was also a drawing somewhere on that table, but the whole project went artsy so early on the drawing is not relevant to anything.&lt;/p&gt;

&lt;p&gt;I welded the mounts to strips of 4 mm metal, working it in small increments to prevent warping.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Bearing mounts, welded' src='/assets/images/2012.07.04-bearing_mounts_welded.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='legs'&gt;Legs&lt;/h1&gt;

&lt;p&gt;The roaster stands on four legs, two on either side, welded to the metal strips on the outside (so they don&amp;#8217;t touch the rotating drum). Square pipe was used here.&lt;/p&gt;

&lt;p&gt;Thickness is more or less arbitrary. As to length, I used the diameter of my drum as the dimension. Make it such that the legs and ground form an equilateral triangle. As you remember from &lt;a href='https://en.wikipedia.org/wiki/Equilateral_triangle'&gt;school&lt;/a&gt;, it is then trivial to calculate their position on the side strips.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Legs welded to side plates, aligning motor mount brackets' src='/assets/images/2012.07.04-legs_welded.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='motors'&gt;Motors&lt;/h1&gt;

&lt;p&gt;The above image also shows how a motor is to be attached. There are two brackets pointing outwards. A plate of some sort is attached to the motor, and that in turn attaches to the brackets. Why a proxy? Because there&amp;#8217;s only so much space. And it&amp;#8217;s good to be motor-agnostic in case a motor doesn&amp;#8217;t work.&lt;/p&gt;

&lt;p&gt;Anyway, the attachment plate has threaded taps to screw the motor on. There are also two threaded taps on the sides of the plate. Their centers are set apart as far as centers of the holes on the brackets. The latter are much bigger (10 mm against 6 mm), so that after the motor is mounted, it can be pushed around a little. This allows centering the motor along the drum&amp;#8217;s center axis.&lt;/p&gt;

&lt;p&gt;You can see now that our thinking here was quite center-centered. That&amp;#8217;s for a reason: a motor will be spinning quite a load here. Speed is negligible enough as far as bearing alignment is concerned, but the motor&amp;#8217;s grip alignment isn&amp;#8217;t. Besides, it gives an angle at compensating misproper alignment in everything else.&lt;/p&gt;

&lt;p&gt;This scheme is implemented on both sides of the drum. They are not identical: there are four brackets on the other side, which allows mounting a much heavier three-phase motor to be controlled with &lt;em&gt;miceuz&amp;#8217;&lt;/em&gt; &lt;a href='http://blog.hardcore.lt/mic/archives/011040.html'&gt;variable frequency drive and a foot pedal&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img alt='A motor on either side of the drum' src='/assets/images/2012.07.04-motors_from_sides.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Of course, only one motor is to be mounted at any given time.&lt;/p&gt;

&lt;p&gt;I forgot to take pictures of how the motor actually grips the drum to spin it. Maybe in a &lt;a href='/2012/07/14/coffee_roaster_revisited/'&gt;follow-up post&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id='ribs_and_assembly'&gt;Ribs and assembly&lt;/h1&gt;

&lt;p&gt;When the leg parts that go on the sides of the drum were all welded together and cooled down, I inserted the bearings and gently tapped them in using a round piece of wood and a hammer. I then assembled them on the drum and measured the distance between the legs on either side.&lt;/p&gt;

&lt;p&gt;There were two holes on each leg, drilled prior to all the welding (for ease of manufacture). They are further away from the top end than the radius of the drum.&lt;/p&gt;

&lt;p&gt;I measured the distance between the legs on opposite sides of the drum, and cut four pieces of the same square pipe I had. These are for stability, to disallow mischievous acts of falling apart and rolling away.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Ribs' src='/assets/images/2012.07.04-side_rib.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Accidentally, it allows taking the machine apart, and putting most of it &lt;em&gt;inside&lt;/em&gt; the drum, for easy storage and transportation.&lt;/p&gt;

&lt;h1 id='turning_beans'&gt;Turning beans&lt;/h1&gt;

&lt;p&gt;You might have also noticed the drum has largish holes along its outer surface. One could weld them over to prevent beans from falling out. But I screwed in some screws instead. They are, of course, stainless steel.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Screws from the inside of the drum' src='/assets/images/2012.07.04-inside_screws.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;This helps in turning the beans while the drum rotates.&lt;/p&gt;

&lt;h1 id='tests'&gt;Tests&lt;/h1&gt;

&lt;p&gt;One thunderous rainy night, as soon as all the chores were done, we decided to have our share of fun and run a few tests.&lt;/p&gt;

&lt;p&gt;And I hate to disappoint, but both motors failed and there are no videos of proof.&lt;/p&gt;

&lt;p&gt;The smaller motor, 2 RPM, four puny watts of power in a reduction gearbox, failed to lift 1,5 kg of beans. Not enough torque, &lt;a href='https://en.wikipedia.org/wiki/Torque'&gt;lever-arm distance&lt;/a&gt; too big.&lt;/p&gt;

&lt;p&gt;The bigger one, too, couldn&amp;#8217;t lift the weight all by itself: it doesn&amp;#8217;t have a reduction gearbox, although it does have power (140 W). However, if the drum is first spun by hand, and the motor is then turned on, it picks up momentum and keeps spinning jolly. Except one thing: it spins too fast, like a centrifuge, and all the beans get stuck to the drum&amp;#8217;s surface. If there was a burning stove beneath, the beans would get roasted mighty uneven.&lt;/p&gt;

&lt;h1 id='manual_override'&gt;Manual override&lt;/h1&gt;

&lt;p&gt;So I took both motors off, and welded a screw to one side instead, head inwards, and screwed a handle from a meat grinder to it.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Roaster with handle for manual operation' src='/assets/images/2012.07.04-roaster_manual.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;We are yet to &lt;a href='/2012/07/14/coffee_roaster_revisited/'&gt;test this setup&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Push frame for Mercedes-Benz 207D</title>
   <link href="http://wemakethings.net/2012/06/26/push_frame_for_mb_207d"/>
   <updated>2012-06-26T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/06/26/push_frame_for_mb_207d</id>
   <content type="html">&lt;p&gt;Making one piece of &lt;a href='/2012/05/17/engine_hoist_boom_extension_for_mb_207d/'&gt;custom supplementary hardware&lt;/a&gt; is never enough. I was talked into building this one, too, and it&amp;#8217;s proven to be extremely useful.&lt;/p&gt;

&lt;p&gt;Note that this is not a step-by-step how-to on building a push frame for your own MB 207D (or 307D, or any other). It&amp;#8217;s more a description of the thinking and manufacturing process, with a few pitfalls mentioned. Same principles can be used for other vehicles. There are certainly other ways of achieving the same, better or worse.&lt;/p&gt;

&lt;p&gt;And I can&amp;#8217;t be held responsible if a ton of steel crushes someone because of something read online. Duh!&lt;/p&gt;

&lt;h1 id='grand_plan'&gt;Grand plan&lt;/h1&gt;

&lt;p&gt;The issue is as follows: I need to move the van body. Sideways. Then turn it around 180° in a 6x6 meter area. Over and over again.&lt;/p&gt;

&lt;p&gt;We first thought putting frames under each wheel, but decided against it for two reasons. First, I wouldn&amp;#8217;t be able to remove neither the van&amp;#8217;s wheels, nor the axles. Second, the small frame wheels, 16 of them, would cost too much. No, really. Their price is not proportional to size.&lt;/p&gt;

&lt;p&gt;We reckoned there&amp;#8217;s another approach: a frame for the entire body. It goes like this.&lt;/p&gt;

&lt;p&gt;At the front, the radiator is mounted on a cross bar, which is attached to the chassis by eight M10 bolts. I have already removed the entire engine, so anything can be mounted using these screw holes. But here&amp;#8217;s a picture from a long time ago, so you can understand what I&amp;#8217;m writing about.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Mercedes-Benz 207D engine bay, front paneling removed' src='/assets/images/2012-06-26-engine_bay.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;At the back, the tow bar can be removed, giving another eight holes, also M10.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Mercedes-Benz 207D towbar removed' src='/assets/images/2012-06-26-towbar_removed.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Therefore, there are four stable mount points, where plates can be attached to the chassis. Weld four vertical &amp;#8220;legs&amp;#8221; to these plates &amp;#8211; two at the front, two at the back. Weld these legs to cross bars with wheels at both ends. You&amp;#8217;ve got yourself a minimal frame.&lt;/p&gt;

&lt;p&gt;I started off by mocking up a drawing, then taking measurements. I kept revising as I progressed, and here&amp;#8217;s the final version (rear at the top, front at the bottom, dimensions not to scale):&lt;/p&gt;

&lt;p&gt;&lt;img alt='Push frame drawing' src='/assets/images/2012-06-26-drawing.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Notice there&amp;#8217;s a few dimensions missing &amp;#8211; most importantly, everything around the mount points. I&amp;#8217;ve written them down on the plates themselves and forgot to put them in the drawing. Anyway, the spacing between bolts&amp;#8217; center-points are: 97x82 mm at the front, 69x46 mm at the back. Don&amp;#8217;t trust me on this one, though, I&amp;#8217;m from the Internet.&lt;/p&gt;

&lt;p&gt;The spacing for wheel mount plates depends solely on the wheels you&amp;#8217;ve got.&lt;/p&gt;

&lt;h1 id='attaching_the_frame_to_the_chassis'&gt;Attaching the frame to the chassis&lt;/h1&gt;

&lt;p&gt;I first manufactured these 4 plates. They&amp;#8217;re made out of a steel strip 8 mm thick, 100 mm wide, 180/140 mm long for the front/back respectively. Nothing too precise here. What &lt;em&gt;has&lt;/em&gt; to be precise is where you drill the holes. I went and checked immediately after.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Front plate bolt hole alignment test' src='/assets/images/2012-06-26-front_plate_test.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The bolts are 30 mm long, but that&amp;#8217;s not critical. They can be unnecessarily long and give one a pain in the ass when tightening the nuts, if such is the desired effect.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rear plate bolt hole alignment test' src='/assets/images/2012-06-26-rear_plate_test.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here the bolts should be at least 80 mm long (not counting the head, of course). Note that there&amp;#8217;s only about 5 cm of space on the other side, so the bolts can&amp;#8217;t be inserted the other way around.&lt;/p&gt;

&lt;h1 id='wheel_assembly'&gt;Wheel assembly&lt;/h1&gt;

&lt;p&gt;I then built two lower cross bars that the wheels attach to.&lt;/p&gt;

&lt;p&gt;As mentioned, this depends mainly on the wheels on hand. I had four big ones, the specs say they can hold up to 500 kg each. The van&amp;#8217;s body weighs about 500-700 kg, plus 100-200 kg for each axle &amp;#8211; a total of 700-1100 kg, unevenly distributed.&lt;/p&gt;

&lt;p&gt;We decided it would hold.&lt;/p&gt;

&lt;p&gt;For the cross bar, I used 60x60x4 mm square pipe, because it felt solid enough. The van is about 1820 mm wide, so I cut my two pipe segments to that length, then cut two pieces of 40x6 mm strip for each wheel (a total of 8 strips).&lt;/p&gt;

&lt;p&gt;40x4 mm would have worked just as well &amp;#8211; the cross bar is 4 mm thick, after all, and if something broke under the weight, it would be the cross bar. But &lt;em&gt;pwf&lt;/em&gt;, who went to the metal depot, wanted to prove they&amp;#8217;ve got stuff that&amp;#8217;s not available if you&amp;#8217;re ordering online. So 40x6 mm it is.&lt;/p&gt;

&lt;p&gt;Anyway, here&amp;#8217;s a bottom view of the wheel mount. It&amp;#8217;s pre-drilled and TIG-welded for alignment.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Wheel mount cross bar, bottom view, TIG-tac-welded for proper alignment' src='/assets/images/2012-06-26-wheel_mount_point.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;In cases like this, I would now rather weld it on with the wheels attached &amp;#8211; less toying around with precise positioning.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the wheel assembly.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Wheel assembly' src='/assets/images/2012-06-26-wheel_assembly.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;From 10 o&amp;#8217;clock, clockwise: mount plates, rear and front; assembled wheel mounts, top and bottom views; disassembled wheel mount, exploded view.&lt;/p&gt;

&lt;p&gt;Notice that the holes I drilled are not center-aligned. This, again, is solely due to the wheels I&amp;#8217;m using.&lt;/p&gt;

&lt;p&gt;To make these strips identical, I first drilled 4 mm center-holes in one piece, then used it as a template for the rest. This is standard practice. If the template is screwed, then everything is screwed, then I am screwed. So I was vewy-vewy-caweful.&lt;/p&gt;

&lt;p&gt;After TIG-welding the strips to the cross bar, I stick-welded them, since this is faster and cheaper.&lt;/p&gt;

&lt;h1 id='legs'&gt;Legs&lt;/h1&gt;

&lt;p&gt;At this point, I had two fully assembled cross bars with wheels. Really dangerous to ride around the workshop.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Cross bar with wheels and rear mount plates' src='/assets/images/2012-06-26-cross_bar.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I could measure their height, and how much the chassis mount plates protruded, so I could now decide how long my legs should be.&lt;/p&gt;

&lt;p&gt;I jacked the van up and did that, then cut appropriate lengths off a 50x50x2 mm square pipe. This can be a lot thinner than the cross bar, since the main force applied is &lt;a href='https://en.wikipedia.org/wiki/Compressive_strength'&gt;compression&lt;/a&gt;, not &lt;a href='https://en.wikipedia.org/wiki/Bending'&gt;bending&lt;/a&gt;. Also, we had that as a leftover. And it doesn&amp;#8217;t weigh too much, which at this point was starting to become an issue.&lt;/p&gt;

&lt;p&gt;I also put in square pipes diagonally, to prevent the legs breaking off sideways.&lt;/p&gt;

&lt;p&gt;Long story short, here&amp;#8217;s how it looked at the back before I screwed it to the chassis.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rear frame part, unmounted' src='/assets/images/2012-06-26-rear_unmounted.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I don&amp;#8217;t particularly like how the legs are welded to the mount plates. I&amp;#8217;d now rather have spent a lot of time cutting away slots, so one inserts into the other. Too late, Captain Hindsight.&lt;/p&gt;

&lt;h1 id='final_touches'&gt;Final touches&lt;/h1&gt;

&lt;p&gt;At the front, I had to put in some spacers for better vertical alignment.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Front frame part, mounted' src='/assets/images/2012-06-26-front_mounted.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Front frame part, mounted, close-up with spacers visible' src='/assets/images/2012-06-26-front_mounted_closeup_plate.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;At the back, it fit as planned.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Rear frame part, mounted' src='/assets/images/2012-06-26-rear_mounted.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The whole thing didn&amp;#8217;t feel stable enough when I tried to push the van, so I screwed a segment of metal stairs to both parts of the frame lengthhwise, underneath the van. Call it a spine. You can see a part of it in the picture below.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Front axis, its wheels removed, spine visible' src='/assets/images/2012-06-26-spine.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The spine is removable and can be attached whether or not the axles are still in place. When I was sure the whole thing wouldn&amp;#8217;t collapse, I removed the axles.&lt;/p&gt;

&lt;p&gt;&lt;img alt='The van, side view, axles removed' src='/assets/images/2012-06-26-van_without_axles.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;One day, I will gimp the frame out, and the van will levitate.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Plant watering alarm FIAL</title>
   <link href="http://wemakethings.net/2012/06/21/plant_watering_alarm"/>
   <updated>2012-06-21T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/06/21/plant_watering_alarm</id>
   <content type="html">&lt;p&gt;Update 2012-11-30 &lt;strong&gt;A new working vesion of &lt;a href='http://wemakethings.net/chirp'&gt;plant watering alarm&lt;/a&gt; is available for sale! It&amp;#8217;s open source and it goes &lt;a href='http://wemakethings.net/chirp'&gt;Chirp!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, living together with a person comes with some responsibilities that are to be tackled. Like watering plants. My friend I&amp;#8217;m sharing an apartment with was leaving for a couple of weeks and has burdened me with a task to take care of several pots with alien life forms. After i was finished with my pot-growing experiments long time ago, i didn&amp;#8217;t care enough about plants and i didn&amp;#8217;t expect myself to be out of nerd zone enough to be aware of this task as it&amp;#8217;s not cyclic and depends on different external factors such as ambient humidity and temperature. So, i came up with a hi-tech solution: Plant watering alarm that would notice me in non-too-much-intrusive way that it&amp;#8217;s time to take care of other species. After some simulation i was quick with a fully working prototype in the first go!&lt;/p&gt;

&lt;p&gt;&lt;img alt='First prototype' src='/assets/images/2012-06-21-plant_alarm_prototype.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;As currently I&amp;#8217;m very much in analog electronics and i had heaps of free op amp samples lying around, i went with a fully analog solution as i like things to be as basic as possible.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Circuit' src='/assets/images/2012-06-21_plant_alarm_schematics.png' /&gt;&lt;/p&gt;

&lt;p&gt;The circuit works as follows:&lt;/p&gt;

&lt;p&gt;Electrodes in earth act as a variable resistor, resistance of which depends on amount of water in soil, it forms a voltage divider with R5. While this voltage is above a voltage on non inverting input of op amp, created by R3, R2 and R1, nothing happens. When soil dries out, it&amp;#8217;s resistance increases and voltage on inverting input falls below the threshold. Output of op amp swings to positive rail, lighting up a LED and making click in piezo beeper. Voltage on inverting input changes to another value, and C1 is charging up through R4 until it reaches that value. Then output of op amp goes low clicking a piezo buzzer once more, C1 discharges thruough R5 and the cycle repeats. In general it&amp;#8217;s a relaxation oscillator with hysteresis set by R2 and R1.&lt;/p&gt;

&lt;p&gt;Two days later after i woke up, I&amp;#8217;ve heard a silent clicking, it&amp;#8217;s time to water plants! Win!&lt;/p&gt;

&lt;p&gt;As i have no job and still have no intentions to get one, i instantly saw dollar bills in it. I could make a product out of this and sell it to fellow geeks and whomever else, all i need is to make it battery operated and low on power consumption! I got these extremely low power op amps from TI - OPA379, with input high, the device was consuming 6 micro amps, it could work years on 3V lithium button cell battery!&lt;/p&gt;

&lt;p&gt;Well, the devil was hiding not far away. The resistance of the soil in kilo-ohm range, i measured about 500K in extremely dry pot and 10K in freshly watered plant, this means, the main resistive divider would draw 60uA alone, it would drain the battery in 4 months and it&amp;#8217;s unacceptable. I&amp;#8217;ve had an idea about inverting input by putting a mega ohm resistor from VCC and connecting the plant to ground, buffering and amplifying the voltage by another op amp, but the electrodes in soil act as a battery too, producing ~40mV of voltage, which varies wildly on the type of soil, fertilizers and bunch of random stuff, so i had to scrap the idea. Maybe I&amp;#8217;ll try it by measuring capacitance between electrodes. Well, back to microcontrollers&amp;#8230;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Engine hoist boom extension for Mercedes-Benz 207D</title>
   <link href="http://wemakethings.net/2012/05/17/engine_hoist_boom_extension_for_mb_207d"/>
   <updated>2012-05-17T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/05/17/engine_hoist_boom_extension_for_mb_207d</id>
   <content type="html">&lt;p&gt;I&amp;#8217;d like to work on the body of this van without fretting too much about getting sand in her&amp;#8230; well, important places. Which means stripping everything, including the engine.&lt;/p&gt;

&lt;p&gt;Taking it out on this model is pretty straightforward. Literally: unless the van is lifted and the front axle removed, the engine and transmission can only be removed in a straight horizontal trajectory.&lt;/p&gt;

&lt;p&gt;The engine hoist we&amp;#8217;ve got is made for light vehicles, where the engine is lifted out vertically. The hoist boom, when horizontal, is 20-30 cm too high in my case, and cannot be adjusted.&lt;/p&gt;

&lt;p&gt;One could, of course, modify the hoist itself to be adjustable, but there&amp;#8217;s a simpler solution: a purpose-built angled boom extension for a given van.&lt;/p&gt;

&lt;p&gt;I started off by measuring the cross section of the original extension, which happened to be 60x60x4 mm. Got a meter of that.&lt;/p&gt;

&lt;p&gt;Then took the hoist to the van, removed the original extension, lifted the boom slightly over the engine&amp;#8217;s top line, and marked an angle. Inside the boom, this extension wanna-be o&amp;#8217; mine went slightly over the hydraulic jack.&lt;/p&gt;

&lt;p&gt;Took the square pipe to the bench and cut at the marked line, then squared off the remainder by cutting out a triangle.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Extension cutout' src='/assets/images/2012-05-17-cutout-1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;This piece came very handy for reinforcement.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Extension puzzle pieces, before welding' src='/assets/images/2012-05-17-cutout-2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The smaller square pipe is 30x30x4 mm, and there are two of them stacked in this side view. We reckoned smaller pipe would give more operating space in the engine bay. Two sections of approx. 60 cm were needed, and exactly two sections of approx. 60 cm were available (after I cut them off from longer pieces).&lt;/p&gt;

&lt;p&gt;The engine here is an OM616, which has three suspension points. I took three big nuts and dropped them in an acid bath. Took &amp;#8216;em out, dropped them in a lye bath. Took &amp;#8216;em out, rinsed with water. These are improvised lugs.&lt;/p&gt;

&lt;p&gt;After gathering the puzzle pieces, I handed them off to a professional welder friend (who happened to be procrastinating with a bottle of JD). Here&amp;#8217;s what came back (this is not a shotgun):&lt;/p&gt;

&lt;p&gt;&lt;img alt='Boom extension, side-view' src='/assets/images/2012-05-17-ext-1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Boom Extension, underside' src='/assets/images/2012-05-17-ext-2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s how it looks attached to the boom:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Attached boom extension' src='/assets/images/2012-05-17-hoist-modded-closeup.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;A comparison of boom extensions, original and custom:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Boom extensions, original and custom' src='/assets/images/2012-05-17-hoist-compare.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Notice how the new one looks a lot more sinister than the original. And no, that is not piss in the corner.&lt;/p&gt;

&lt;p&gt;Finally, here it is engaged, doing what it does well:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Ich habe einen großen Fisch, ja!' src='/assets/images/2012-05-17-motor-on-hoist.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Used carabiners for suspension here &amp;#8211; chains would have been too constricting.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ball joint separator, part two</title>
   <link href="http://wemakethings.net/2012/05/04/ball_joint_separator_part_two"/>
   <updated>2012-05-04T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/05/04/ball_joint_separator_part_two</id>
   <content type="html">&lt;p&gt;The very next day after &lt;a href='/2012/05/02/ball_joint_separator/'&gt;this&lt;/a&gt;, I went and got myself a &amp;#8220;proper&amp;#8221; ball joint separator. It was the right thing &amp;#8211; did the job in a matter of minutes. Didn&amp;#8217;t even have the time to make tea.&lt;/p&gt;

&lt;p&gt;The other end of the rod had a torn boot, so I took that off, too. Again, without tea.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s how it looks.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Ball joint separator and tie rod with torn boot' src='/assets/images/2012.05.04-ball-joint-separator.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The separator is made of pretty good steel, and the pushing screw has a ball joint of its own, to reduce friction while turning. If you intend to make one, take these factors into consideration.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ball joint separator</title>
   <link href="http://wemakethings.net/2012/05/02/ball_joint_separator"/>
   <updated>2012-05-02T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/05/02/ball_joint_separator</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve got this old Mercedes-Benz 207D camper minivan. It&amp;#8217;s a proper minivan, owned in its better days by a bourgeois deutchlander. Which means it&amp;#8217;s fit out for short summer trips, with crammed living quarters and half the back taken by a toilet room. The toilet itself, of course, is missing. No heater, no insulation.&lt;/p&gt;

&lt;p&gt;Or at least it was like that, before I decided to tear it all up and re-purpose it for year-round van dwelling.&lt;/p&gt;

&lt;p&gt;Removing everything down to the panels revealed some rust. so I decided to get to the metal frame, which revealed considerable rust, especially around aluminum rivets. Before you know it, the van has no windows, no dashboard, half the engine bay is stashed in boxes, and I&amp;#8217;m struggling to separate the &lt;a href='http://en.wikipedia.org/wiki/Pitman_arm'&gt;pitman arm&lt;/a&gt; from the tie rod. Not that there&amp;#8217;s something wrong with the steering &amp;#8211; I just need an empty metal shell to work with.&lt;/p&gt;

&lt;p&gt;A few words on what I&amp;#8217;m trying to do. Have you seen Sylvester Stallone in &lt;a href='http://en.wikipedia.org/wiki/Over_the_Top_(film)'&gt;&amp;#8220;Over the Top&amp;#8221;&lt;/a&gt;? Then you&amp;#8217;ve seen nothing. One can not just wrestle with a pitman arm. It is tough and made of steel. It is &lt;a href='https://www.youtube.com/watch?v=jc8glzE6eeo'&gt;wedged in beyond any specs by righteous muffins&lt;/a&gt;. It is hammered in even more by every rock rolling on the road.&lt;/p&gt;

&lt;p&gt;Therefore, one needs a ball joint separator.&lt;/p&gt;

&lt;p&gt;And I could have gone and bought one, but decided to practice some &lt;a href='http://en.wikipedia.org/wiki/Gas_tungsten_arc_welding'&gt;TIG welding&lt;/a&gt; instead. I&amp;#8217;ll need this skill anyway by the time I replace every rotten bit of the van.&lt;/p&gt;

&lt;p&gt;The results, sadly, are negative. Maybe since it&amp;#8217;s all made of scrap metal I found under the table. Here&amp;#8217;s the first version:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Ball joint separator, v1' src='/assets/images/2012-05-02-a-puller-v1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;The middle screw is the pusher rod. Two screws on the sides have flimsy grips. Turning the middle screw pushes on the ball joint finger, grips pull the pitman, and it comes off. Or such was my idea.&lt;/p&gt;

&lt;p&gt;In reality, the grip screws bent sideways, their grabbing plates had bent, too, and nearly slipped off.&lt;/p&gt;

&lt;p&gt;No biggie, replaced it with a single piece of 5 mm plate, cut out in a suitable shape, that attaches like so:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Ball joint separator, v2' src='/assets/images/2012-05-02-b-puller-v2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Looks a lot more solid, eh? It had bent, too. A little. I kept on pushing with a hand wrench, since the pneumatic would only hiss at this point, until the screw would turn no more, and the head snapped off:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Ball joint separator, v2, failure' src='/assets/images/2012-05-02-c-puller-failure.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Oh well. Pitman is strong. I&amp;#8217;ll either have to further refine this thing &amp;#8211; shorter, stronger screws, a metal ball from a bearing to reduce friction, and so on &amp;#8211; or just scrap it and &lt;a href='/2012/05/04/ball_joint_separator_part_two/'&gt;buy a &amp;#8220;real&amp;#8221; one&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Or maybe cover it all with a black bag and pretend it&amp;#8217;s not there while I&amp;#8217;m working on the body.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Volkswagen Passat B2 water pump pulley holder</title>
   <link href="http://wemakethings.net/2012/04/30/volkswagen-passat-b2-water-pump-pulley-holder"/>
   <updated>2012-04-30T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/04/30/volkswagen-passat-b2-water-pump-pulley-holder</id>
   <content type="html">&lt;p&gt;We all know the importance of changing engine belts regularly. The knowledge by itself, though, does not prevent them from evaporating on the highway.&lt;/p&gt;

&lt;p&gt;This happened to a certain &lt;a href='http://en.wikipedia.org/wiki/Volkswagen_passat#B2_.28Typ_32B.2C_1981.E2.80.931988.29'&gt;folks&amp;#8217; wagon&lt;/a&gt; we are acquainted with. Given the opportunity, we decided to change the whole lot: the power steering belt, the alternator belt, and the water pump belt.&lt;/p&gt;

&lt;p&gt;The first one was easy, the second required some yoga, and the third seemed down right impossible to access without disassembling the front of the vehicle.&lt;/p&gt;

&lt;p&gt;Or at least the water pump pulley. Which was held tight by three allen screws, which could not be unscrewed, because the pulley would rotate instead. It is, after all, a pulley &amp;#8211; that&amp;#8217;s what they do.&lt;/p&gt;

&lt;p&gt;You know what our fathers would have done in this case. We surely didn&amp;#8217;t, so we went online.&lt;/p&gt;

&lt;p&gt;Long story short, we found &lt;a href='http://www.germanautoparts.com/images/large/5ed123085327bfd06f632aedf579203f.jpg'&gt;special tools similar to this&lt;/a&gt;. Paying 30$, waiting for a week and using it twice didn&amp;#8217;t sound exactly right. So &lt;em&gt;various artists&lt;/em&gt; (who did most of what I&amp;#8217;m describing) cut a similar shape from a piece of 2.5 mm sheet metal.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Water pump pulley holder tool' src='/assets/images/2012-04-30-pulley-holder.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I can&amp;#8217;t give the exact measurements, they&amp;#8217;re somewhere in &lt;em&gt;adude&amp;#8217;s&lt;/em&gt; notebook, but the 3 holes are approx. 14 mm in diameter, set out about 22 mm from the center point. The middle has to be cut out for a firm grip on the pulley.&lt;/p&gt;

&lt;p&gt;If you intend to make one, have 6 holes instead of 3. The reason here is the tool can only be turned 60° freely inside the engine compartment. The blueprints, though, might look like a zionist conspiracy.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>dmx-dimmer ready for testing</title>
   <link href="http://wemakethings.net/2012/04/09/dmx-dimmer-ready-for-testing"/>
   <updated>2012-04-09T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/04/09/dmx-dimmer-ready-for-testing</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ll document the developments that happened since the &lt;a href='/2012/01/24/dmx-dimmer-introduction/'&gt;previous post&lt;/a&gt;, mainly for historical purposes.&lt;/p&gt;

&lt;h1 id='power_safety_during_prototyping'&gt;Power safety during prototyping&lt;/h1&gt;

&lt;p&gt;The power connector (screw terminals) on the slave board weren&amp;#8217;t sturdy enough and would jiggle if wiggled. Then the prototype board got burned &amp;#8211; for a whole different reason, though.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Burned power terminals on slave board' src='/assets/images/2012-04-09-burnt_power_connector.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; power safety isn&amp;#8217;t something to &amp;#8220;implement later&amp;#8221;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use terminals with paired pins for each connection, or connectors with metal casing that can be grounded;&lt;/li&gt;

&lt;li&gt;if using stranded wires, at least tin them to prevent shorts;&lt;/li&gt;

&lt;li&gt;have a fuse for each power user.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id='whats_3d_rendering_good_for'&gt;What&amp;#8217;s 3D rendering good for?&lt;/h1&gt;

&lt;p&gt;If you&amp;#8217;re wondering why would anyone want 3D rendering functionality in their EDA, just look an the lower side of the photo above. See that huge grey bulb? It&amp;#8217;s a 1 mF electrolytic capacitor. I thought the SMD version was going to be small. And it was, compared to a through-hole. Still, a few millimeters too tall for this application.&lt;/p&gt;

&lt;p&gt;&lt;img alt='SMD capacitor turned though-hole' src='/assets/images/2012-04-09-bent_pads.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Soldered it out, drilled a few holes, bent the pads into pins, and soldered it in on the other side.&lt;/p&gt;

&lt;p&gt;Then, there were a few spacing issues, mainly with mount screw holes. I was too lazy to go looking for a footprint as trivial as this, and used vias with fat copper rings instead. The tolerances were too small, though, so screwheads ended up getting over tracks, connectors, everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; think about physical design, use 3D if available (KiCAD and EAGLE have it).&lt;/p&gt;

&lt;h1 id='stable_dimming'&gt;Stable dimming&lt;/h1&gt;

&lt;p&gt;I&amp;#8217;ve previously had some issues with lamp flicker. Weirdly enough, it would disappear after connecting an oscilloscope. I still haven&amp;#8217;t figured this out, by the way. Thought it was noise in power, ground or zero crossing, but debugging led nowhere. Frustrated, I decided to do some meditative code cleanup.&lt;/p&gt;

&lt;p&gt;Which turned out to be a great idea. It showed that timer resetting was still being done in a software interrupt routine. This creates delays, since processor state has to be pushed onto the stack first. Resetting the timer in hardware (which I assumed I had been doing all along) fixed the issue and gave a nice homogeneous glow.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Filament glow' src='/assets/images/2012-04-09-filament_glow.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; don&amp;#8217;t assume you&amp;#8217;ve got things right, and check; also, don&amp;#8217;t assume you&amp;#8217;ve already checked; avoid infinite recursion.&lt;/p&gt;

&lt;h1 id='real_men_wind_their_own_chokes'&gt;Real men wind their own chokes&lt;/h1&gt;

&lt;p&gt;&amp;#8230; mainly because they&amp;#8217;re too expensive. The chokes, of course, not men.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Hand-wound heavy duty choke in a dimmer module' src='/assets/images/2012-04-09-handwound_choke.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s one used in a dimmer module. It&amp;#8217;s a ferrite toroid core with 2 mm wire wrapped around it. 2 mm diameter gives a 3.14 mm&lt;sup&gt;2&lt;/sup&gt; cross section, which is slightly overkill, and definitely too tough to wind. I&amp;#8217;d aim for 1 mm&lt;sup&gt;2&lt;/sup&gt; per 10 A. &lt;a href='/2013/03/03/dmx-dimmer-winding-chokes/'&gt;Double-wound with thinner wire&lt;/a&gt;, perhaps, to ease the chore.&lt;/p&gt;

&lt;h1 id='module_overview'&gt;Module overview&lt;/h1&gt;

&lt;p&gt;Here lies dmx-dimmer, with one of each modules.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Dimmer modules' src='/assets/images/2012-04-09-dimmer_modules.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve made two revisions of the power dimmer board, with different triacs. &lt;em&gt;r0&lt;/em&gt; was used during initial prototyping, to avoid running high currents through the breadboard. It doesn&amp;#8217;t have a choke. &lt;em&gt;r1&lt;/em&gt; had some layout quirks, which made running a proper test (with a 2 kW fixture) impossible.&lt;/p&gt;

&lt;p&gt;It also looks like a rat&amp;#8217;s nest due to all the wires. Some were simply soldered to the board. Bad idea! Move the boards around too much &amp;#8211; and they break. Leave them by the table&amp;#8217;s edge &amp;#8211; and they fall. A remarkable annoyance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; don&amp;#8217;t make a board unless you intend to test it any time soon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;a href='http://en.wikipedia.org/wiki/TRIAC'&gt;triac&lt;/a&gt; is not symmetric, if it doesn&amp;#8217;t trigger, you might have to swap its MT1 and MT2 connections;&lt;/li&gt;

&lt;li&gt;soldered wire connections are not OK for prototyping.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id='last_notes'&gt;Last notes&lt;/h1&gt;

&lt;p&gt;I have yet to measure power usage. And many other things. This will have to collect dust for a while, though &amp;#8211; safely, inside a box. I packed it all up and went to do something entirely different. The updated designs are available at &lt;a href='https://github.com/rxdtxd/dmx-dimmer'&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Strangely enough, I also stumbled upon &lt;a href='http://www.engbedded.com/semitone/'&gt;Semitone Lighting Controllers&lt;/a&gt;, an open hardware project that&amp;#8217;s been running since 2003. Somehow Google missed this last year. I would have just built a Semitone Diamond instead of doing all this!..&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; don&amp;#8217;t trust a search engine.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Cat heating pad</title>
   <link href="http://wemakethings.net/2012/04/01/cat-heater"/>
   <updated>2012-04-01T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/04/01/cat-heater</id>
   <content type="html">&lt;p&gt;Every human associated with a feline knows that these domestic animals find laptop computers highly valuable. Why do they find these machines so fascinating? Is it because of their intristic property to produce heat? Or is it because it appears to be a highly important asset as humans tend to spend a reasonable amount of time attached to these devices every day? We couldn&amp;#8217;t simply ask our feline friend, as she was quite busy tending herself, we could only guess&amp;#8230;&lt;/p&gt;

&lt;p&gt;&lt;img alt='Problem - a cat on a loptop' src='/assets/images/2012.04.01-cat_heater0.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Well, fortunately we had some 0.2mm nichrome wire so we were able to make a quick prototype. By dropping 25 volts and having 130 Ohm resistance it was able to put out about 5W of heat. Well, actually our crappy power supply made from trash found on a street was not able to put out more. &lt;img alt='A prototype' src='/assets/images/2012.04.01-cat_heater2.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;We had some cardboard saved from some free samples of semiconductor devices sent to us by one nice company so we used that as a base for our device.&lt;/p&gt;

&lt;p&gt;&lt;img alt='A pad' src='/assets/images/2012.04.01-cat_heater3.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Alpha was not very impressed with our invention &lt;img alt='Slow start 1' src='/assets/images/2012.04.01-cat_heater5.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;You know the saying, cats don&amp;#8217;t really give a fuck&amp;#8230;&lt;img alt='Cats dont give a fuck' src='/assets/images/2012.04.01-cat_heater1.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;But maybe it&amp;#8217;s not that bad after all&amp;#8230;&lt;img alt='Slow start 2' src='/assets/images/2012.04.01-cat_heater6.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Two days later - a WIN! &lt;img alt='WIN!' src='/assets/images/2012.04.01-cat_heater7.jpg' /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Copper plating</title>
   <link href="http://wemakethings.net/2012/03/26/copper-plating"/>
   <updated>2012-03-26T00:00:00+03:00</updated>
   <id>http://wemakethings.net/2012/03/26/copper-plating</id>
   <content type="html">&lt;p&gt;Here&amp;#8217;s what &lt;em&gt;ioch&lt;/em&gt; was toying with last week.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Copper-plating a hard drive disc' src='/assets/images/2012-03-26-plating.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s a copper-plated hard drive disc, still in the bath. It didn&amp;#8217;t go particularly well, the thin copper film peeled off.&lt;/p&gt;

&lt;p&gt;I have no interest in blogging other people&amp;#8217;s stuff, so I&amp;#8217;ll leave you with that: pretty pictures.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Control a motor from a lighting console</title>
   <link href="http://wemakethings.net/2012/03/04/control-a-motor-from-a-lighting-console"/>
   <updated>2012-03-04T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/03/04/control-a-motor-from-a-lighting-console</id>
   <content type="html">&lt;p&gt;A few months ago I was asked what it would take to drive a 3-phase AC induction motor from a lighting console. A specific variable frequency drive by Delta Electronics (&lt;a href='http://www.delta.com.tw/product/em/drive/ac_motor/ac_motor_product.asp?pid=1&amp;amp;cid=1&amp;amp;itid=3'&gt;VFD-L series&lt;/a&gt;) was provided. Coincidentally, &lt;em&gt;miceuz&lt;/em&gt; was working on a &lt;a href='http://blog.hardcore.lt/mic/archives/011040.html'&gt;variable frequency drive&lt;/a&gt; of his own, so a motor that fit the purpose just happened to be lying around.&lt;/p&gt;

&lt;p&gt;So everything that had to be done was a translation from &lt;a href='http://en.wikipedia.org/wiki/DMX512'&gt;DMX512&lt;/a&gt; (the console) to &lt;a href='http://en.wikipedia.org/wiki/Modbus'&gt;Modbus&lt;/a&gt; (the VFD).&lt;/p&gt;

&lt;p&gt;I took my trusty &lt;a href='https://metalab.at/wiki/Metaboard'&gt;Metaboard&lt;/a&gt; and meditated. Quite conveniently, both DMX512 and Modbus are RS485 protocols, so a 75176 interface chip for each is all the hardware that is needed. Here&amp;#8217;s the schematic I drew then and fished out from under the desk now. The table on the left is for bookbinding signatures and absolutely unrelated.&lt;/p&gt;

&lt;p&gt;&lt;img alt='75176 and ATMega interconnection' src='/assets/images/2012.03.04-schematic.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Writing the code was pretty simple, since I took most of it from the &lt;a href='http://wemakethings.net/2012/01/24/dmx-dimmer-introduction/'&gt;DMX dimmer&lt;/a&gt; project of mine. Which is going slow and steady, thank you.&lt;/p&gt;

&lt;p&gt;The rest, dealing with Modbus, required a skim through the VFD&amp;#8217;s manual, and is pretty much hard-coded. I let myself do this, since the goal was to see if it can be done at all, and the finished thing needed only to have speed control, nothing else. A lot more is possible, though, with the mentioned VFD. If I had to do that, I&amp;#8217;d probably go with &lt;a href='http://www.freemodbus.org/'&gt;FreeMODBUS&lt;/a&gt;, a library for a number of embedded architectures.&lt;/p&gt;

&lt;p&gt;To simulate a lighting console, I used &lt;a href='http://qlc.sourceforge.net/'&gt;QLC&lt;/a&gt; (software) and ENTTEC&amp;#8217;s &lt;a href='http://www.enttec.com/index.php?main_menu=Products&amp;amp;prod=70304&amp;amp;show=description'&gt;DMX USB Pro&lt;/a&gt; (hardware). Keep in mind that if you want to use this setup on GNU/Linux, the former uses a not-invented-here approach to communicate with the latter, and you might need to blacklist the &lt;code&gt;ftdi_sio&lt;/code&gt; kernel module.&lt;/p&gt;

&lt;p&gt;Keeping the story short, after 6 hours of copying code around, I came up with &lt;a href='https://github.com/rxdtxd/dmx-motor'&gt;this slackjob proof-of-concept&lt;/a&gt; to control an AC induction motor using DMX, taking a few givens for granted. Mind you, a VFD for industrial automation is quite more common (and, therefore, cheaper) than professional theatre special effects equipment that does the same thing.&lt;/p&gt;

&lt;p&gt;The last move I made was film it all, once, on the first camera that happened about. Here it is, in all its pixelated, shaky, moory glory.&lt;/p&gt;
&lt;center&gt;&lt;iframe allowfullscreen='yes' frameborder='0' height='315' src='https://www.youtube.com/embed/lNdiwxo47Fc' width='420'&gt;3-phase AC Induction otor Controlled Using DMX, on Youtube.&lt;/iframe&gt;&lt;/center&gt;
&lt;p&gt;And yes, I do call that a workshop.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Repairing a Martin Atomic 3000 DMX strobe</title>
   <link href="http://wemakethings.net/2012/02/14/repairing-a-martin-atomic-3000-dmx-strobe"/>
   <updated>2012-02-14T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/02/14/repairing-a-martin-atomic-3000-dmx-strobe</id>
   <content type="html">&lt;h1 id='fuse_blows_repeatedly'&gt;Fuse blows repeatedly&lt;/h1&gt;

&lt;p&gt;I got my dirty hands on this nice fixture, a &lt;a href='http://www.martin.com/product/product.asp?product=atomic'&gt;Martin Atomic 3000 DMX stroboscope&lt;/a&gt;. What exactly happened to it is shrouded by mystery, since it happened too long ago for anyone to remember. Some facts, though, were relayed as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;something blew on the board, and high currents destroyed the original fuse;&lt;/li&gt;

&lt;li&gt;there was no time to wait for a &amp;#8220;replacement&amp;#8221; or &amp;#8220;inspection by a qualified technician&amp;#8221; (as is quite often the case with important equipment);&lt;/li&gt;

&lt;li&gt;someone obtained the relevant components, soldered them in and changed the fuse;&lt;/li&gt;

&lt;li&gt;the strobe, however, kept misbehaving, blowing the fuse repeatedly;&lt;/li&gt;

&lt;li&gt;as such, it was eventually shelved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here&amp;#8217;s the part of PCB that took the damage:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Atomic3000 PCB, with replaced components' src='/assets/images/2012.02.14-atomic3000-spark-gap.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='its_a_spark_gap'&gt;It&amp;#8217;s a spark gap!&lt;/h1&gt;

&lt;p&gt;Notice a few things, Dr. Watson:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how a few caps are molded on the top, a sign that someone was in a hurry or just didn&amp;#8217;t bother to flatten the playing field;&lt;/li&gt;

&lt;li&gt;how it is all centered around two resistors, R127 and R136.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A short browse gave a few threads with similar issues: one &lt;a href='http://www.blue-room.org.uk/index.php?showtopic=11616'&gt;looking for a schematic&lt;/a&gt; and another &lt;a href='http://www.blue-room.org.uk/index.php?showtopic=25382'&gt;asking for advice&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A schematic, indeed, is only available from Martin if you&amp;#8217;ve passed some sort of ritualistic initiation. So I went on the internets&amp;#8217; underside and found it, and here&amp;#8217;s the relevant part:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Part of Atomic3000 schematic, showing the part that got blown away' src='/assets/images/2012.02.14-atomic3000-powerline-schematic.png' /&gt;&lt;/p&gt;

&lt;p&gt;And oh Abyss, those two resistors, put butt-to-butt, form a spark gap between LINE and NEUTRAL!&lt;/p&gt;

&lt;p&gt;The thing about light fixtures is that they&amp;#8217;re often used indoors. Indoors is often poorly ventilated. There is a lot of dust, which gets everywhere, especially into spark gaps. I&amp;#8217;ve seen dust inside stepper motors, too, between the bearings of ventilators, covering radiators and integrated circuits to the point they can&amp;#8217;t be seen!.. The horror, the horror&amp;#8230;&lt;/p&gt;

&lt;p&gt;Anyway, there&amp;#8217;s not a lot that can be done except for regular cleaning (yeah, right). I&amp;#8217;m sure Martin has also fixed this in their later revisions of the PCB. After all, the one in question is way back from 2001.&lt;/p&gt;

&lt;p&gt;I couldn&amp;#8217;t have not indulged myself, though, in the following way:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Atomic3000 PCB, a-la fixed' src='/assets/images/2012.02.14-atomic3000-bigger-spark-gap.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Correct, it&amp;#8217;s a bigger spark gap. I also changed the caps. And wiped off the rosin residue. The solderwork looks sloppier than it was before.&lt;/p&gt;

&lt;h1 id='ehm_fuse'&gt;Ehm&amp;#8230; Fuse?&lt;/h1&gt;

&lt;p&gt;Back to the issue at hand: why does it keep blowing the fuse? Well, it&amp;#8217;s because not every fuse will do. You need a slow-blow fuse, says so in the manual. Martin can supply those for you, catalog number 05020040.&lt;/p&gt;

&lt;p&gt;This is because the strobe draws up to 33 amperes at peaks, which happens when you run it in full-power mode with the blinder effect.&lt;/p&gt;

&lt;p&gt;We&amp;#8217;ve measured it with this:&lt;/p&gt;

&lt;p&gt;&lt;img alt='Current meter setup' src='/assets/images/2012.02.14-current-meter.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s a current transformer and a meter. The good thing about this is it shows effective current through the wires, not some derivative. When the strobe runs in normal mode, it draws current in bursts, and modern meters that measure magnetic flux would show all kinds of weird, like jumping fast from -50mA to 50mA, with the amplitude ramping up, eventually to 150A. Which can&amp;#8217;t be true.&lt;/p&gt;

&lt;p&gt;Anyway, with this setup, we&amp;#8217;ve measured that the device draws very little on average in normal mode, around 18A in half-power blinder mode and well over 30A in full-power blinder. Mind, though, that this doesn&amp;#8217;t last for long, since thermal protection kicks in and decreases lamp glow intensity &amp;#8211; by limiting current.&lt;/p&gt;

&lt;p&gt;The ultra-high power mode, though, lasts for a few seconds, which is enough to blow a glass fuse, even if it&amp;#8217;s slow-blow. But a ceramic one can tolerate this. According to the datasheet of the one we bought, at 200% of the ampere rating, minimum &amp;#8220;opening time&amp;#8221; is 5 seconds. Which is probably enough.&lt;/p&gt;

&lt;p&gt;So much for this &amp;#8220;failure mode&amp;#8221;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>LPC1343 devboard, continued</title>
   <link href="http://wemakethings.net/2012/02/02/lpc1343-devboard-continued"/>
   <updated>2012-02-02T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/02/02/lpc1343-devboard-continued</id>
   <content type="html">&lt;p&gt;A few weeks passed, and the PCBs came. We went for minimum price, which means no electric testing and no masks. Therefore, no outlines for what to place where, or how to orient things; and a few misaligned vias &amp;#8211; but they&amp;#8217;re metalized properly, so what the heck.&lt;/p&gt;

&lt;p&gt;&lt;a href='https://www.adafruit.com/products/281'&gt;Adafruit&lt;/a&gt; still quotes 15-20 days till stock.&lt;/p&gt;

&lt;p&gt;By now, &lt;em&gt;miceuz&lt;/em&gt; has noticed a few more things we could&amp;#8217;ve changed. Like replacing the 3.15V supervisor (U3) and EEPROM (U4) with more common chips. Oh well.&lt;/p&gt;

&lt;p&gt;&lt;img alt='LPC1343 devboard PCB' src='/assets/images/2012.02.02-lpc1343-badvia.jpg' /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Powering LEDs from mains</title>
   <link href="http://wemakethings.net/2012/01/29/powering-leds-from-mains"/>
   <updated>2012-01-29T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/01/29/powering-leds-from-mains</id>
   <content type="html">&lt;p&gt;&amp;#8230;with as few components as possible. Sorry for the blur, it was dark.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Power switch box with LED backlight' src='/assets/images/2012.01.29-switches-with-backlights.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s a box &lt;em&gt;ioch&lt;/em&gt; made. It has eight quality thumb switches for their reliable &amp;#8220;clunk!&amp;#8221; and four backlight LEDs, mainly for the flare. To power LEDs from the mains, though, you&amp;#8217;d need a transformer. That&amp;#8217;s bulky, expensive and unimaginative.&lt;/p&gt;

&lt;p&gt;So what&amp;#8217;s the smallest schematic one could have, if 50 Hz flicker was not a problem? &lt;em&gt;John&lt;/em&gt; remembered seeing something like this on the internet (and I zoomed out as much as I possible to make it even smaller):&lt;/p&gt;

&lt;p&gt;&lt;img alt='Minimal circuit to power LEDs from mains' src='/assets/images/2012.01.29-minimal-led-power-schematic.png' /&gt;&lt;/p&gt;

&lt;p&gt;The components&amp;#8217; values were selected using an online circuit simulator. The resistor has to be rated for high power, and the capacitor for mains voltage.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>dmx-dimmer introduction</title>
   <link href="http://wemakethings.net/2012/01/24/dmx-dimmer-introduction"/>
   <updated>2012-01-24T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/01/24/dmx-dimmer-introduction</id>
   <content type="html">&lt;h1 id='whats_this_about'&gt;What&amp;#8217;s this about?&lt;/h1&gt;

&lt;p&gt;I&amp;#8217;ve started working on this project slightly more than a year ago, during winter. Why is a rather lengthy story. By June development was finished (almost), I shelved the thing, made a backup, picked up my backpack and headed outdoors, where fun was to be had.&lt;/p&gt;

&lt;p&gt;What I&amp;#8217;ve been doing all this time until now is another long story. Among other things, it involved working as an apprentice light engineer at a theatre. The dimmers there were 30 years old and took up a room ten times the size of our workshop. If I showed you the photos, you&amp;#8217;d say it was fake, or at least crazy. The reason it&amp;#8217;s still there after all these years is the upgrade cost.&lt;/p&gt;

&lt;p&gt;Anyway, a few weeks ago I registered at GitHub and &lt;a href='https://github.com/rxdtxd/dmx-dimmer'&gt;pushed the project there&lt;/a&gt;. Be warned, there&amp;#8217;s a lot of turbulence. For example, at the time of writing, the firmware is a few commits behind the hardware &amp;#8211; pinouts had to be changed on the Master board to keep things simple and allow homebrew manufacture. But I&amp;#8217;m getting ahead of myself.&lt;/p&gt;

&lt;p&gt;&lt;img alt='dmx-dimmer Master board after etching' src='/assets/images/2012-01-24-etched.jpg' /&gt;&lt;/p&gt;

&lt;h1 id='wasnt_it_already_available'&gt;Wasn&amp;#8217;t it already available?&lt;/h1&gt;

&lt;p&gt;Of course, I looked around before engaging in a project as big as this. And there&amp;#8217;s a lot of schematics and open-source stuff available. Some are based on, you guessed it, Arduino. The closest to what I needed, though, was &lt;a href='http://www.hoelscher-hi.de/hendrik/english/dimmer.htm'&gt;Hendrik Hölscher&amp;#8217;s DMX dimmer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But it uses a rather old AVR microcontroller, runs off single-phase, and can have no more than 8 channels. I need something with components that won&amp;#8217;t disappear from the market too soon, something that uses three-phase mains power (but can use one or two if that&amp;#8217;s desirable), and allows 12 channels, more if feasible.&lt;/p&gt;

&lt;p&gt;Or so I thought up a year ago. Of course, now I see other, better ways of achieving the same. Yet, I&amp;#8217;m too anxious to re-design, so this will have to go.&lt;/p&gt;

&lt;h1 id='what_will_be_inside'&gt;What will be inside?&lt;/h1&gt;

&lt;p&gt;All of it is organised in four types of modules.&lt;/p&gt;

&lt;p&gt;A couple of status LEDs and an address switch are on the panel, available to the end-user. These settings and DMX512 data are received by a Master microcontroller, ATMega168, using SPI for the former and USART for the latter. The data is then distributed to three Slaves using SPI and a wacky scheme of SELECT/READY lines. These ensure the data goes where it has to, when it has to, and doesn&amp;#8217;t get lost during time-critical interrupts. A Slave, ATTiny2313, receives its set of channel data, determines its controlled phase&amp;#8217;s zero-crossing, and fires signals to actual dimmers, up to four of them. A dimmer opens a thyristor, which allows current to flow to the light fixture; a heavy-duty choke is involved, how heavy depends on the money or time one&amp;#8217;s willing to spend.&lt;/p&gt;

&lt;p&gt;At least that&amp;#8217;s how it works right now. Tests were carried out using protoboards, and everything seemed fine. How well this scheme performs in real life, under the strain of real loads, is yet to be seen.&lt;/p&gt;

&lt;h1 id='when_will_this_be_available'&gt;When will this be available?&lt;/h1&gt;

&lt;p&gt;I don&amp;#8217;t know.&lt;/p&gt;

&lt;p&gt;Currently, I have two other consuming projects. One of these I expect to post some time soon, too.&lt;/p&gt;

&lt;p&gt;As mentioned before, the current state of affairs is always available on &lt;a href='https://github.com/rxdtxd/dmx-dimmer'&gt;GitHub&lt;/a&gt;. So if anything goes wrong, at least it&amp;#8217;s not lost forever.&lt;/p&gt;

&lt;p&gt;Today, I&amp;#8217;ve etched the Master board and started populating it. Then it turned out I didn&amp;#8217;t have a 16 MHz crystal on hand &amp;#8211; luckily, one could be easily raised from an old computer extension board. I didn&amp;#8217;t have an 0805 120 Ohm resistor, too &amp;#8211; and it seems these weren&amp;#8217;t so widely used in the days of ISA. Oh well, off to the shop tomorrow. For now, enjoy this image:&lt;/p&gt;

&lt;p&gt;&lt;img alt='dmx-dimmer Master board after etching' src='/assets/images/2012-01-24-reflow.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;By the way, I&amp;#8217;ve used SMD soldering paste here. The expiration date says August, 2010. Works pretty fine, though. Only had to leak off water that separated.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Retarded power supply</title>
   <link href="http://wemakethings.net/2012/01/19/retarded-power-supply"/>
   <updated>2012-01-19T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/01/19/retarded-power-supply</id>
   <content type="html">&lt;p&gt;It was January 18th, 2012, the worldwide SOPA/PIPA protest day. We really wanted to watch a movie. A zombie apocalypse movie. But our test tweeters didn&amp;#8217;t have a power adapter, which is probably the reason they ended up in a trashbin. It did have a power connector, but none of our adaptors fit.&lt;/p&gt;

&lt;p&gt;Not quite an apocalyptic scenario, but still a distress.&lt;/p&gt;

&lt;p&gt;We decided to make a brave dash and solder a pair of wires to where the battery holder is connected (because, believe me, in the face of overwhelming circumstances one never has batteries). Which, of course, didn&amp;#8217;t work with a universal switched-mode power supply on the other end, since battery power wasn&amp;#8217;t filtered on the PCB.&lt;/p&gt;

&lt;p&gt;So we had to bring in another soundsystem. A couple of bigger speakers and an amp. Desperate times call for et cetera.&lt;/p&gt;

&lt;p&gt;Next day, though, &lt;em&gt;ioch&lt;/em&gt; took a NOKAI phone charger, soldered it to the board, and added a big cap for good measure. I&amp;#8217;d post a video of how well it works, but I&amp;#8217;d have to put in on YouTube, and doing so might become verboten.&lt;/p&gt;

&lt;p&gt;&lt;img alt='Speaker circuit board with installed cap' src='/assets/images/2012-01-19-active-speakers.jpg' /&gt;&lt;/p&gt;

&lt;p&gt;Next week: microwave popcorn and beer in Coca-Cola bottles.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Modifying the LPC1343 devboard</title>
   <link href="http://wemakethings.net/2012/01/17/modifying-the-lpc1343-devboard"/>
   <updated>2012-01-17T00:00:00+02:00</updated>
   <id>http://wemakethings.net/2012/01/17/modifying-the-lpc1343-devboard</id>
   <content type="html">&lt;p&gt;We&amp;#8217;ve been working with Atmel AVRs for quite some time now. All in all, it&amp;#8217;s a nice architecture, and I can&amp;#8217;t really remember why we decided to try out ARMs, and specifically this Cortex-M3 chip. Maybe it&amp;#8217;s their built-in USB bootloader. Or their lower price. Or higher processing power.&lt;/p&gt;

&lt;p&gt;Anyway, &lt;a href='http://www.microbuilder.eu/Projects/LPC1343ReferenceDesign.aspx'&gt;microBuilder&amp;#8217;s LPC1343 devboard&lt;/a&gt; looked like just the thing, jumped to &lt;a href='https://www.adafruit.com/products/281'&gt;Adafruit&lt;/a&gt; to order some, and&amp;#8230; it was out of stock! And wouldn&amp;#8217;t be available for some time.&lt;/p&gt;

&lt;p&gt;Luckily, a few of these chips just happened to be lying around, and the board designs are available. Not so for all the components, though &amp;#8211; specifically, the 12 MHz crystal. Which wasn&amp;#8217;t hard to replace. Yet, after a few tries to re-route for homebrew manufacture, it became evident there&amp;#8217;d be one via too many if one wanted to keep the nice GPIO layout. So it had to be shipped to a PCB manufacturer.&lt;/p&gt;

&lt;p&gt;Perhaps this won&amp;#8217;t be faster than Adafruit, but at least it&amp;#8217;ll be cheaper. Thanks to the fact it&amp;#8217;s all open-source (or whatchamacallit). In case you&amp;#8217;re interested, here&amp;#8217;s the &lt;a href='https://github.com/rxdtxd/LPC1343ReferenceDesign_v1.6'&gt;modified version&lt;/a&gt; at GitHub.&lt;/p&gt;

&lt;p&gt;&lt;img alt='PCB with HC49/S crystal' src='/assets/images/2012-01-17-lpc1343-pcb-eagle.png' /&gt;&lt;/p&gt;</content>
 </entry>
 
 
</feed>