Hacking an IKEA HÅRTE work light for bedtime

Non destructively teaching bedtime routines to a cheap USB work lamp.

Posted by Lotek on Thursday, 1st January 1970


Like all the males in my family, my son Teddy finds it hard to sleep at night. As he's not of an age where he can usefully repurpose the wee hours for electronics projects, he, along with my father and I, set about making something by day that could help at night.

Ted already has an IKEA lamp which offers good quality light, but his tendency is to micro focus it on the page of his book or directly into his own face. Needless to say, that doesn't help with the insomnia. He also gets scared in the dark, so won't sleep if he perceives the light level is too low. 

One solution would be to mount the bedside lamp sufficiently far from his reach, but that tends to mean that he just calls his mother and I upstairs relentlessly to point the light into whatever corner is scaring him. That's not the intention of home automation.

Ted likes and trusts his lamp, and wasn't overly happy with the idea of my opening it up and pulling about with the innards. Thus, the solution we seek isto find a way to non-destructively add smarts to his existing lamp, allowing it to fade down at bed time and, whilst responding to his own inputs in terms of direction and power, still set a maximum lux level for any particular point in the evening.

The donor

Our start point was this £15 desk lamp

As you can see, its a 5V USB powered lamp, pulling somewhat less than 3W from 8 LEDs on a flexible arm. Being laptop powered, it can't need more than an amp.

Its easy to position, robust, and has a nice wide beam that keeps Ted feeling safe. Its also easy to replace, should I accidentally feed it something nasty :)

The build

As the body of the lamp is very small, there's nowhere to hide the cleverness. I knew I'd need room for a microprocessor, local switch, and power supply unit at least, so had a look in the parts bin. I got stuck momentarily, as I didn't know how big the enclosure needed to be until I'd built the circuit, but couldn't shape the circuit board until I knew how big the enclosure was. In the end, I just bought a reasonably compact shell, drilled a hole in one end for the power lead, and box-filed two slots for a switch and a USB socket.

I'd need

Box needs to isolate power and provide 2a. Didn't want to break IKea lead, so needed a power brick with a USB output, room for a microprocessor and supporting circuitry, and capable of sending on a PWM'd 5V 1A. Ideally, I'd find a way to bypass the inline switch.

I can see when he has turned it on, how many times he spikes it back up,  set it for an hour remotely, etc.

As it has a simple USB output, we can travel with it, and I can pair it to my phone to allow roaming internet access and remote control. 

This is an affordable way to get started.

for proof of concept