Overview

When it comes to decoration for Halloween, or setting up an elaborate, Scooby Doo-esque plot to scare a bunch of meddling kids, it's hard to beat a creepy skull that looks at you out of one eye whenever it detects movement!

You can build this with the HalloWing and its TFT display, a lens, and a PIR sensor to determine when people are approaching, and then open up it's one good eye!

Components

Here are the components you'll need:

1 x Adafruit HalloWing M0 Express
Skull-shaped ATSAMD21 board w 1.44" 128x128 TFT display
1 x Convex Glass Lens
with Edge - 40mm Diameter
1 x Clear Acrylic Lens Holder + Hardware Kit for HalloWing
The perfect kit for mounting a convex lens (glass or plastic) to your HalloWing! This holder has been laser-cut specifically for lenses with a lip-edge
1 x PIR (motion) sensor
Passive Infrared detector
1 x 5V 2.5A Switching power supply
with 20AWG MicroUSB Cable

Optional

The PIR sensor works best with 5V power, so battery usage will be better for a non-PIR reactive build. If you must use battery power and PIR you may want to add a PowerBoost converter for 5V power.

Parts & Tools

In addition to the parts listed above, you'll also need:

  • Hollow plastic decorative skull
  • Box cutter, hobby knife, or thin-bladed saw
  • Hot glue and hot melt glue gun, or double stick foam tape
  • Black felt or construction paper
  • Scissors

Build the All-Seeing Skull

We'll need to cut into our skull to access the hollow insides, where we'll be placing the HalloWing, battery, PIR sensor, and the wiring.

Cutting away the eye sockets will allow the eyeball and PIR sensor to "see" what's happening.

Want to print your own skull? Here's a 3D model by Thingiverse user ccombs that he built to fit the HalloWing! https://www.thingiverse.com/thing:3153240

Cut Open the Skull

You may want to remove the jaw first if your skull has one, just to make it easier to handle.

 

Next, carefully use a hobby knife to cut open the back of the skull as shown.

There are many ways to secure the lens. A laser cut holder is very precise, but you can also use zip ties as shown below! Or, try a 3D printed version https://www.thingiverse.com/thing:3152874

Attach the Lens -- Frame Method

 

Use four nylon M2.5 standoffs and eight screws to connect the lens to the HalloWing as shown, using an acrylic laser cut holder. You can use this file to laser cut your own from 2mm thick acrylic.

 

The lens will magnify the animation on the TFT as well as give the eye dimension when viewed at oblique angles.

Zip Tie Method

Feed thin zip ties through the holes at the bottom of the board, and then over the lens edges and back through the holes at the top.

 

Secure each end on the back side with a second zip tie like a fastener.

 

Trim the excess.

Cut Open the Eye Socket

 

Use a hobby knife to cut out the back of the skull's eye socket. Try to cut the hole about the same diameter as the lens.

 

You can touch up the spots where the lack of paint reveals white plastic with a marker.

Do a test fit to see that the lens will clear the hole, you can adjust if needed. It's OK if there is extra gap space, we'll hide it later with some felt or cardstock.

proximity_IMG_4704_2k.jpg

proximity_IMG_4713_2k.jpg

Second Socket

Repeat the process for the second socket which will hold the PIR sensor. Yes, it will look like a terrible, milky white dead eye.

Again, test fit the PIR sensor in the socket and adjust if needed. Don't worry about extra gap space around the sensor, will take care of this later with some felt (or cardstock).

PIR Sensor Prep

 

The PIR sensor has three connections for power and data. Plug them into the JST cable like this:

 

  • Red to +5V
  • White to Data
  • Black to Ground

Later, you can adjust the sensitivity of the PIR sensor (by turning the trimpot labeled "sensitivity adjust" in the image above) up to about 20' (6 meters) to tune it to the location you deploy the All-Seeing Skull.

To learn more about PIR sensors, take a look at our guide here!

Plug the PIR sensor into the SENSE port on the HalloWing. If you're using a battery you can plug that in as well.

Custom Fit with Felt

Depending on the size and shape of the skull and socket, you may want to customize the fit a bit more. You can use some black felt or construction paper to mask some of the socket space.

