- 1 laptop with Crumble software installed
- Crumble controller, Sparkle baton & single Sparkle
- 1 Crumble-friendly battery box; 3 AA batteries
- Croc-leads and a micro-USB cable
- A “line follower” module
- Cereal box; egg box, empty wipes packet; cardboard; paint; paper; pens; pin, scissors
- Sellotape, glue stick and adhesive velcro strip
Connecting the Crumble
A Sparkle baton was used to give the “spooky” green glow. Croc-leads connect the “+”, “-” and “D” pads on the right-hand side of the Crumble to their counterparts on the left-hand (input) side of the baton. Another single Sparkle was connected to the output of the baton. This will glow red when the Castle door is opened.
The Crumble and Sparkles are powered by 3AA batteries. Croc-leads connect “+” and “-” pads on the battery box to the power-in pads on the top left of the Crumble.
In order to detect when the castle door is opened and so trigger the red Sparkle, we used the CRV line follower module. These have optical reflective sensors at each end which contain an IR LED and a phototransistor. As well as detecting black and white they can, therefore, be used as proximity sensors. The module is powered by connecting the “+” and “-” pads to the second pair of pads on the battery box. The left output (“L”) is connected to the Crumble’s input “A”.
Programming the Crumble
The program uses 2 random numbers to give a flickering fire effect. The range of variable “t” is 2 to 255 and sets the brightness of the green LEDs. Variable “u” picks a random number between 0 and 7: the index numbers of one of the Sparkles in the baton. Thus, the brightness of all the green Sparkles is varying randomly.
Variable “v” monitors “Input A”, which is connected to the line following module. When the voltage from the module is higher than a certain threshold, the single Sparkle (index number 8) is turned to red. The Crumble software continuously updates the values of the variables being used (when the Crumble is connected) so we can investigate how opening and closing the Castle door changes “v”. We can then see what threshold is required in the if-block.
Making the Castle
The castle is made from a cereal box with the hinged lid of a wipes packet for the door. We cut holes in the cereal box for the windows, but then covered them with a sheet of paper which had the windows coloured in with black felt-tip pen. We used a pin to make small holes in the paper and create a green glow.
We cut a door out of cardboard, added some detail with a black pen, and glued it onto the wipe packet lid. Our 5-year-old drew a “zombie” behind the door and I used a pin to prick out his eyes and mouth. We put the Sparkle baton along the bottom of the cereal box and sellotaped the single Sparkle behind the zombie’s face. The line follower module was also taped behind the door, with a hole cut level with the sensor.
The rest of the electronics was placed inside the cereal box. A piece of adhesive velcro was used to stick the battery box close to the top so that we could easily unclip one of the croc-leads to turn the Sparkles on and off.
The roof is the bottom of an egg box and simply rests on top. The whole castle was given a couple of coats of grey paint and a “garden” to sit in. Finally, our five year-old added a sign to warn off the unwary! Happy Halloween!!