Go back

Seven Halloween projects you can build and run in the browser

Every October the same handful of builds comes back on Hackster, Instructables and the element14 Halloween hackathon: a skull with a servo jaw that screams when someone walks past, a pair of eyes on round displays that follow you, a painting that reacts when you get close, a pumpkin full of NeoPixels and a candy bowl that only gives sweets if you hold out your hand.

We rebuilt seven of them as examples in the Velxio gallery, one per board family, using Arduino parts and the modules of our partners Seeed Studio, DFRobot, M5Stack and Pimoroni. Each one opens in the editor with the circuit already wired and the sketch already written. Press Run and it compiles and starts in the browser, so you can tune the timing, the colours and the thresholds before you cut a single wire.

ProjectBoardMain partsOpen it
Jump-scare skullArduino UnoPIR, servo, 2 LEDs, buzzerhalloween-uno-jump-scare-skull
Candy dispenserArduino UnoHC-SR04, servo, SSD1306 OLED, buzzerhalloween-uno-candy-dispenser
The eye that follows youSeeed XIAO ESP32-S3Seeed Round Display (GC9A01 + touch)halloween-round-display-eye
Grove jack-o’-lanternSeeed XIAO ESP32-S3Grove RGB LED Ring, Light Sensor, PIR, Passive Buzzerhalloween-grove-pumpkin-ring
Haunted portraitESP32 DevKitDFRobot C4001 mmWave radar, 2 LEDs, buzzerhalloween-c4001-haunted-portrait
Ghost detectorM5Stack Corebuilt-in LCD, buttons and speakerhalloween-m5stack-ghost-detector
LED-matrix pumpkinPimoroni Stellar Unicorn16x16 RGB matrix, buttonshalloween-stellar-unicorn-pumpkin

Searching for halloween on the examples page lists all seven.

The photo at the top of five of the sections is an illustration of how the finished prop could look, generated with AI. Every other picture in this article is a capture of the example running in Velxio.

How to open and run any of them

  1. Click the project link in the table. The editor opens with the board, the parts, the wires and the sketch in place.
  2. Press the green Run button in the toolbar. The sketch compiles on our servers (the first build of a board can take a minute) and then runs in your browser.
  3. Open the Serial Monitor at the bottom. Every sketch prints what it is doing, so you can see the props react even with the sound off.
  4. Click a sensor on the canvas while the simulation runs to open its panel. That is where the distance, light and presence sliders live.

1. Jump-scare skull (Arduino Uno)

An AI illustration of the finished jump-scare skull on a porch: red LED eyes, a servo pulling the jaw open, a PIR sensor in front and an Arduino Uno with a buzzer behind

Illustration of the finished prop, generated with AI. The circuit below is the one that runs in Velxio.

The classic porch prop. A PIR motion sensor on D2 watches the doorway. When someone walks past, two red LED eyes on D5 and D6 flare to full brightness, a servo on D9 makes the jaw chatter four times and a buzzer on D8 screams with a siren that slides from 1.8 kHz down to a growl. Between visitors the eyes smoulder like embers, and a four second cooldown stops the skull scaring the same person twice in a row.

The jump-scare skull on an Arduino Uno: PIR sensor, servo jaw, two red LED eyes and a buzzer

To try it, click the PIR sensor on the canvas. The output goes HIGH for three seconds, which is what a real HC-SR501 does with its delay pot turned all the way down.

The whole scare is a short function. Note that tone() on the Uno uses Timer2 and the Servo library uses Timer1, so the scream and the jaw never fight over a timer:

void scare() {
  eyes(255);
  for (int i = 0; i < 4; i++) {          // the jaw chatters four times
    jaw.write(JAW_OPEN);
    if (i == 0) scream(); else delay(160);
    jaw.write(JAW_CLOSED);
    delay(140);
  }
  eyes(40);
  lastScare = millis();
}

2. Trick-or-treat candy dispenser (Arduino Uno)

An AI illustration of the finished candy dispenser: a painted jack-o'-lantern box with a candy tube, an ultrasonic sensor over the bowl, a chute dropping a candy, an OLED and an Arduino Uno behind a side window

Illustration of the finished prop, generated with AI. The circuit below is the one that runs in Velxio.

A touch-free candy bowl. An HC-SR04 ultrasonic sensor points up from under the chute and looks for a hand closer than 10 cm. When it finds one, a servo opens the gate, drops one candy and closes it again, the buzzer plays a short jingle and an SSD1306 OLED counts down what is left, with a small jack-o’-lantern drawn in the corner. When the stock runs out the screen says TRICK and the buzzer laughs at you instead.

The candy dispenser on an Arduino Uno with the gate open and the OLED counting the candy

Click the HC-SR04 and drag its distance slider under 10 cm to hold out a hand. The sketch then waits until the hand is pulled back, so one wave is one candy and nobody empties the bowl by leaving a hand in place.

3. The eye that follows you (Seeed Round Display for XIAO)

An AI illustration of a skull prop with two Seeed Round Displays as its eyes, each showing a bloodshot eye with a slit pupil

Illustration of a finished pair of eyes, generated with AI. The example in Velxio runs one display; a pair is two of them.

Eyes on round TFT displays were everywhere in last year’s element14 Halloween hackathon, from 3D-printed skulls to radar-triggered props. This one uses the Seeed Round Display for XIAO with a XIAO ESP32-S3 seated on its back. The 1.28 inch GC9A01 shows a bloodshot eyeball with an orange iris.

A bloodshot eyeball on the Seeed Round Display, the pupil looking towards where the glass is touched

Press on the glass and the pupil chases your pointer. Keep pressing and it narrows into a cat’s slit. Let go and it goes back to glancing around the room on its own and blinking every few seconds.

The touch controller is the CHSC6X on the shield, read the same way Seeed’s own driver reads it: a falling edge on D7 says a finger is down and a five byte I2C read at 0x2E returns the position. Each frame is drawn into an off-screen sprite and pushed to the glass in one go, so the panel never shows a half-painted eye. Only the 174 pixel square the iris can reach is redrawn; the rim with its veins is painted once, and again after each blink:

static void drawEye() {
  frame.fillScreen(TFT_BLACK);
  drawSclera(frame, BX, BY);           // the part of the sclera inside the box
  ...                                  // iris, streaks, pupil, glint, eyelids
  frame.pushSprite(BX, BY);
}

The pins are the shield’s own, so the same sketch runs on the real stack.

For a pair of eyes, build two: a skull or a carved pumpkin takes two Round Displays in its sockets, each with its own XIAO running this sketch. They glance and blink independently, which reads as more alive than two eyes in perfect step.

4. Grove jack-o’-lantern that wakes at dusk (Seeed XIAO ESP32-S3)

An AI illustration of the finished Grove jack-o'-lantern: an LED ring glowing green and purple inside a carved pumpkin, with a XIAO board, a PIR and a light sensor on Grove cables beside it

Illustration of the finished prop, generated with AI. The circuit below is the one that runs in Velxio.

Four Grove modules on a XIAO ESP32-S3 make an insert for a carved pumpkin. The Grove Light Sensor keeps the 42-LED Ultimate RGB LED Ring dark in daylight. Once it gets dark the ring flickers orange and yellow like a candle, each LED with its own flame. When the Grove PIR sees someone, the pumpkin is possessed: a green and purple vortex spins round the ring and the Grove Passive Buzzer plays a few bars of a spooky tune.

The Grove jack-o'-lantern: an Ultimate RGB LED Ring flickering like a candle next to a XIAO ESP32-S3, a light sensor, a PIR and a passive buzzer

To try it, click the light sensor and drag its slider down to make it night, then click the PIR and trigger it.

The same circuit with the ring spinning green and purple after the PIR fired

On real hardware, power the ring from the XIAO’s 5 V pad (the example is wired that way) and keep the brightness low: 42 WS2813 LEDs at full white draw far more than a USB port likes to give.

5. Haunted portrait (DFRobot C4001 mmWave radar)

An AI illustration of the finished haunted portrait: an old painting in a gilded frame with glowing red eyes, and on the back of the canvas the mmWave radar, an ESP32 board and a buzzer

Illustration of the finished prop, generated with AI. The circuit below is the one that runs in Velxio.

The painting whose eyes follow the room is an old fairground trick, and a radar makes it a better one. The DFRobot C4001 (SEN0610) is a 24 GHz mmWave sensor that measures how far away a person is, and its signal goes straight through a canvas and a wooden frame. Hidden behind the picture, nothing gives it away.

The sketch puts the radar in speed mode, where it reports range as well as presence. The closer you stand, the brighter the portrait’s two LED eyes burn and the faster a heartbeat thumps on the buzzer, from one beat every 1.5 seconds at six metres to almost three a second up close. Step inside one metre and it shrieks.

The haunted portrait circuit: an ESP32 DevKit, the DFRobot C4001 radar, two red LED eyes and a buzzer

Click the radar and drag its distance slider to walk up to the painting.

// 6 m away: a dim glow. Right in front: full blaze.
float closeness = constrain((FAR_M - range) / (FAR_M - SHRIEK_M), 0.0f, 1.0f);
eyes(10 + (int)(closeness * 245));

6. Ghost detector (M5Stack Core)

A game more than a prop, and the only one with nothing to wire. The M5Stack Core Basic draws a needle meter that reads the “spectral field” of the room. The needle wanders on its own and every so often spikes into the red HAUNT zone; that is when a ghost floats onto the screen and the speaker starts to crackle.

The ghost detector on an M5Stack Core: a needle meter in the red zone and a ghost on the screen

The three front buttons are the controls:

The meter is drawn into an 8-bit M5Canvas sprite and pushed in one go, which keeps the needle from flickering. A full-screen 16-bit sprite would not fit: the Core Basic has no PSRAM.

7. LED-matrix pumpkin (Pimoroni Stellar Unicorn)

The last one is pure decoration. The Pimoroni Stellar Unicorn’s 16x16 RGB matrix becomes a ribbed jack-o’-lantern whose eyes, nose and jagged mouth glow from a candle inside. Press A for a lightning strike followed by a scrolling HAPPY HALLOWEEN, B to send a ghost drifting across the face, and LUX + and - to set the brightness.

A jack-o'-lantern face on the Pimoroni Stellar Unicorn's 16x16 LED matrix

The face is a 16 by 16 grid of characters in the sketch, one letter per LED, so changing the expression is a matter of editing text.

Taking them to real hardware

The sketches are written against the same libraries and pins you would use on the bench, so moving from the simulator to a real build is mostly a matter of power and mechanics:

Limits

Open one, change it, and build the version that scares your own doorstep. Happy Halloween.


Share this post on:
David Montero

Written by

David Montero

Creator of Velxio, the open-source circuit and Arduino simulator.

GitHub velxio.dev

Related posts


Previous Post
Analog electronics in the browser: seven circuits you can run and measure
Next Post
Cute Desktop Robot: a face that listens on the ESP-VoCat, with its emulator in your browser