Read a Book by Remote Control

Array of LED modulesThe center-mounted ceiling fixture found in most homes is a lighting fixture whose best use is perhaps to provide enough light to install other lights. You are virtually guaranteed to cast a shadow on whatever task you undertake, or have the light source in your field of vision, or in some cases, both.

That's the case in my small apartment where the single futon that I use for reading and watching television sits against the wall, facing in. During the day, the window behind it lets plenty of sunlight in, but at night, the only light source is that ubiquitous ceiling fixture which, by virtue of being behind the book I'm reading (rather than behind me), doesn't do much to differentiate the type from the paper.

Of course the solution is to put a lamp beside the futon. But this isn't that kind of apartment. A lamp would take up precious floor space, and I'm using the floor for other things like standing and walking. I do have wall space though.

In fact, the ideal lamp for my situation would not take up any space, so that one isn't even aware of it if when off. It should be energy efficient, but not an ugly, toxic fluorescent lamp. A string of LEDs perched on the window frame would be just about right.

There are two lighting goals for this project. The first is to provide back fill light for reading a book. Most of the light in the room would still come from the ceiling fixture, but the LEDS will bounce extra light on the ceiling behind the reader and illuminate the page. The second goal is to have house lights for watching TV and movies. Lights that can be controlled by remote, so that after watching a movie in the dark, I don't have to stumble across the room to turn on the lights. The LEDs alone achieve the first goal. The second needs some computer automation.

A single LED module

The easiest way to control the LEDs and provide a nice dimming function to ease transitions in and out of black is to do pulse width modulation (PWM) which is electronic-speak for turning something on and off real fast. You could do this with just a parallel port on a computer, but it makes more sense to have a programmable controller like the one on an Arduino handle a task like that.

To construct the system, I bought 20 white LED modules from SparkFun, and strung them together in two channels of 10 modules each. The mounting brackets they provide (I broke off the screw attachment and just used the double sided tape) have enough room to thread the jumper cable for the second channel through the brackets for the first. With this method, alternating modules are on channels in an odd/even configuration. This is helpful in the low end of the dimming range where the ability to have the different channels at separate levels gives the appearance of smoother dimming.Graph of output functions

The Arduino is very simple to use. It has a Java based IDE so that you can instantly upload your programs to the controller and test them out. I wrote a program that receives input over the USB connection and sets PWM values appropriate for the desired light level. Setting the values linearly didn't produce a fade that felt linear, so I applied a simple exponential function to adjust the output to appear more linear. I used different functions for each channel so that in the lower part of the fade, the channels have values with different luminosity to smooth the lower end, but as they increase in value, they approach 1 and the output values are not much different in luminosity.

  • int(255*pow(x/255.0, 2.0))
  • int(255*pow(x/255.0, 1.6))

The next component is the software that controls the system. It listens for IR events from an IguanaWorks USB IR tranceiver via LIRC and fades the lights appropriately. It responds to direct on/off commands, but it also watches for commands sent to other systems to infer what is going on in the room. For instance, if it sees the TV turn on, it fades the lights up, then slowly to half. After seeing further IR activity, it fades the lights out on the assumption that everyone has found their seat. When the TV turns off, the lights come back up.

I could hook up a physical button or switch to the Arduino to control the lights as well, but since my remote is programmable, why add more clutter? I have a Harmony 880 universal remote, which is activity based. To use it, one begins by pressing a button for an activity such as "Watch a DVD" or "Watch TV". I added a new activity, which may be unusual for a remote control: "Read a book".

 Remote control

0 comments

Unicorn Chaser


The Unicorn Chaser airliner

We were happy passengers on the fabulous Unicorn Chaser.  The entertainment system, which runs under Linux, worked fairly well.  It had the usual assortment of free games that come with any GNU/Linux system, Creative Commons licensed videos, and unsurprisingly, some fun problems involving video overlay colors.  But really, should anything on an airplane be "beta"?

 

 

0 comments

The world learns a great deal about San Francisco

On Monday, United States Olympic Committee Chairman Peter Ueberroth said:

"The world will learn a great deal about San Francisco during the next two days ..." (source)

A group of police officers stands on an empty street
And the world has.  We've learned that San Francisco values the freedom of expression of its residents so little that it will deceive them in order to placate a foreign power.

The Olympics may not be about politics, but at this point it's disingenuous to claim that the torch isn't.

Thousands lined up on Wednesday along the published route of the Olympic torch to celebrate the unifying spirit of the Olympic games and China's extraordinary presence on the world stage, or to protest the policies of a repressive regime and their own government's unwillingness to take a strong stand for freedom.  But they never saw the torch -- the icon of Olympic politics that drew them out.

Instead, Mayor Gavin Newsom and San Francisco's police changed the route of the torch without notice as the relay started.  The torch was escorted through streets filled mostly with the phalanx of police guarding it, whisked around from site to site by bus, and returned quickly to the airport for a perfunctory closing "ceremony".

San Francisco has shown that it values image more than truth.  In retrospect, Beijing could not have chosen a better city for the torch's only North American stop.

Confusion strikes US torch relay

Olympic torch dodges S.F. protesters

Torch leaves San Francisco after surprise route designed to thwart protesters

Torch entries on SFist

 

photo by Scott Beale / Laughing Squid

0 comments