RFID-detecting pet door

We have recently had a raccoon – or some similar beastie – coming into the house at night.  We know this because in the morning the kitchen cabinets at floor level are all open, and marshmallows or chocolate have been dragged out and bestowed with small tooth marks.  The cat – bless his peaceful, kindly soul – is of no help defending the castle, and probably invited the scoundrel in.

The cat door, a simple flap that keeps wind and sufficiently large animals out, is certainly the point of entry.  Evidently we need a more specific technology!  Cats are routinely implanted with a “microchip” to ID them if they get lost.  A door that would only admit specific RFID tags would be perfect, and I did some research and found that there is just one RFID reading product, the SureFlap DualScan, has a good reputation for keeping raccoons out.  (Aside: why is that Amazon product title in French, like parfum de fantaisie?)

But!  The cat couldn’t reliably trigger it, even when forcefully jammed into it (neither of us relished this test).  I contacted SureFlap and they sent a “range testing kit”, which is an RFID tag attached to a cardboard ruler.  But I noticed that it is extremely good at reading in the exact position of the kit, and very bad with any change of orientation whatsoever, or even removing the cardboard:

I look forward to hearing what SureFlap has to say.  In the meantime, I’ve been baring the pet door each night with a bit of Dremel-modified angle bar, and have had no evidence of intrusion so far.

IMG_20150723_181834 IMG_20150723_181808

Edit: SureFlap got right back to me with a clear explanation of why the cardboard matters:

The issues that you are encountering in your video are a bit of a misunderstanding.  The way that the SureFlap works is that you will notice on the underside of each of the tunnels are two plastic lenses.  These lenses have an infrared beam of light which bounces off the bottom of the tunnel, this beam of light is how the product is able to run off of batteries.

As you can see with your tests – until you disrupt that beam of light, the SureFlap itself will not turn on to “read” the microchip.  Which is why you get such differing results when you remove the microchip from the range test kit.  The kit itself does not in itself increase the ability of the SureFlap to read, however the design allows it to be shaped like a cat, and thereby break the beam of light – turning the SureFlap on – which then activates the reader, and you get a range of 28cm which is an excellent range.

I had noticed the lenses, but assumed they were mechanical fasteners.  Here is what they look like:


Next step: attach the RFID tag from the test kit to the cat to see if it works better than the implant…


Tang Band T1-1942S followup

I’ve used a pair of Tang Band T1-1942S as nearfield speakers at my standing desk since I first wrote about it a year ago.  It’s an extremely unconventional nearfield setup, with the speakers hung at ear level by velcro from a wire shelf, high pass filtered and supplemented with a cheap subwoofer.

Sometimes when I am trying something weird I get off on the novelty for a little while and then get annoyed by the practicalities of it, but that hasn’t happened here.  I still like these little modules and my wire standing desk.  (Note these are for casual use at the desk – I use a better system for serious listening.)

I had a request for a video showing the speakers in operation, so here you are.  Apologies for the slap-dash video and audio quality.

I didn’t say this very clearly but the two lines on the impedance graph I showed were measurements for the left and right speakers.  The minimum impedance of 4 ohms and frequency of the resonance peaks match the manufacturer’s specs, but there is a dramatic impedance disagreement between the two speakers.  The two peaks are the resonance of the box and of the passive radiator; sweeping with my fingers damping the PR smooths out the low peak as expected.

Fun with a kit amp

My son loves to sit with me and work on anything electronic. My daughter likes this too – she’s soldered at least six or seven kits – but my son is absolutely driven, and asks me all the time if we can do some kind of project, whether it be tearing apart old hard drives, cracking open wall warts, or building kits.  He also loves mechanical projects, even riveting a shoe back together.  I keep my eye out for good projects to do together.

The Gobo Stereo Audio Amplifier Kit from Boxed Kit Amps looked the ticket. It is inexpensive at $100, which includes the laser-cut case.  There are three separate boards (power supply and linear amps for L and R) so we could do a little each day over the course of a week.  Here is our finished product:

The case is attractive, if a little delicate.  The flex hinges look great in transparent plastic, but although they look like they provide airflow, they don’t really.  There is, of course, no shielding that a metal case might provide.

The instructions are nicely done. (There was a minor mistake in the URL emailed for the PDF, linking to the wrong file, but squinting at it made the mistake clear.)  They emphasize safety, and being systematic to avoid mistakes.

It was amusing that the photographed examples were done on a Silpat silicone baking sheet exactly like the one we were using.

Here are my comments on assembly:

The transformer leads are a bit confusing. Throughout the instructions one has to make choices about how long to cut wires early, before well-informed choices about routing in the case are possible. It will eliminate a lot of anxiety if the next version of the instructions give a suggested length for each wire that needs to be cut.

The most aggravation came from getting stranded wires into their PCB holes.  The plated holes are exactly the width of the pristine wire if it is flawlessly stripped.  The smallest eccentricity, twist, or bend to the strand bundle will not allow it to fit through.  I usually ended up having to clip off a fraction of the strands, and then soldering both front and back of the board to try to recover some structural integrity from the lost strands.  Widening the holes slightly would go a long way to decrease the frustration.  EDIT: they’ve now fixed this by reducing the wire size, see the comments.

Assembly was otherwise straightforward and there are very few mistakes in the manual.  The “Options and Improvements” section needs work.  I put a neon bulb in the power supply board as we went, which was specified as optional on the schematics and appeared sensible at the time, but turned out to be in the way of wiring later.  I chose to install a pair of optional MKP1837 bypass caps in the power supply board, which was recommended in the manual and on their forum.  The bummer was paying overpriced shipping for the otherwise inexpensive caps from Newark.  I ordered two extra caps, so if you chose to do this kit, I’ll mail them to you.

The amp sounds fine but I didn’t carefully test it.  I did a fast comparison using Room EQ Wizard, a Dayton Audio UMM-6 mic, some cheapo TV speaker modules, and a comparable 50W AudioSource AMP-100 amplifier.  I simply swapped the amplifiers, keeping as much as possible the same, and measured the frequency response with each.  Volumes are not comparable, but the ratio ought to be the same across the range.

This graph shows the two measured responses averaged at 1/3 octaves, and their ratio:


The speakers can’t reproduce the low end so those wiggles are just noise, but that 5db lump indicates something is wrong.  I didn’t bother track it down yet.  I kind of doubt the amp is the problem – so many variables are poorly controlled here, and I lean towards blaming resonance in the speakers, since they were operated at different volumes.

In conclusion, this kit was well worth the time we spent on it, and I recommend it.  While you can buy an equivalent amp of superior construction for about the same price, you won’t feel your time wasted here.  My only regret was swearing in front of my son when dealing with stranded wires into small PCB holes.

Flaming tube of death

(No actual death.)

I suggested a Ruben’s tube for a science fair project. It has everything needed to be cool – loud noise, the potential for serious injury, lots of instructions online and youtube videos of people not actually hurt by building one, and even an actual scientific principle or two to discuss.

(To be honest, the think of a hypothesis, plan an experiment, write up your results waterfall model for most science fair projects is completely bogus. The real hypothesis here was can we build something cool and seemingly dangerous over a weekend and get credit and the result was yes.)

We went to Home depot and found a variety of tube options. HVAC duct. Double-walled exhaust duct. Electrical conduit. The winner was 6′ steel fence post. A little hard to drill through, but not super heat conductive.

We only broke one bit on the holes.


We went for brass-and-copper connections instead of quick-connect plastic, figuring that they wouldn’t melt and might look really cool.


The ends were sealed with rubber from 3′ balloons, and the speakers were on clearance at Parts Express.


First test. Big fun!


Oops. See the bonus flames at the brass inlets?


I couldn’t see these from the other side, but the camera caught them nicely. Eventually I noticed the scorch marks. I was intending to tap the holes for the brass, but didn’t have a tap of the right size, so we cowboyed it with duct tape.


The metal connections turned out to just be leaky and tedious. After we switched to plastic, judicious use of teflon and silicone tape, and securing the speaker tightly with a hose ring, things started working predictably.

I learned that propane isn’t that scary to work with. It’s actually not easy to keep small leaks ignited in a well-ventilated environment.

Even a little wind interfered with the flames, and after trying various positions outside we moved inside (with due trepidation and discussion of safety).

Here’s a nice Rubenesque picture of standing waves:


A frequency sweep:

Obligatory music:

It was great fun… highly recommended.

X10, my problem child

I’ve used a variety of X10 devices to control power around the house, and it’s been a love-hate relationship.

My most successful use of X10 is to raise the lights in the morning. Three bedrooms have wall dimmer switches that allow the central ceiling light to be controlled remotely. Like many mammals, the younger kids wake up with the sun. Unfortunately the school schedule does not also follow the sun, and it sucks to have them get up too early at 6:30am in the summer, but not get up at all in the winter, or when it rains. Having the lights come on at the same time year round helps everything go smoother in the morning.

I have the lights come on slowly, brightening over the course of about twenty minutes. When I wake up from the light, I like to lie in bed for a few minutes feeling the light filter through my eyelids and pretend I’m lying on a beach in the sunshine. However, my partner is even less of a morning person than I am, and she really resents the bright light. Regardless, it does function to get us up, and much gentler than an alarm clock.

I’ve found quite a bit about X10 not to like, such as similar equipment responding differently to commands. For example, in one bedroom the dimmer goes from the off state to maximally dimmed when sent the bright command; to get to the same state from off the other two bedrooms have to be sent the on command, followed by dimming all the way using dim.

The controller has it’s own processor and is able to work without a host computer, remembering what times to send commands, and can even be programmed including loops and conditionals. In practice, however, I loath it because of the poorly written proprietary Windows software needed to set it up. Instead I have my linux server use a crontab that uses the x10cmd package to issue commands:

30 6 * * 1-5 sleep 20; /home/dps/x10cmd pl c1 on; /home/dps/x10cmd pl c1 dim 99999
31-59 6 * * 1-5 sleep 20; /home/dps/x10cmd pl c1 bright 1
45 7 * * 1-5 sleep 20; /home/dps/x10cmd pl c1 off

It’s clumsy and so geeky, but is crystal clear about what is going on. In this example, on weekdays the light comes on and is immediately dimmed all the way back down at 6:30am. Then it slowly raises in brightness, and shuts off at 7:45.

Although I’ve figured out how to bend X10 to my will, it is a poor servant with crippling personal problems. Delivery of commands depends on the the noise and impedance of whatever is connected to your power at the moment. There’s no protocol to guarantee that your commands were received. And US houses are wired with two 110v rails, so that half the house is disconnected from the other half.

Working depends on what is plugged in and/or operating at the time commands are sent. Any 220v equipment, such as an electric clothes dryer, is plugged across both rails. So X10 may traverse from one rail to the other, as long as your dryer is plugged in.

It turns out that the rack the garage server lives in is on the wrong rail from all the devices I wanted to control, and I have a gas dryer, so for years I ran an extension cord to a nearby outlet that was on the correct rail. I lived with that for years, but it drove me nuts every time I looked at the extension cord. When I had a closet built around the utilities in the garage recently ( a “mechanical room”) I decided to fix this problem by running a connection for both rails and using this phase coupler.


That’s right, it’s just a bandpass filter – a Chinese-made inductor and capacitor in series, made expensive by certification.


This could have just been secreted into the garage’s electrical panel, but here it is installed in the closet because I like keeping things accessible (and code compliant):


The coupler does work – the X10 controller now lives in the rack and the controls the lights on the other rail successfully.

But, but, but! And once again, but!

The yard fountain that I used to turn on and off with X10 has stopped working. I tested the switch, and it still works. It’s not the phase coupler’s fault, because connecting to the alternate rail directly in the same outlet that it used to no longer works.

My sad theory is that the phase couple is working exactly as designed, but doing so dilutes the power of the signal reaching the fountain’s switch by just enough to fail. Or who knows, it could be ringing, a blessing bestowed by the inductance fairy – I’ll never know for sure, because really understanding it would require getting really involved under the house with an oscilloscope in a way I have neither time nor interest in.

Instead, I replaced the X10 switch with a simple, cheap, robust mechanical timer.

Problem solved. Your move, X10.

Through a glass diffusely

My workshop is a four car garage with two articulated doors, one at each end. This flexible space was one of the selling points of the house; I love being able to open a door in the front of back or both, depending on privacy or ventilation requirements.

These garage doors are new. When I bought the house I had the garage finished, also adding an upper attic level for storage, a skylight, diagonal seismic bracing, sheetrock, plenty of outlets and ethernet runs. I’m in love with the space now, and recently had a closet built around the HVAC, water heater and 19″ rack to contain noise. I also put in a thermostat sub-zone.

The two garage doors combined have twelve small windows. At different times of day hot spots of sunlight rove across the floor, so I have been thinking about some kind of diffusion. Also, eight of the windows are in an optically important location directly over a TV. At night the windows look black, but during the day the sky beyond can be unpleasantly bright in contrast to a dark image on the TV.

I wanted what I put on the windows to be easy to take on and off so I wouldn’t be stuck if I wanted to see sky again. That ruled out window films. It also needed to be lightweight and stay secure when the garage doors are raised and become horizontal at the ceiling. Anything hanging freely, such as curtains or blinds, were right out.

Translucent white plastic was the obvious choice, but I got discouraged by prices. I couldn’t find any online custom plastic that didn’t feel expensive to me. Big sheets are obtainable and not too expensive but I’m not set up to make large precision cuts. Finally, I found a good deal on restaurant quantity HDPE cutting boards that were exactly the right size. Here they are waiting assembly:


Polyethylene is amazing stuff. It is very tough – these are cutting boards, after all – but flexible and translucent.

Each windows has ten screws around it, and my plan was to have each sheet held in place by one magnet for each screw. I bought these magnets for 5 cents each from China:


The magnets made assembly unexpectedly cool. I unscrewed one window and used the plastic retainer to make one sheet into a precise master:


Once I glued the magnets in place on one shade, I made the next 11 by placing each sheet over the master. Each magnet was affixed by putting a drop of super glue on the correct side and letting the magnet find the correct position by itself, just dropping it somewhere near the master’s magnet on the underside. It was very cool to see them slide into the correct position of their own accord, and the magnet even automatically applied pressure as the glue set too.


Here you can see how the magnets line up with the screws:


Those of you who have worked with polyethylene before are now laughing at me. Because – and I really didn’t think this through – one can’t glue to HDPE. There are special chemical/heat treatments that can sort of work to weld HDPE to the right plastics, but here I was just plopping some superglue on and expecting it to bond to the nickel surface of the magnets.

I discovered the problem after making a few shades and testing them. Sometimes the magnets would come off the HDPE and stay stuck to the screw heads instead of the plastic.

I would have liked to have some clever chemical solution to this, but I didn’t. Instead, I just made sure I glued to the less bumpy side of each sheet, and roughed the area up with sandpaper first. After doing this the success rate went from less than 90% to more than 99%, and enough magnets stayed on well enough that I stopped caring. I had to fix a few while testing, but no more magnets have fallen off since I put the shades up.

The completed shades from inside at night:




From outside at night:


From inside during the day:



I’m happy with how they turned out. The light is nicely diffuse. I’m thinking now of attaching colored transparencies on the far side of each sheet to create a stained-glass effect.

A dim view of dimmers

In the great recessed lighting experiment I tried three different kinds of LED lights. I learned a lot about LEDs. I also learned a lot about dimmer switches, kicking and screaming the whole way.

The first LED strip I used never turned completely off. Ever. Regardless of the dimmer setting, or position of the on/off switch. So I hooked it up to a scope. Ewww:

I confess that up to this point I had never thought much about dimmer switches or how they worked. I somehow preserved a naive view of them as little variable resistors. That doesn’t make any sense, though, because a resistor would need to dissipate power.

Old dimmer switches did in fact dissipate significant power, and occasionally killed people. Head over to Wikipedia and you’ll learn about some crazy dangerous historical designs, such as using salt water or mercury to make contacts.

As soon as I started reading about today’s dimmers I got a bad feeling. Lutron, a giant lighting manufacturer, has a wide variety of dimmers, and a web page that explains in broad categories when they are meant for. There are many, many types, and dubious branding and sales-talk electronics. For example, the phrases “magnetic transformer” and “electronic transformer” are used as if it is self-evident what these are. An “electronic transformer” presumably means things like switching power supplies (which have inside them a “magnetic” transformer – oh well.)

Unlike the exciting historical dimmers, modern dimmers use a cheap semiconductor device called a thyristor or triac. This is an on-off switch, and the dimming is achieved by turning off more or less of a fraction of the AC waveform. It’s a blunt tool to reduce power, polluting the 60Hz AC with high harmonics.

Although cheap, these designs create a long list of problems. They often require a significant load to function, and unless the load looks like a resistor, the lights may not come on, go off when they shouldn’t, or even flash. They make incandescent bulb filaments “sing” by suddenly turning on and off the power (a coiled filament is a small electromagnet, after all, and bucks by the change in magnetic flux when turned on and off).

What’s worse, dimmers interoperate badly with different types of bulbs in ways that are hard to predict. This remarkable pdf document shows a giant test matrix of 15 dimmers against hundreds of different bulbs, and many combinations don’t work well. It makes me sad that this approach – test every possible combination – is the state of the art.

After I educated myself, I bought a triac dimmer specifically for an LED load. It also had a trim pot to control the brightness where it would cut out, since that seemed to be an issue. It worked slightly better – at least turning it off actually cut the power.

At this point I lost faith. The only good dimmers I can find for sale – promising a simple sin wave, like my benchtop variac – are hundreds of dollars.

Fortunately, the final fluorescent form factor LED bulb with integrated electronics has solved the problem for me, by having either sufficient capacitance or inductance to help with the pulses. It does flicker slightly at intermediate dimness, but the highest and lowest settings provide very stable light, and the lowest dim setting now makes a fine night light.

We’ve achieved adequancy, but I’m itching to design a dream dimmer for myself.

Fiat lux

We have a North-facing kitchen that, despite bay windows and lots of electric lighting, always felt uncomfortably dark. It was crying out for a skylight.

The 4′ square skylight totally transformed the kitchen during the daytime. Areas that used to be “the bright spot near the window” are now “the dark spot away from the skylight”.

I also wanted to add more illumination at night, so I put in a hidden area for lights recessed behind a lip around the opening. I love the diffuse, natural look of the skylight during the day, and figured that with upward beaming lights shining on white paint and the translucent material in the skylight itself, I could get a facsimile of daylight at night.

Getting the geometry right was an interesting exercise. Due to the roof’s slope, a square on the roof projects downward to a rectangle on the ceiling. We ended up with a square in the ceiling and a square in the roof, and connecting them with a bend like a waveguide.

The 45 degree flare has a lip made of ripped wooden handrail. I wanted maximum reflectivity, and wasn’t keen on having the possibility of ignition of the wood, dust or paint if there were hotspots from the lighting, so I fashioned some inside channels out of 4 inch aluminum flashing.


I was hoping to use incandescent light rope, since I admire the color shift when it dims. But I found that a conventional light rope is not nearly bright enough for anything other than a dim night light.

So I bought an LED rope light. Here it is in the channel:


The effect felt strange. It’s a very diffuse light, very unlike a candle or incandescent bulb; not even like moonlight, which leaves a shadow. Maybe moonlight in fog. Combined with the relative dimness, it is very dreamlike. It was interesting but not quite right for the kitchen, where detailed work is done with knives.


LED strips are expensive so I ordered a more powerful one from China, which was a disaster in all sorts of ways, even after I rewired it to the correct voltage.

The vinyl actually started to turn brown when I left it running at the factory’s claimed power level. I consider myself fairly safety conscious, and this thing was completely out of the question. Vinyl is not an appropriate material for dissipating power. Lesson learned.

After fighting with dimmer compatibility issues, I ordered these LED tubes in the T8 fluorescent bulb form factor. The specs showed decent power (22w each) and color temperature.

The outside of the tubes are half aluminum and half translucent plastic. They were very sturdy and have a bright, even light. Despite the fluorescent form factor, they only require power at one end without a ballast, so I broke out the lamp wire, flux and heat-shrink.

The result was very satisfactory; when pegged at full power the skylight is now the brightest thing in the room. Unlike with a rope light, the flare corners aren’t lit, but the consistency along the bulb is excellent.

These bulbs are designed to cooperate with dimmers. They fade on and off in about a second, presumably due to internal capacitors. I haven’t heard any of the characteristic whine of an internal switching power supply. I anticipated the aluminum being a heat sink but it never felt hot to me at load. I was still happy to have a metal channel for it to live in, just in case it develops hot spots.

The only thing I’m not yet entirely happy with is the color temperature. The kitchen is a mixture of fluorescent, incandescent and halogen sources that live together acceptably well. In comparison the skylight is too obviously the highest color temperature (that is, a “cold” light with more blue light).

I bought some color correction gels (heat-safe filters meant for a theater lighting) and eyeballed their effect relative to the other lights in the room. Here you can see the untreated, 50% CTO and 100% CTO-filtered light:


To my eye these worked nicely to bring the color temperature down without looking colored, so I’ve order some 25% CTO sheets to treat all four bulbs.

Et facta est lux.

The Examined Life

I’ve never done new years’ resolutions, but for a little more than a month I’ve been using a tool that would be great for that.

Beeminder is a service to track and enforce cumulative goals for oneself. It’s utterly geeky and overthought, much like me. It works across platforms (including an Android app), again like me.

One thing I’ve been using it for it to track piano practicing; here is the graph it has made:

Piano practice beeminder graph

I get to enter the data points, set the slope of the yellow goal line (minutes practice per week), and so on.

The interesting thing about Beeminder is the mindset and business model – whether or not you are looking for such a tool, I highly recommend reading why it is designed the way it does. It works in tandem with their unique business model – pay nothing for the app, but pledge money you pay only if you fail your goals. I put up $5 for practicing piano, and have not failed.

This morning I installed TagTime on my phone, a very-beta companion app which does stochastic sampling of what you are doing throughout the day in order to quantify how you are spending time in an unbiased way – in essence, doing what a profiler does for computer performance analysis. I don’t have an opinion on how useful it is in practise yet, but I’m thrilled it exists; because I was eventually going to have to build it for myself. That it integrates with beeminder is a bonus. In theory, instead of manually tracking minutes practicing piano, I can let the random sampling track it – together with time walking the dog, eating, and everything else.

Happy New Year, folks!

Needs more busy

You must obey me:


Give it time to load and make your browser full screen so it tiles every available pixel.

As you have now recovered from the seizure, I’ll explain. A few months ago a friend sent the animated gif below. It’s been floating around the net but I haven’t been able to figure out who first created it. (You’ll get the original if you click on the image – wordpress.com is exceedingly and inscrutably not fast for this file.)


I put it on the TV screen and the kids stared at it for a long, long time. But I thought, what would make this better? It was not nearly busy enough, and my screen was a lot wider than the image. All those pixels lying fallow made me sad. So I made a new version with a horrific script and ImageMagick, using different combinations of rotating the original image vertically, flipping horizontally, and time shifting. Now it tiles both vertically and horizontally.


You’re welcome.


Get every new post delivered to your Inbox.

Join 777 other followers