Using the Rasp Pi to make Halloween really spooky

Waving and Speaking

The ghost should not be in spook mode for the entire evening on Halloween, so a passive infrared (PIR) motion detector [5] starts the mechanism moving by waking up the ghost when a person comes near. The sensor works together with the GPIO interface on the Rasp Pi without any problems. You can set sensitivity levels via one of the two potentiometers.

In addition to moving its arms, the ghost also makes noise. This requires hooking up a loudspeaker to the jack on the Rasp Pi and then playing back recordings of some Halloween-appropriate screeching. (See the gost.wav file on the FTP site [2].) The loudspeaker does not need to be anything special. The Play tool, which is called via

sudo apt-get install sox

suffices for a trial run. If playback does not work right away, you can convince the nanocomputer to cooperate and use the corresponding jack for sound output with:

$ sudo amixer cset numid=3 1

You can use an arbitrary WAV file for testing. First, enable the SPI module in raspi-config under the Advanced Options menu. There you answer two questions with Yes. As soon as the tool is closed, it will want to restart the computer, which is what should happen. As soon as you can access the Rasp Pi again, the SPI module needs to be loaded via gpio load spi. This should now work without any errors.

Final Assembly

To create a really a scary ghost from the individual components, you also need a white tablecloth or sheet to cover the construction. The material should be thin enough for the LEDs to shine through. Figure 4 shows the completed Halloween ghost with the Rasp Pi. You can download two videos that show the finished ghost in action [2].

Figure 4: After the complicated final assembly, the ghost is ready for use.

The Rasp Pi 2 (RPi2) has enough computing power for you to program this project in Java. This language is ideal for the hardware, as long as the suitable Pi4J library is used and you have sufficient CPU power available. The Pi4J library controls the GPIO interface with Java. For this to work error free, you must do some preparatory work before installation.

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content