Raspberry Pi Halloween Projection 2023

by ITdabbler in Circuits > Raspberry Pi

348 Views, 2 Favorites, 0 Comments

Raspberry Pi Halloween Projection 2023

Screenshot 2023-11-07 133133.png

This is an updated version of the a Motion Sensing Scare projection with a raspberry pi. I used this: Motion Activated as a guide to start. The referenced guide will give you the general idea on what is going on, but most of the components and programs in there are no longer and option. You need to have a general sense of how to load raspain on your Pi and run a python script. I used an old set of computer speakers, but I would possible look to use something louder for better effect.


Supplies

Raspberry Pi

Projector

Screen

Speakers

Motion Sensor

Ethernet Cable

Pi GPIO Terminal Block

Video Files (Atmos FX)

Gather All Needed Materials

Before you dig into this project, make sure you have your raspberry pi loaded with the latest version of raspain and updated. I also used a monitor when I was getting things configured as it was easier to see during the day. I also had to remove my pi from the case in order to get the GPIO Terminal block attached. A keyboard/mouse are helpful in this process but you can also use SSH when you are getting started. Note you need to run the script from Terminal on the pi not thru SSH.


Wire Motion Sensor

PXL_20231107_163241058.jpg
PXL_20231107_163247909.jpg
PXL_20231107_163223096.jpg
PXL_20231107_165811856.jpg

Just like GWPoulos did I used an ethernet cable that I had lying around the house since I knew I would need to have the motion sensor away from where the projector/pi was when the project was completed. It is important to know the voltage required on your motion sensor not to fry any part of your setup. The motion sensors linked are 5v. Cut both ends of your ethernet cable and choose 2 pairs of wires to works with, I used Orange/Orange White and Brown White.

Orange = Power, Orange White = Output and Brown White = Ground. I also used an IC connector kit that I had from a pervious project as not to have to solder the connections but use what you are comfortable with. I used pin 1021, gnd and +5v on the one row. As long as your wiring matches up end to end on the cable there should be no issue. In my example if you have wired this correctly 1021 should light with motion.

Create Video Files

You can use any video files that you would like for this project. AtmosFX is a great resource for high quaility video files and they offer a digital download version. The code we are using allows for multipe files and will select them at random. Use one or more files to suit your needs. Once you have your video files you need to copy them to your pi. Using WinSCP is one of the easiet methods to transfer files. Note your path that you place your video files, you will need that to use that path for your code.

Apply Code

Attached is sample python code. I placed this in the root of my pi using WinSCP. Modify the code to your correct path of your videos. Rename file as you want.

Downloads

Test & Adjust

Open Terminal on your desktop, Sudo Python SampleScare.py to execute. Make sure your video plays and retriggers. I had to adjust my volume levels on my pi to correctly hear the audio on the speakers.

sudo amixer -c 0 cset numid=1 100% This will set the volume to 100%

After you are happy with the way your video is being triggered and audio is good. I set my desktop to black and set screensaver to trigger after 1 minute.



Setup Projection

You need to create some sort of screen to project on to. I was pressed for time and used a frosted shower curtan that I zip tied to some PVC. Thereiis special fabric you can buy, use Plexi glass or other materials that suit your needs.

I also added a fog machine for extra effects.

Have Fun and Scare some good ol Tricker Treaters!