Tuesday, 23 December 2014

The Wendy Light

After watching Wendy suffer repeatedly in the mornings, I've decided to build a prototype light based alarm clock. The idea being that (as various research / existing products indicate), waking up as a result of changes in light is much nicer than load angry noises.

The system will initially be simple. I'll preset an MR005-001 clock breakout board (containing a DR1307 chip) to the 'correct' time from my PC, and use it to trigger a NeoPixel led strip.

Research as I undersand it suggests that your circadean rythm is largely dictated by ipRGC sensors in your eyes. These are especially sensitive to blue wave lengths, and not very sensitive to red; my clock will feature a red reading light (that automatically fades off after an hour), and a blue wake up light triggered at 8AM.

The initial step was setting up this real-time clock chip:

The clock, along with some stunning soldering (ahem)

It's a DS1307 real time clock break out board, that communicates with the Arduino over I2C. Fortunately, the folks at Adafruit have been good enough to provide a ready made Arduino library to supplement it, so getting the thing going is pretty easy. Here it is wired up:

The clock hooked up to the I2C pins of an Arduino Mega

And running their demo shows the time/date being regularly printed out just as you'd expect.

Next up, is the very funky neopixel LEDs. Also from Adafruit, these awesome full colour LEDs come in various forms (strips, grids, rings) and are great fun to play with. And of course, in true Adafruit style, a ready made Arduino library exists, so they're pretty much plug-and-play.

2 strips of Neopixels running at full whack

A quick point of note - if you do get some Neopixels (and I highly recommend it), it is really important to read the Adafruit guide. The strips work out of the box, but the information supplied about current requirements and protective components is worth knowing before you even think about plugging anything in. Reading documentation isn't my strong point, but after half an hour working out why my Arduino shut down whenever I turned them on, and 2 strips of destroyed LEDs, I begrudgingly read the docs and felt very silly for not doing so!

If you do blow some LEDs, often it'll only be the first few in the strip. Try chopping off the first few and the odds are the rest of your strip will be fine.

Also worth knowing that these LEDs use up a healthy number of amps on full power, so it'll be worth investing in a decent transformer. I'm running 86 LEDs at full brightness off a 4A supply from oomlout, which is doing the job nicely; For similar reasons, make sure your wiring can take enough current, or you'll end up with melted plastic in your project!

The final job is some basic wiring up of chunky switches, and some bodgy carpentry to mount them in a box. With the LEDs fixed to a chunk of door frame edging and stuck on top of the bed, we're all set.

Chunky buttons on Wendy's side of the bed
Inside of the button box
The Arduino and clock hidden under the bed
The LED strip lit up orange in 'reading light' mode

The circuitry is pretty simple, as there's no clever components going on here. Standard switch wiring up, plus the data line for the LEDs and the I2C lines for the clock:

You can see here 4 separate blocks (each in its own little actual physical wooden box). These break down into:

  • The main clock circuit, consisting of the Arduino and the DS1307 clock.
  • The lights, with a small protective circuit; a big capacitor to protect against spikes, and a small resistor to protect the data line.
  • Switch Box 1 (on Wendy's side of the bed). This is just a collection of grounded push switches, each connected to an IO pin on the Arduino.
  • Switch Box 2 (on my side of the bed). Due to a lack of chunky switches in my collection, this currently only contains a switch for the reading light, but would eventually have the same set as switch box 1.

The full code can be downloaded here.

And last but not least, a video of the clock in action!

Next up, once I've refined the code a little I'll be updating the system to be a little more aesthetic, and probably implement a few handy extra little features like setting the time/alarm.

(update, if after reading this lovely blog you are so excited you want to see more, the next step is here!)


  1. This comment has been removed by a blog administrator.

  2. Hello Friends, THIS IS REAL AND NO SCAMS. Are you a man or woman? Are you looking for the sex robot that can satisfy you sexually? do you want to satisfy your sexual urge? Do you want to purchase the sex machine? My name is Osborn Edward and i want to tell you that you do not have to worry or bother because i bought the sex robot and i like it. i have sex with the machine when ever i want. If you are interested and you need the sex machine, contact them now on their email:
    advanceworldoftechnology@yahoo.com Tell them the type of robot you want and they will sell it and deliver it to you... This is real. this is where i got my own from.

  3. MestiQQ Adalah perusahaan judi online KELAS DUNIA ber-grade A

    Sudah saatnya Pencinta POKER Bergabung bersama kami dengan Pemain - Pemain RATING-A

    Hanya dengan MINIMAL DEPOSIT RP. 10.000 anda sudah bisa bermain di semua games.

    Kini terdapat 8 permainan yang hanya menggunakan 1 User ID & hanya dalam 1 website.


    100% tanpa robot, 100% Player VS Player.
    Live Chat Online 24 Jam Dan Dilayani Oleh Customer Service Profesional.

    Segera DAFTARKAN diri anda dan Coba keberuntungan anda bersama MestiQQ
    ** Register/Pendaftaran : WWW-MestiQQ-POKER
    Jadilah Milionare Sekarang Juga Hanya di MestiQQ ^^

    Untuk Informasi lebih lanjut silahkan Hubungi Customer Service kami :
    BBM : 2C2EC3A3
    WA: +855966531715
    SKYPE : mestiqqcom@gmail.com