Cut a small piece of black felt or cardstock to a rectangle a bit longer than the HalloWing, and roughly 3/4 of its width. This will be used to mask off the gap to one side of the socket, keeping the lens pressed against the inner socket ridge.

 

Mark and cut a half circle from the center of the felt, as shown, then fit the lens into it.

 

Mark and cut two small holes positioned over the screws and then affix the felt to the board using the screws.

Insert Eye

 

Now you can insert and secure the eye lens and HalloWing in place inside the skull.

 

Now the felt nicely blocks the gap!

 

You can use a couple of dabs of hot glue on the felt and at the base of the HalloWing to secure them in place inside the skull.

 

Insert PIR Sensor

 

You can use the same method with some felt for the PIR sensor, as shown here.

The skull assembly is complete, next we'll program the HalloWing.

Code in Arduino

The eyeball code we'll use is from the Electronic Animated Eyes project, a.k.a., 'Uncanny Eyes', with a couple of small tweaks.

First, get set up with Arduino IDE as detailed here.

Next, follow these instructions on getting the proper libraries installed for the Adafruit_GFX and Adafruit_ST7735. Note, we aren't using the Teensy, so don't pick that board from the list. While you're in the Arduino Library Manager (Sketch→Include Library→Manage Libraries…): also install Adafruit_ZeroDMA.

Once you've updated the board definitions as shown, you'll be able to select Adafruit HalloWing M0 Express as your board for compiling and uploading.

Before you continue, make sure you can plug in your HalloWing over USB and upload the Blink sketch found in Arduino IDE menu Examples > 01.Basics > Blink

If everything is set up properly, the HalloWing should now be blinking the onboard LED every second.

All-Seeing Skull Sketch

The code used on the HalloWing for the All-Seeing Skull along with the graphics is in the Adafruit GitHub repository.

Inside that folder, find the All_Seeing_Skull folder and move them into your Arduino sketch directory. 

Inside of Arduino IDE, open up the All_Seeing_Skull.ino sketch.

Upload the sketch to your HalloWing and you will see the eye open and look around! After a few seconds, if the PIR sensor doesn't detect movement, the eye will close. If you (or any largish, warmblooded creature) move a slight amount, the sensor will trigger again.

Also note, the pupil will dilate or contract depending on how much light it detects. The sensor for this is on the HalloWing, but will still react, even inside the skull, to changes in ambient light. Especially effective if someone shines a flashlight on the All-Seeing Skull!

Configuration

A few small changes have been made to the code based on the original Uncanny Eyes project to accommodate the HalloWing and lens being inside the skull's eye socket.

The full range of motion for the original eye was a bit large and would cause the eye to look inside the socket and disappear from view a bit (this may be the effect you want!) so, in the config.h file that accompanies the Arduino sketch, we made these additions:

Download: file
//Adjust these offsets and ranges if inside a mask or skull eye socket
#define eyeXOffset      -150 // aim offset on x for autonomous move, default 0
#define eyeYOffset      300  // aim offset on y, default 0
#define eyeXRange       300  // Range of motion on x, full range is 1023
#define eyeYRange       300  // Range of motion on y, full range is 1023

Here, you can tune the left-right (x axis) with eyeXRange and up-down (y axis) range with eyeYRange. The defaults are 1024, I have restricted them to a smaller 300, but feel free to play around with these values and re-upload the code to your HalloWing to test.

Additionally, the point of interest for the eye's "center" of focus can be offset with eyeXOffset and eyeYOffset. You can use this to hint the eye gaze center point up or down if the skull is mounted low or high, and toward a cross-eyed or wall-eyed position depending on skull orientation. The defaults are 0 for both.

Customization

You can refer to this page if you want to pick one of the other pre-made looks for the eye. If you want to create your own graphics, this is the page you're looking for.

Deploy the Skull

You can leave the skull as is, plug the USB power cable in and hang it on your front door for a creepy night of fun with your trick-or-treaters!

Or, tape the back of the skull into place and set your All-Seeing Skull on your bookshelf to keep watch over guests and pets...

This guide was first published on Sep 07, 2018. It was last updated on Sep 07, 2018.