So, the other day I was messing around with my Raspberry Pi, and I got this crazy idea to make it play the “Eye of the Tiger” song whenever someone walked past it. I called it the “Eye of the Tiger PAC-MAN”, ’cause, you know, it’s like a security system but way more fun.

Getting Started
First, I grabbed my Raspberry Pi 4. I’ve had this thing for a while and used it for all sorts of projects. I also made sure I had a microSD card with the Raspberry Pi OS installed. I flashed the OS onto the card using the Raspberry Pi Imager – super easy, even if you’re not a tech whiz.
Setting Up the Hardware
Next, I needed a way to detect motion. I dug out an old PIR motion sensor I had lying around. These things are pretty cheap, and they’re great for detecting movement. I connected the sensor to the Pi’s GPIO pins. It was a bit fiddly, but there are tons of tutorials online that show you exactly how to do it. I followed one of those, just to be sure.
I also needed some speakers, obviously. I used some basic USB-powered speakers that I had. Nothing fancy, just something to blast the song.
Coding the Magic
Now for the fun part – the code! I decided to use Python because it’s pretty straightforward, and there are lots of libraries available. I found a library called gpiozero
that makes it super easy to interact with the PIR sensor. I also used the pygame
library to play the audio file.
I wrote a simple script that did the following:

- Waited for the PIR sensor to detect motion.
- When motion was detected, it played the “Eye of the Tiger” MP3 file.
- After the song played, it went back to waiting for motion.
It took a bit of trial and error to get the timing right, and I had to tweak the sensitivity of the PIR sensor a few times. Sometimes it would trigger when a fly buzzed past, and sometimes it wouldn’t even notice me waving my arms like a crazy person.
Putting It All Together
Once I had the code working, I set up the Raspberry Pi and the sensor near my front door. I hid the wires as best as I could, so it wouldn’t look too messy. Then, I waited. The first time someone walked by, and that iconic guitar riff started blaring, I almost jumped out of my skin! It was awesome!
Final Thoughts
This was a really fun project. It was a good way to brush up on my Python skills, and it was pretty satisfying to see it all come together. Now, whenever someone comes to my door, they get a little dose of 80s rock and roll. It’s definitely a conversation starter, and it always makes me smile. I might even add a camera later so I can see people’s reactions!