This year our Crumble Christmas decoration uses a servo to control an “animatronic” Santa leg stuck in a chimney decorated with twinkling lights.
- 1 laptop with Crumble software installed
- Crumble controller; a flexible strip of 30 Sparkle LEDs and a micro Servo (both with crumblisers attached)
- 1 Crumble-friendly battery box; 3 AA batteries
- Croc-leads and a micro-USB cable
- Cardboard blocks, cotton wool balls, cardboard; red and black paint; sellotape & PVA glue
Making the Chimney
The Chimney is made from some sturdy, red cardboard building blocks, that we already had at home, with cotton wool balls stuck on for the “snow”. Santa’s leg is cut out from a cardboard box, painted red and black, with more cotton wool balls as a fur trim. The turning part of the servo is sellotaped onto the back of the leg (excuse the Stormtroooper: we used the box from a Star Wars toy) and the body of the servo is taped onto a smaller yellow block that sits behind and inside the chimney. The Crumble and battery box also rest inside.
Connecting the Crumble
The Crumble was connected to the battery box with croc-leads and to the computer, using the USB lead. The micro-servo has three connections: power (“+”, “-“) and “control” (labelled “S” on the crumbliser). The power pads were connected to the second set of pads on the battery box and “S” was connected to the Crumble’s pad “C”. The Sparkle strip was connected to “+”,”-“, and “D” on the right-hand side of the Crumble and then wrapped around the base of the chimney.
Programming the Crumble
The servo control block needs to tell the Crumble which output the servo is connected to (in this case “C”) and the angle to set the servo. As this is an absolute, rather than a relative number, we had to do a bit of experimenting. Eventually, we determined that the servo needed to move between 65 and 85 degrees. To slow down the transition, we used a loop which steps the servo 1 degree every 60 milliseconds and a variable “x”, which alternates between 1 and -1, to make it move back and forth. We wanted the Sparkle strip to change colour at the same time as the servo is moving. As there are 20 steps in the loop to move the servo, the simplest way to do this was to use only 20 of the Sparkles. We defined a variable “sprk” to be the index number of the Sparkle. Every time the loop is executed, Sparkles 5 to 25 are set to red, in turn. Variable “x” is used to set the adjacent Sparkle to green. Once we were happy with the effect, we disconnected the Crumble from the computer and placed our decoration on the fireplace. Can you improve on this and work out how to thread two programs together to use all 30 Sparkles? Merry Christmas!!