Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Spooky Doll Project

Spooky Doll Project

Adding Sound and Movement

Electronics Block Diagram

The wiring diagram works like this:

  • P22, 23, 24, 25 are pre-wired to the SD card socket

  • P12 to the Head Servo

  • P13 to the Arm Servo

  • P17 to the PIR Sensor

  • P0 and P1 to the eye NeoPixel rings

  • P17 to the Speaker

A Parallax 7.5V 1.5A Power Supply (#750-00009) is plugged into the power jack. The P12 and P12 servo header jumpers are at Vin (7.5V). The P17 servo header jumper is at Vdd (5V). The two NeoPixel were soldered to three wires each for data, power and ground.

 

Creating WAV Audio Files for the SD Card

Parallax has produced tutorials on this subject. Using Audacity, you can record and modify your own sound effects, or import your own music or files. The instructions for creating the correct format are available in our Sound Library reference section.

  • To load the sounds onto the microSD card, you can use SimpleIDE or another IDE with file-uploading capability, or an external SD card reader.

 

BlocklyProp Code

The Spooky Doll Animation has two key features which run in additional Propeller Multicore processors: the NeoPixels in the eyes and the WAV file playback. This is necessary because the eyes fade even red to blue (and back) even if the animation has not been activated by the PIR Sensor. The concept is that curious onlookers will be drawn towards the doll’s eyes before it activates. The WAV files also play concurrently with the eye fading and servo control.

You can download the entire BlocklyProp code below, then use BlocklyProp Solo to load it into your Propeller board.

Project50835-Spooky-Doll-Test.svg

The pseudocode for this project works like this:

  1. Start LED eye fading from red to blue, and back

  2. If motion is detected (human, pets, etc), the PIR Sensor is triggered and the following sequence begins:

    1. “butcher.wav” sound file is activated and plays “Come and get your meat!. . .”

    2. Head servo centers

    3. Arm servo goes up and down

    4. “Yuck.wav” sound file is activated and plays a maniacal laugh “muhahahaha!”

  3. Process repeats if PIR Sensor is triggered again

 

The entire code is shown below, with servo control blocks in the collapsed state.


Printer-friendly version
Doll Preparations
Prev

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress