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!)

9 comments:

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

    ReplyDelete
  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.

    ReplyDelete
  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.
    ( POKER, DOMINO99, ADU-Q, BANDAR POKER, BANDARQ, CAPSA SUSUN, SAKONG ONLINE, BANDAR66 )

    PROSES DEPOSIT DAN WITHDRAWAL CEPAT Dan AMAN TIDAK LEBIH DARI 2 MENIT.

    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

    ReplyDelete
  4. ULANG TAHUN BOLAVITA YANG KE 6

    Sehubungan dengan ulang tahun Bolavita yg ke-6
    Bolavita sebagai Agen Taruhan Judi Online terbaik dan terpercaya akan menbagikan FREEBET & FREECHIP kepada member setia bola vita.

    FREEBET & FREECHIP hingga 2.000.000 (Dua juta rupiah)
    syarat dan ketentuan cek = https://bit.ly/2SsDinv

    Gabung sekarang dan klaim bonusnya!

    Info Lengkap :
    WA: 0812-2222-995 !
    BBM : BOLAVITA
    WeChat : BOLAVITA
    Line : cs_bolavita

    Info Togel =>> PREDIKSI TOGEL TERPERCAYA

    ReplyDelete
  5. Happy Good Day para member setia AGENS128, oke gengs kali ini kami akan memberikan refrensi untuk kalian semua yang sedang mencari permainan TOTO ONLINE dengan bonus terbesar yang akan kami berikan kepada kalian semua, jadi untuk kalian yang mau mencoba bermain bersama kami dengan bonus yang besar yang akan kami berikan kepada kalian,kalian bisa mendaftarkan diri kalian sekarang juga dan menangkan BONUS YANG BESAR HANYA BERSAMA AGENS128.

    Untuk keterangan lebih lanjut, segera hubungi kami di:
    BBM : D8B84EE1 atau AGENS128
    WA : 0852-2255-5128

    Ayo tunggu apalagi !!

    ReplyDelete
  6. Menangkan Jutaan Rupiah dan Dapatkan Jackpot Hingga Puluhan Juta Dengan Bermain di www(.)SmsQQ(.)com

    Kelebihan dari Agen Judi Online SmsQQ :
    -Situs Aman dan Terpercaya.
    - Minimal Deposit Hanya Rp.10.000
    - Proses Setor Dana & Tarik Dana Akan Diproses Dengan Cepat (Jika Tidak Ada Gangguan).
    - Bonus Turnover 0.3%-0.5% (Disetiap Harinya)
    - Bonus Refferal 20% (Seumur Hidup)
    -Pelayanan Ramah dan Sopan.Customer Service Online 24 Jam.
    - 4 Bank Lokal Tersedia : BCA-MANDIRI-BNI-BRI

    8 Permainan Dalam 1 ID :
    Poker - BandarQ - DominoQQ - Capsa Susun - AduQ - Sakong - Bandar Poker - Bandar66

    Info Lebih Lanjut Hubungi Kami di :
    BBM: 2AD05265
    WA: +855968010699
    Skype: smsqqcom@gmail.com

    ReplyDelete
  7. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.
    5g

    ReplyDelete