Audio input hidden in bookshelf
This ordinary bookshelf

now contains an audio input to the room's speakers:


Pixxo webcam IR filter
The Pixxo USB WebCam, model A-MW2130, has a separate infrared filter that is very easy to remove. You just unscrew the outer case, unscrew the lens, and pop out the square filter piece. It looks kind of like the one in this demo.
The AW-M2130 works fine under linux with v4l2. Here are the controls:
% v4lctl -c /dev/video1 list
attribute | type | current | default | comment
-----------+--------+---------+---------+-------------------------------------
norm | choice | (null) | (null) |
input | choice | zc3xx | zc3xx | zc3xx
contrast | int | 128 | 128 | range is 0 => 256
Gamma | int | 4 | 4 | range is 1 => 6
Auto Gain | bool | on | on |
Light freq | choice | 50 Hz | 50 Hz | NoFliker 50 Hz 60 Hz
Sharpness | int | 2 | 2 | range is 0 => 3
The camera was $10 at Frys.
Remote control garage door opener
Goal: open garage door by cell phone, because its own remotes break a lot, and we're often not in the car when we want to open the door anyway.
I made this web UI. Dragging the window up makes a POST request for a quick-expiring, one-time-use access code:

All the phones we've tested can't actually make a drag event on a web page, so there's also an invisible tap zone above the button cover that animates it sliding up.
When you push the button, that posts your access code to my public web server. If that server approves, it makes an internal POST to another server on the parallel port. Would you like to control your parallel port with http post requests? Try this server. Since my parport is also controlling a shiftbrite, I'm actually using this other server.
A parallel port pin activates this relay, which closes the normal garage door opener circuit. The garage door just thinks the computer is another button, and all the existing buttons and remotes work the same.
A chopped centronics cable connects to a transistor with power from an old computer power supply.
Relay board on the ceiling of the garage. Most of the time, I forget to add blinky debugging lights to boards. This time, I remembered to include a blue LED for the relay status.
The parallel port pin only has to go high for a moment for the garage to open, and apparently my port does that at reboot. It was surprising.
I added a low-pass filter so the pin has to be held high for a long time before the garage opens.
5K
parport ---R--+-+-> transistor 2222 -> relay
| |
10K R C 1000uF
| |
gnd ----------+-+
The parport is about 3V, and it takes about 1.5 seconds for the relay to trigger. Relays sound cool when they're fading on.
Flower LED lamp
I got a shelf from craigslist and stapled some cloth to the sides

When Kelsi and I were at the cloth store, we got some fake flowers:

I drilled holes in the flowers:

...and put 3 white LEDs and one orange LED in each one. The 12V power comes from an old computer power supply in another room that's running various other home automation devices.

Now the flowers are on top of the shelf, and Kelsi has a new nightstand with a lamp:
MegaBrite installation
I replaced the LED nightlight in our bathroom with a MegaBrite.
I got some plastic domes on eBay. Do you want one? I have several extras.
I attached the dome to the ceiling by tying some bicycle tire around pushpins that press out against the inside of the dome. Here are a few other uses for old bike tubes.


Here are some unretouched photos of the MB with its dome lighting up the bathroom. Shutter times are 1/2 and 1 sec.

When I was testing the MegaBrite, it was hanging down from the ceiling and I happened to have a glass of water nearby:

The first two pictures are from different positions of the MB in the glass; in the third one I am sloshing around the water:

I'm controlling the MegaBrite with a parallel port, which is very simple to do. I'm getting LED power from the 5V rail of an old computer power supply. The power is going over perhaps 50 feet of cat5 which probably adds a lot of resistance. I measure 4.7V at the MB end (with the MB turned on). The parport control code is here. It has no attempt at optimization yet, and I think it takes just under 1ms to do a single update. If I add more MBs to this chain I may need to fix the inner loop in that code.
Garage door power usage
Kelsi and I wondered how much power the garage door opener uses, since we often use it on days when we ride our bikes. I plugged it into a little power meter.
The surprise is that the motor runs at 650W and the lights afterwards use 120W. A full garage-open-close event uses a lot more power to shine the light than to open the door.
I hope the solution will be to remove the light, run some home automation network to the garage, and computer-control all the garage lights and door. E.g. "when you know I biked to work, and it's now the evening, and the bluetooth sensor sees my cell phone nearby: open the door and turn on the light exactly long enough for me to get inside, as measured by the sensor on the door inside the house".
Our garage door opener also uses 3W when it's idle :(
Watching the X screen power state
http://cvs.bigasterisk.com/viewcvs/room/sys.dpms?rev=1.1&view=auto
New program to watch whether my screens are powered on or DPMS-sleeping. I also track the idle time and the currently-focused window, since I happened to find code for those while I was working out the DPMS. The result is a little RDF graph:
@prefix _4: <http://dash/>.
@prefix _5: <http://bigasterisk.com/computerIdleState/power/>.
@prefix idle: <http://bigasterisk.com/computerIdleState/>.
_4:console idle:focusClass "rxvt";
idle:focusName "XTerm";
idle:focusWindowName "drewp@dash:/my/proj/room <>";
idle:lastNonIdle "1196593439.27"^^<http://www.w3.org/2001/XMLSchema#float>;
idle:power _5:On.
(I know the URLs and date formats are poor right now)
The program should be easy to run if you're on X and you have rdflib, py2.5, and python-xlib.
This results format is part of my new plan to have each program regenerate entire graphs of whatever they measure. I'm thinking of sending the graphs around with jabber, using pubsub to send them only when they change. That would be unlike https://stpeter.im/?p=1328 which uses SPARQL as you'd expect.
For example, if the user (or DPMS timer) turned off the screen, the last triple in my example would change to the _5:Suspend node. Other listeners who have subscribed to the computerIdleState graph will get an updated version of it.
The reason I started tracking screen state was simply to measure how many hours my 300W monitors are on per month. Either this program, or some listener one, will have to log that data somewhere. Of course, there are obvious uses for logging idle time patterns too, and that measurement probably wants a bit more compression. (Example app: tell my friends on jabber that I'm out, but my average return time for Tuesdays is 9:45pm.)
I really have to move this old home automation project off CVS and onto darcs. I don't mind the conversion, but I want to keep at least some of the cvsweb urls working since I think I've pasted them into a lot of postings all over the web.
RDF reasoning for home automation
Updated: fixed FuXi link
I'm trying to do my home automation with RDF and reasoning. RDF is the unified way to write all the configurations, and I'm hoping to use a logic engine (maybe FuXi or Euler) to write the control systems. Hopefully those will make it easy for humans or computers to edit the setup.
I look forward to being able to ask an N3 proof system "why is the porch light on?" and having it tell me "the web said the sun has set by now, you tripped a motion sensor within the last 15 minutes, and there was no other light shining in this area, therefore I turned on the porch light".
Tonight I cobbled together the first working version of some home automation components talking RDF. A bluetooth dongle constantly searches for devices, and if it finds one, it states that [the bluetooth sensor] [senses] [the URI for the device]. Here's that program.
(BTW, avoid bluetooth chips by Integrated System Solution Corp and prefer ones by Cambridge Silicon Radio. The ISSC one I got has the lousy address 11:11:11:11:11:11 that's hard to change since I'm not using windows. Also, this bluetooth intro is really good.)
Next in my home automation system, a reasoning program hears about new statements and executes the right logic to produce more statements about what should happen. This program is a stub for now- it just turns the presence of my phone into a statement to power the door lock. But devices.n3 suggests what some of the logic might eventually look like.
Finally, an output program has been watching for statements about pins on the parallel port it controls. The reasoning program said to put power on bit2, so this program sets the output accordingly. On that pin is a circuit with an optoisolator, a triac, a transformer, and the electric strike that releases the door.

When the real logic is in place, the proof system should be able to say "I unlocked the door because someone friendly was nearby, because Drew is friendly and Drew carries a phone with the bluetooth address I saw".
new projector bulb for $12
My 1024x768 VGA projector, besides costing under $300 to start with, takes $12 replacement bulbs! (or $8 for the non-long-life one)
Bulbster delivered in about 2 days. http://bulbster.com/zcart/index.php?main_page=product_info&products_id=312&zenid=acde6be331ee2516f5154e3ffb0d5476
The long-life bulbs are rated with 'average life' of 100h. Since my computer turns my projector on and off, I should be able to track my exact failure times.
Atom feed of this blog