Skip to content
Buy 10+ on select items — save 10% auto-applied
Free US shipping on orders $35+
Order by 3pm ET — ships same-day from the US
Skip to main content

Arduino Nano PIR Sensor: Animated Skull Control | ShillehTek

May 27, 2026 8 views

Arduino Nano PIR Sensor: Animated Skull Control | ShillehTek
Project

Build an Arduino Nano HC-SR501 PIR animated skull with servo jaw, LED eyes, and buzzer for a hands-free Halloween prop using ShillehTek parts.

2 hr Beginner / Intermediate5 parts

Project Overview

Arduino Nano + HC-SR501 PIR animated skull: An Arduino Nano reads an HC-SR501 PIR motion sensor to trigger a servo-driven jaw, red LED eyes, and a KY-006 buzzer for an automatic Halloween scare.

The PIR senses someone approaching the front door. A servo cranks the jaw open and shut. Red LEDs light up the eye sockets, and a buzzer plays an eerie tone.

  • Time: ~2 hours
  • Skill level: Beginner / Intermediate
  • What you will build: A motion-triggered animated skull with moving jaw, glowing eyes, and audio.
Arduino Nano animated Halloween skull with PIR motion sensor, servo jaw, LED eyes, and buzzer
PIR + servo + LEDs + buzzer + Arduino Nano for an automatic scare prop.

Parts List

From ShillehTek

External

  • Plastic skull (Halloween store, or 3D-printed)
  • 2 red LEDs (eye sockets)
  • 2× 220Ω resistors
  • 9V battery or USB power bank

Note: The Arduino Nano, HC-SR501 PIR, and MG90S servo are typically used on 5V logic and power. Make sure all grounds are common between the sensor, servo, LEDs, buzzer, and Arduino.

Step-by-Step Guide

Step 1 - Modify the Skull

Goal: Create a jaw that can be moved by the servo.

What to do: Cut the lower jaw free, hinge it back on, and attach a string (or linkage) from the jaw to the servo arm so the servo can pull the jaw open and let it return.

Plastic Halloween skull modified with a hinged jaw and servo string linkage for Arduino Nano animatronics
Cut the lower jaw free, hinge it back on, and attach a string to the servo arm.

Expected result: The jaw can open and close smoothly when pulled by the linkage.

Step 2 - Add the LED Eyes

Goal: Install red LED eyes that the Arduino can control.

What to do: Glue two red LEDs behind the eye sockets. Wire each LED in series with a 220Ω resistor so the Arduino pins can drive them safely.

Two red LEDs installed behind skull eye sockets and wired with resistors for Arduino Nano control
Two red LEDs glued behind the eye sockets, wired to GPIO through 220Ω resistors.

Expected result: The LEDs sit securely behind the eyes and are ready to connect to the Arduino.

Step 3 - Wire the Whole Thing

Goal: Connect the PIR sensor, servo, LEDs, and buzzer to the Arduino Nano.

What to do: Wire the modules and parts to these pins: PIR to D2 (trigger), servo to D9, LEDs to D5 and D6 (PWM for flicker), and buzzer to D8. Make sure all components share a common ground.

Wiring diagram showing Arduino Nano connected to HC-SR501 PIR on D2, MG90S servo on D9, LED eyes on D5 and D6, and KY-006 buzzer on D8
PIR to D2 (trigger). Servo to D9. LEDs to D5 and D6 (PWM). Buzzer to D8.

Expected result: All modules are connected to the correct pins and powered, with a shared ground.

Step 4 - Upload the Arduino Sketch

Goal: Program the Arduino Nano to trigger the jaw, lights, and sound when motion is detected.

What to do: Paste the sketch below into the Arduino IDE and upload it to your Arduino Nano.

Code:

#include <Servo.h>
const int PIR = 2, BUZZ = 8;
const int LED_L = 5, LED_R = 6;
Servo jaw;
void setup() {
  pinMode(PIR, INPUT);
  pinMode(BUZZ, OUTPUT);
  pinMode(LED_L, OUTPUT); pinMode(LED_R, OUTPUT);
  jaw.attach(9); jaw.write(0);
}
void scare() {
  for (int i = 0; i < 8; i++) {
    jaw.write(40); analogWrite(LED_L, 255); analogWrite(LED_R, 255);
    tone(BUZZ, 300 + random(200));
    delay(100);
    jaw.write(0);  analogWrite(LED_L, 60); analogWrite(LED_R, 60);
    delay(80);
  }
  noTone(BUZZ);
}
void loop() {
  if (digitalRead(PIR) == HIGH) {
    scare();
    delay(5000);   // 5s cooldown
  }
}

Expected result: When the PIR output goes HIGH, the jaw moves, the LEDs brighten and dim, and the buzzer plays tones, then the system waits 5 seconds before triggering again.

Step 5 - Place It

Goal: Position the skull so it detects approaching visitors reliably.

What to do: Mount the skull near the front door at face height, with the PIR sensor pointing toward the walkway.

Animated Halloween skull placed near a front door with PIR sensor aimed at walkway to trigger servo jaw and LED eyes
Mount near the front door at face height. Aim the PIR at the walkway.

Expected result: The skull triggers when someone approaches and resets after each activation.

Step 6 - Where to Take It Next

Goal: Plan optional enhancements after the base build works.

What to do: If you want to expand the project, consider these ideas:

  • Audio sample playback (DFPlayer + amplified speaker) for real cackling laughter
  • Multiple skulls in a row - different scares at different distances
  • Wi-Fi alerts to your phone every time something triggers it
  • Eye tracking - servo-mounted eyes that follow the approaching visitor

Expected result: You have a clear list of next upgrades once your motion-triggered skull is working.

Conclusion

You built an Arduino Nano Halloween skull that uses an HC-SR501 PIR motion sensor to trigger a servo jaw, LED eyes, and a KY-006 buzzer. Once placed by your entryway, it reacts automatically when someone walks up.

Want the exact parts used in this build? Grab them from ShillehTek.com. If you want help customizing this project or building something for your product, check out our IoT consulting services.

Credit: Project reference adapted from Instructables.