Alarm Clock

Just for fun I am going to make a nanopixel RGB LED strip as a wall-washer for my childs bedroom. The pattern is controlled by time (dim at bedtime, becoming bright at different times depending on whether its a school day)

Has anyone done this before? I am torn between making the time aware bit on the imp, imp-cloud, my web server or an IFTT type service.

If you have cut-code to do this before is it something that could be reused?

I’ve been thinking about building something similar, but haven’t decided exactly how I’m going to do it yet.

A lot of the questions (as always) come down to power, and timing. Is it going to be plugged in, or battery powered? If you set an alarm for 7:00am, do you want the alarm to go off at 7:00am, or 7:00am-ish (give or take 1 or 2 minutes)?

In my head it makes the most sense to have the time aware bit on the imp or in the imp cloud, and use your web server / and IFTTT service to schedule.

I’m using the weather channel API for similar things. You can get date and time as well as sunrise and sunset, which may or may not be useful. The way mine works is:
Get information for the next event, and calculate how long till then, then sleep till the event. Then wake and repeat for the next event. If anything at least it is a free time and date service. I was using it to turn my Christmas tree on and off at sunrise and sunset. Here is some code if it is helpful.

Maybe I should make a control panel for my Pitchfork app that allowed you to set alarms. And how about an imp alarm clock with an ePaper display?

I’m curious about using realtime clock hardware …

Has anyone tried to use this with an Imp?
https://www.sparkfun.com/products/99

That one uses 5vdc …

so that might not be as nice as this one … which can use 3.3v…

http://www.samuraicircuits.com/MediaWiki/index.php?title=Mama’s_Extremely_Accurate_Real_Time_Clock

The imp’s RTC will work fine - ie no need for another RTC - but it takes more power than those devices (ie 4-6uA depending on module or card).

If you’re looking to be able to run the imp battery dead and still have the RTC work then an external solution is likely what you need though!

I am going to power it all using an old usb psu as the neopixel runs at 5v, using a USB psu also means if I need to make it portable I can use an off the shelf usb batterypack.

I am planning to get the 5v by hardwiring to the USB connector on the board.

I think if an app could be used to control it, that would be great, my idea would be to pass a fade time as well as the RGB values to give her a gentle wake-up, in fact I think passing a fade time with a color/lighting values is good practice anyway.

The alarms themselves wouldn’t be the same everyday as we would like a lie-in at the weekend (who am I kidding).

The idea of universal imp-paper that could be setup as an alarm clock would be great

If you’re going off USB power the RTC in the imp should be fine!

I actually have some code for smoothly fading between colours, you can specify a start colour, end colour, and time - and it will do a linear fade between the two)… Let me know if you want to take a look (if you want to play around and figure it out yourself, that’s cool too) - let me know :slight_smile:

That would be cool, in architectural lighting systems, as well as fade, they have a “stop fade” command, the idea is for manual control of fading you can reduce network traffic by having one packet describing and starting the fade on button down and a second stopping the fade on button up (rather than a stream of packets describing the fade as you would do in DMX for example)

This should get you started:

https://github.com/beardedinventor/ambient-orb/blob/master/ambient-orb.device.nut

You’ll need to do a tiny bit of work (in the RGB class) to make it function with NeoPixels, but it shouldn’t be too bad…

All of the fading happens “in the background” with imp.wakeups, so other things can be going on while you’re fading between colours.

Just waiting on the final bits (the psu and a cap for dc spike protection)

So far I have an imp, an april, a 60 x60ma nanopixel strip and some mini arcade style buttons.

the only question in my mind is whether I should put a 3.3v - 5v shift on the data line (fried imp anyone?)

I am trying to avoid it ideally as I wanted to see if I can make the project component-free “plug and play” (though I failed by adding a snubber cap though)

As you’re driving a 5v input from a 3.3v pin, you won’t fry the imp - it might just not work. The issues come when you feed a 5v output into the imp’s 3.3v input.

I know the bearded inventor has run a neopixel off an imp before, so it may not be an issue for an least the first few, whether or not the signal reaches pixel 60 we shall find out…

Let us know… I haven’t used more than 17 so far. As soon as my Aria boards arrive, (hopefully tomorrow), I’m going to make an “arc reactor” out of a neopixel ring, imp002, sparkfun powercell lipo charger and a small LiPo, that I can directly attach to a t-shirt. I’m going to use the Twitter search code to let people change the color and intensity.

@back_ache - The NeoPixels have 3 pins - power, gnd, and data. I have successfully the run the data line off an imp before, however you still need an external 5V line for power.

We’ve successfully run a 16x16 board of neopixels with this setup (external 5v supply for powering the NeoPixels, and using one of the imps pins for data).

It’s also worth noting that each NeoPixel in your chain can use up to 20mA - so if you have a long chain, and want to be able to drive them at full brightness, you’re going to need a power supply that can source a lot of current (we use this 5V 10A switching power supply for our big board of NeoPixels.