Scary Pumpkin and Rattling Ghosts

This year I got nerd-sniped by some cool Halloween scenes and thought, "Why not build some of them by myself"? And this led to two little projects, a scary pumpkin and rattling ghosts; both are very similarly built from an electronics perspective, but the result is quite different.

I had some unused ESP32 boards lying around in my electronics box, so I just picked two of them and started to build. As I'm not a professional electronics specialist and just do that for fun, I relied heavily on the help of an AI agent. It helped me tremendously to shape the project and debug all the wirings until it worked. It's not that I don't have any idea what I'm doing; still, I was glad to have this help.

To control the scene, the first code created (generated) was classic Arduino-style C code. I then redid the whole thing in ESPHome, because this gives me remote control through Home Assistant, which was greatly needed, for example, to disable the PIR when it got too much.

At first I set up everything on a breadboard to see if I could get it working; only after that I started to solder, which certainly was a good decision. Not everything worked properly right from the beginning; this way I could easily experiment and try different connections and parts until it worked.

Now let's take a look at the two props. I won't be able to provide a step-by-step manual, but I hope it provides some inspiration for your own projects.

The scary pumpkin

0:00
/0:09

Scary Pumpkin

When someone nears the pumpkin, detected by a PIR sensor, a little smoke machine inside the pumpkin fills it with smoke for 2 seconds, then opens the lid, flickers a bright light, and does a scary laughtering.

Electronic parts used to build it:

  • Sparkfun Thing Plus ESP32
  • HC-SR505 PIR movement detector
  • DFR1173 voice module with integrated speaker for the laughtering
  • Analog servo to open and close the lid
  • 2-channel relay to control the fog machine
  • A fog machine with batteries from Costronica
  • 3 W power LED for the flickering light

Wiring was done quite crudely by soldering stuff together; the wiring schematic shows how things are connected:

Wiring for the scary pumpkin project

The electronics part is one thing, making it work in the pumpkin so that the lid opens and closes properly is another story. This took a lot of trial; see the pictures below to get an idea. Your mileage may vary.

All the code, experiments, trial and error, and documentation are available on my code hosting. Disclaimer: This is a vibe-coded, human-steered project.

A look inside:

The rattling ghosts

0:00
/0:12

Rattling Ghosts

The motion detector activates the scene, just like the pumpkin scene:

  • A big smoke machine gets activated via the relay.
  • The servo rattles on a string that is attached to the long string where the ghosts are hanging.
  • Five WS2812B LEDs placed in the ghost's head flicker.
  • A random voice affected sounds.

Electronic parts used to build it:

  • ESP32MiniKit
  • HC-SR505 PIR movement detector
  • DFR1173 voice module with integrated speaker for the sound effect
  • Analog servo to rattle the ghosts' string
  • 2-channel relay to control the fog machine
  • A disco fog machine
  • WS2812B LEDs for the ghost's head flickering effect

And this is how everything is connected:

Wiring for the rattling ghosts project

The code is in the same repo as the pumpkin project, similarly vibe-coded and human-steered.

As this was a bit more of a "distributed" setup, I couldn't make photos of how everything works. I also had to connect long cables and make them easy to unplug. In terms of soldering, this was the first bigger soldering project in ages, also done before the pumpkin project, and I learned a lot. The pumpkin soldering was much faster, and the result was much better. For example, I first prepared all wires for the power distribution and connected all loose wires to the ESP32 board first; this way it looked way cleaner and was much faster to connect the rest.

Soldered rattling ghost project

All in all, that was a cool project, and everyone who stopped in front of our place had a big smile, and with that, achievement unlocked. 🎃

Keep reading