For some time I have been wanting to create a fun, engaging project with my two daughters, age seven and nine. As summer came to an end, they both began talking abort costumes for Halloween, and we even have a kind of get-together in one of their classes – with costumes and all.
Traditionally this is not a massively celebrated holiday in Denmark, but it’s on the rise and more and more are trick or treating. So it struck me, that we needed to have some device that would detect whenever someone approached the front door, they would be greeted by something spooky and/or frightening. Enter Skull!
I will be placing the RPi along with a PIR Sensor inside the skull. On account of size vs volume, the loudspeakers will not fit inside. I bought a standard set of computer loudspeakers which even came with a subwoofer, at a bargain of just DKK 200 ~ $30. I’ll have none of that portable speaker stuff – I want a lot of dB.
A bunch of nasty and creepy screams have been downloaded, and will be used those to scare of any trick or treaters. Only thing to keep in mind is, the Windows 10 Core supports only .wav files out of the box.
In basic steps, the code will fire up, start listening to GPIO(4), where I hooked up the PIR sensor. Once the sensor detects a change, an event gets triggered, and a random sound bite will be played. After each sound bite, there is a period of 5-10 seconds of non-detection, where we ignore the sensor’s readings. After end non-detection, the PIR sensor reading can once again trigger a new sound bite.
The PIR Sensor is real easy to work with, as it requires only power, ground and then you get the read out.
I will post a video of the skull in action, once Halloween is over. This is how the Skull looks with the PIR Sensor attached with rubber bands. It’ll turn Cyberdyne eventually…
PS: I have experienced a few hiccups during even this simple development process. Deploy from Visual Studio is as touchy as a teenage girl on a first date. It’s clear that development capabilities on the IoT platform is in the early stages. Error messages are funny, at best. Often they are really, really confusing.
The one thing I was spending most time on, was actually to get the BackgroundMediaPlayer to play. Turns out the attribute AutoPlay has to specifically be set to false. WTF?!
Well, here is the setting for the Skull – I am thinking it sitting right between the two pumpkins.
Happy Halloween everyone!
Comments