Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 4.51 KB

README.md

File metadata and controls

75 lines (54 loc) · 4.51 KB

Light Triggered Laughing Skull

Laughing Skull

Create a fun prank for Halloween or any time of the year. Hide the project somewhere dark and wait. When someone opens a door or shines a light on the project, it wakes up displaying an animated laughing skull and playing evil laughter. This continues until it gets dark again (or they find and unplug the battery!)

Installation

This project required CircuitPython 6.x. The beta version of this release can be found from the CircuitPython website. Instructions for installing new releases of CircuitPython can be found there.

Copy the appropriate code-xxxxxx.py onto your CircuitPython device and rename it to code.py.

Copy the skull_ bmp files and the laugh.mp3 file to your device.

Depending on your device you may require libraries to be installed in your lib directory.

  • adafruit_imageload (All)
  • adafruit_apds9960 (Clue)
  • adafruit_gizmo (Circuit Playground Bluefruit)
  • adafruit_st7789 (For ST7789 breakout TFT)

NEW Use a distance sensor to detect someone close and start laughing. The code-distance.py file is set to trigger from a UC-100 based sensors available here https://www.adafruit.com/product/4019. Print out the 3d tombstone and embed everything in a single item.

Recommended Hardware

This project is written in CircuitPython and has been tested on several Adafruit boards and is easily adaptable to run on other hardware. It runs best on a M4 processor but can run acceptably on an nRF52840. The code has switches to turn off audio or animation, and to change the animation speed slower. All of which may help on a slower processor. The images are scaled for a 240x240 display but could be resized. The audio is mono and should play through any mono speaker.

Of the boards I have tested it on the project works best on the Hallowing M4. This amazing board has everything you need already built into it. The screen, light sensor and audio are all already there so nothing besides a small speaker is required.

A small battery is perfect to place this project somewhere dark and wait for an unsuspecting person to open the door.

Tested Adafruit Hardware:

All the projects had a small 4-8ohm speaker attached for audio out.

The project requires the following components:

  • Processor board to run the project (M4 recommended)
  • 240x240 Display
  • Audio out
  • Light sensor
  • Distance sensor (optional)

It is fairly easy to swap out components if you have another you would like to use. All initializations are at the top of the code.

Configuration

The configuration is all near the top of the python file. These are the most likely values you will want to change.

USE_LIGHT_SENSOR = False # if you want to disable the light sensor
USE_DISTANCE_SENSOR = True # if you want to disable the distance sesnor
USE_NEOPIXELS = True # if you want to use the onboard neopixels

LIGHT_VALUE = 1500      # value at which we turn on / off the laughing
DISTANCE_VALUE = 50      # value at which we turn on / off the laughing
MODE_SWITCH_TIME = 0.2  # how long to wait for a changed reading
                        # to be consistent to change modes
LAUGHING_SPEED = 0.1   # how fast the animation runs

USE_AUDIO = True        # if you want to disable audio
USE_ANIMATION = True   # if you want to disable animation

Ideas

This project could be expanded upon to change how it reacts in even more ways.

  • Boards like the Hallowing have a built in motion sensor that could be used (if you shake it maybe it says to put it down!)
  • A microphone sensor could allow the project to react to sound instead of light
  • New sounds and animations can be added following the base code that is provided

Credits for Audio

The audio was a mix of several tracks from: