Archive for December, 2014

The stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 47,000 times in 2014. If it were a concert at Sydney Opera House, it would take about 17 sold-out performances for that many people to see it.

Click here to see the complete report.

In this post I detail how I created a simple ScreenSaver prevention AutoHotKey Script which can be toggled on or off with a simple key press.

What is AutoHotkey?
AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

The Problem
Due to an Internal IT policy we have a screen saver GPO set with a 10 minute timer, now ordinarily this is fine but it can be a real pain when delivering PowerPoint presentations so I created a ahkscript to move the mouse one pixel to the right and then back again every minute which tricks the computer into thinking there is an active user. This allows for a light touch workaround to the problem which can be enabled or disabled by pressing Ctrl+5. I’ve even added a Tray Tip so its easy to tell if this is running or not, for example:


;autoexecute section
preventScreenSaverVar := false ; Boolean for Screen-saver prevention label (subroutine). True = running/enabled.
SetTimer, preventScreenSaver, 60000 ; Screen-saver launch prevention label (subroutine), checks every 1 minute

global preventScreenSaverVar := !preventScreenSaverVar
if (global preventScreenSaverVar) {
TrayTip, Screen Saver Prevention, Enabled, 2, 17
else { TrayTip, Screen Saver Prevention, Disabled, 2, 17 

;ScreenSaver launch prevention subroutine
if (global preventScreenSaverVar) {
    MouseMove, 1, 0, 1, R  ;Move the mouse one pixel to the right
    MouseMove, -1, 0, 1, R ;Move the mouse back one pixel

I’ll put a mirror of this code on my GitHub. If there are any updates code wise you’ll find it there.

Thanks for reading,


In this project I detail how I created an Internet light controlled Christmas tree. Last year I heard about a great project by ioBridge Labs named CheerLights but unfortunately at the time this was late December and it was simply too late for me to join in, well not this year! The idea of CheerLights is a simple one: connect a strip of RGB LEDs to an Internet connected Microcontroller and have it query the CheerLight servers for the current colour, now the real magic here is that anyone can synchronously change the colour of every CheerLights setup by sending a Tweet with Hashtag #CheerLights, for example

Here’s a quick video from ioBridge about CheerLights including a demo

If you’d like a go yourself please choose from the following supported Colours:

Warmwhite / Oldlace

You can see what the latest colour is right now by visiting or, getting the app android/iPhone and there is even a Google Chrome plugin but at the time of writing this is missing some of the new colours.

The Build

As with all projects of this nature, they can be customised to your own personnel preferences so I’ll not tell you what you should get but instead what I used for this build and I’ll try and highlight some pointers. I’ve got a few Arduino MCUs now, in fact I’m beginning to wonder if I’ve inadvertently become a collector as it seems I’ve just about one of each type, so from my stock I decided on a combination of Arduino Uno and Arduino WiFi Shield. The only real requirement here is that you use an MCU that you are comfortable with, if you have the same hardware (or similar – replacing the WiFi Shield with the Ethernet Shield would require minimal code changes) then you can simply upload my Sketch and away you go.
To control the LEDs I decided to use the FastLED Animation Library. This is quite a mature project and the library makes for some simple and easily readable code. FastLED supports popular LEDs including Neopixel, WS2801, WS2811, WS2812B, LPD8806, TM1809, and more so plenty of options. I went with a string of 25 WS2801 from



You’ll also need a Christmas Tree, I picked up a desktop sized one from eBay –




Be sure to get a power supply that can output at the correct voltage and has sufficient ampere to run the lights. Looking at the spec of my lights I know I needed a 5volts 2A (60mA*25=1500mA) AC Adaptor. I used a single AC Adaptor to power both the Arduinos and the LEDs with a splitter.

Tip: Don’t use the VIN on the Arduino to power more than 1A as this is the maximum tolerance of the forwarding diode, instead use a splitter.

The Code

Sketch flow
Boot up and connect to WiFi (halt on no connection) and run the Startup Routine (clears LEDs Black-White-Black)
Set current colours to black.
Start loop – { Check for current colour via ThingSpeak API
If it’s the same as the last check then wait and check again, if we’ve checked a couple of times without change then play either the Sparkle* or Twinkle* effect.
If the colour is different; then transition from the original colour to the new colour via the RGB colour wheel (see below image) using the shortest path, for example Red>Green would transition via Orange and Yellow or Blue>Red would transition via Magenta-Pink.



*The Sparkle effect increases the brightness of a single LED and runs that back and forth over the strip.
*The Twinkle effect creates a FastLED Colour pallet of the current colour with black stripes which is then looped over the LED strip.

I’m using the FastLED library which made coding these transitions and effects extremely simple.. The FastLED library has a lot to offer, one of my favourites is its ability to allow for compact colour palettes which use very little of my precious Arduino RAM, here’s a sample of the help section which explains this feature:

Normally, in computer graphics, the palette (or “color lookup table”) has 256 entries, each containing a specific 24-bit RGB color. You can then index into the color palette using a simple 8-bit (one byte) value. A 256-entry color palette takes up 768 bytes of RAM, which on Arduino is quite possibly “too many” bytes. FastLED does offer traditional 256-element palettes, for setups that can afford the 768-byte cost in RAM. However, FastLED also offers a compact alternative. FastLED offers palettes that store 16 distinct entries, but can be accessed AS IF they actually have 256 entries; this is accomplished by interpolating between the 16 explicit entries to create fifteen intermediate palette entries between each pair.

If you’re interested in lighting effects then I suggest you take a look at the Wiki

You can pick up a copy my code from GitHub –

Here’s a quick demo of it in action

Thanks for reading and good luck with setting up your tree

Merry Christmas!