Introduction & Use Case:

šŸŽƒ This post is all about getting our creative juices flowing with a DIY Halloween project. šŸ•øļø Whether youā€™re looking to craft eerie decorations or design the ultimate costume, weā€™re gonna take it to the next levelā€¦ Letā€™s dive in and make this Halloween the best yet! šŸ‘»




What are we building?:

My daughter picked out a sweet halloween mask and I thought to myselfā€¦ how can we elevate this? Iā€™ve worked on a pair of Raspberry Pi powered ā€˜eyeballsā€™ in the past (great to stick inside a carved out pumpkin) and thought they would be cool in a mask.



The pair of eyes Iā€™ve previously setup were too bulky to fit inside a mask, so I bought a slimmed down Adafruit Monster M4SK (board build in, less bulky) and a cheap Lithium Ion Cylindrical Battery (3.7v, 2200mAh). The results are awesome. Letā€™s dig inā€¦





This post will be broken up into two parts starting with the basic Raspberry pi build, then the final Monster M4SK build.



In this Post We Will:

Part 1:

  • šŸ’¾ Perform a Headless Raspberry Pi Setup (BullseyeOS).
  • šŸ”Œ Connect Hardware & Deploy our Software Eyes.
  • šŸ‘€ Customize Eye shapes, colours, iris, sclera, etc.
  • šŸŽƒ Light up a Pumpkin!


Part 2:

  • šŸ”© Customize our Monster M4SK.
  • šŸ”§ Extend the distance between the eyes.
  • šŸ‘» Spook the neighbourā€™s kids!



Hardware Pre-Requisites

For a bulkier build suitable for inside a carved pumpkin, I used the following:


For the final, slimmer Mask build, I used the following:





Perform a Headless Raspberry Pi Setup (BullseyeOS)


ā›” NOTE: ā€“> The Animated Eyes Bonnet for Raspberry Pi is not compatible with BookwormOS so we have to use the older BullseyeOS.

šŸ’” Developerā€™s Notes:

  • If using a Raspberry Pi 4, Pi 400, or Compute Module 4: the latest ā€œBullseyeā€ Raspberry Pi OS Desktop software is required (ā€œLiteā€ versions, and versions prior to ā€œBullseyeā€ in late 2021, wonā€™t support this code on these boards). For brevity, weā€™ll call all of these boards ā€œPi 4ā€ going forward in this guide.

  • All other Raspberry Pi boards: Raspberry Pi OS Lite (Legacy) software is required. Look for both Lite and Legacy in the name!

  • For all boards: use the 32-bit version of the operating system, not the 64-bit variant.


-1. Grab the OS image from the official Raspberry Pi site (donā€™t extract, leave it as is).


-2. Insert your SD card into the reader and run the Raspberry Pi Imager (available here).



-3. Select your hardware, desired OS, and destination storage (SD Card) as illustrated belowā€¦

šŸ’” IMPORTANT ā€“> Make sure you grab the legacy 32bit Bullseye OS; as this software is not supported as-is on the latest Bookworm OS


-4. Select Next and you will be prompted with the option to edit OS settings. Select Edit and enter your network SSID and PSK, as well as your desired username and password.



-5. Navigate from the General tab over to the SSH tab and make sure itā€™s enabled with password authentication as shown belowā€¦



-6. Click Next and let it burn! šŸ”„

-7. Drop the SD card into your Raspberry Pi board and boot it up.


-8. Locate it on the network (login to your router or use Advanced IP Scanner)


-9. Login and do the needful:

sudo apt-get update && sudo apt-get upgrade





Connect Hardware

šŸ’” Developerā€™s Notes ā€“> The code for this project only works with the Adafruit 128x128 pixel OLED and TFT displays and 240x240 pixel IPS TFT displays.

Any recent Raspberry Pi board with the 40-pin GPIO header should work. The very earliest Pi boards ā€” Model A and B, with the 26-pin GPIO header ā€” are not compatible.

A Raspberry Pi 2 or greater is highly recommended. The code will run on a Pi Zero or other single-core Raspberry Pi boards, but performance lags quite a bit. Pi 4 works now, which was previously incompatible.

Hereā€™s the PIN-OUT:


Itā€™s important to get this right. I know it seems simple, but the connections have to be 1:1


Hereā€™s what not to do:



Hereā€™s how you want it:


Seems obvious, but just recheck before you boot up.





Deploy Snake Eyes

-1. Log into your Raspberry Pi with the IP address we discovered earlier, using the username and password we defined using the Raspberry pi Imager.

-2. Run the following command to get install script:

curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/pi-eyes.sh >pi-eyes.sh






Run the script with:

sudo bash pi-eyes.sh


Run the script installs Adafruit Snake Eyes Bonnet software for your Raspberry Pi and will prompt you for the following (my answers are in ā€˜()ā€™ and correspond with the hardware listed earlier):

  • Select screen type? (#3, Iā€™m using a 240x240 IPS)
  • Install GPIO-halt utility? (N)
  • Install Bonnet ADC support? (N)
  • Install USB Ethernet gadget support? (N)
  • Do you understand and wish to proceed? (y)




Your Pi will reboot and, if the screens are connected correctly, youā€™ll see a pair of eyes looking back at your after about a minute or two.






Customize Eye Shape, Colour, Iris, Sclera, etc.

Thereā€™s a fantastic deep dive into writing custom eyeballs from scratch here on Adafruit.com that I highly recommend checking out. However, weā€™re going to tweak the existing code and leverage what we have for a quick win. The texture maps and graphics for some extra creepy dragon eyes are hidden in your Pi, we just need to copy the default python script and edit it to point to the ā€˜dragonā€™ iris, sclera, and map shown here:



-1. Log into your raspberry pi and cd .. a couple times back to the root and list the contents of boot/Pi_Eyes as illustrated below. Weā€™re looking for the eyes.py file:



-2. Copy this guy over to a new file called dragon.py with the following command:

sudo cp boot/Pi_Eyes/eyes.py boot/Pi_Eyes/dragon.py



Then list the contents again to see it:


Weā€™re going to edit this file in the next step.



-3. Use your favourite text editor (donā€™t judge, nano is just easy šŸ‘») to open up the new dragon.py file we just created.

sudo nano boot/Pi_Eyes/dragon.py



-4. Make the following changes:
ORIGINAL

DRAGON




-5. Lastly, we need to swap out the default .py file used in rc.local for boot up and reboot to see our regular eyes morph into dragon eyes! šŸ‘€

Use the following command to edit the rc.local file as shown below:

sudo nano /etc/rc.local


ORIGINAL RC.LOCAL

NEW RC.LOCAL


-6. Reboot and sit back with the following:

sudo reboot now





Part 2

Customize Monster M4SK

So the dragon eyes we just built were pretty cool, but kinda bulky and heavy to integrate into any decent halloween outfit. Iā€™m going to pop this guy into an empty skull or a carved out pumpkin this year. For my actual costume, I thought we could do better.

Enter the Adafruit Monster M4SK. This thing is awesome. Itā€™s got a small form factor processor in the back thatā€™s powerfull enough to run the eyes on both screens effortlessly without the bulk and weight of a Raspberry Pi.

Youā€™ll need some heat shrink tubing for this. A hair dryer will do if you donā€™t have a heat gun. Electrical tape will do for any you miss.

Hereā€™s a great guide for breaking the eyes apart and connecting them back together with a JST cable on Adafruit.com. The only issue I had was that, even with the 100mm JST cable, the eyes still werenā€™t far apart enough to fit our mask. Time to bust out the soldering iron. I had 2 of these 100mm JST cables handy, so I snipped the ends off of both and soldered them together to make a (almost) 200mm cable, more than enough.




šŸ’”Additional Resources ā€“> Phillip Burgess wrote a killer guide for the same mask here (maybe next year Iā€™ll add the voice modulator)



Extend the Distance Between the Eyes

-1. Plug your Monster M4SK into your computer and you should see the CIRCUIPY drive mounted:



-2. Download additional eyes via zip file here from learn.adafruit.com


-3. Once youā€™ve got the eyes you want and their respective folders uploaded to the Monster M4Sk, all you have to do is copy the config.eye file you want to use, to the root (the odefault eye is ā€œhazelā€ and the original config.eye is in the ā€œhazelā€ folder; if you ever need to go back, just copy the config.eye from the hazel folder to root and reboot).



-4. To swap out your eyes, itā€™s as easy and swapping out the config.eye file from the folder containing the eyes you want.



Spook the neighbourā€™s kids!

I used some styrofoam and a sharpie to insulate and black out the Monster M4SK board around the displays, then taped them to the inside of the mask. My vision isnā€™t obstructed because the primary viewpoint is through the nostrils of this haunted goat thing. Iā€™ve also taped that Lithium Ion Cylindrical Battery (3.7v, 2200mAh) to the inside of one of the horns (I swear this mask was made for this).








šŸ’” FUN FACT ā€“> you can change out the ā€œsplash.bmpā€ loading image with whatever you want and it will display on boot, as long as itā€™s 240x240ā€¦





Ianā€™s Insights:

Itā€™s refreshing to take a break from the norm and dive into something fun, like creating cool projects for Halloween. Iā€™m already thinking about plans for next year, like adding a voice modulator to the mask, or a motion sensor to the Raspberry Pi maybeā€¦ Making time for side projects like this helps keep me sharp when itā€™s time to get back to work. Just remember to gather your supplies early and make time to screw around.





In this Post We:

Part 1:

  • šŸ’¾ Performed a Headless Raspberry Pi Setup (BullseyeOS).
  • šŸ”Œ Connected Hardware & Deploy our Software Eyes.
  • šŸ‘€ Customized Eye shapes, colours, iris, sclera, etc.
  • šŸŽƒ Lit up a Pumpkin!

Part 2:

  • šŸ”© Customized our Monster M4SK.
  • šŸ”§ Extended the distance between the eyes.
  • šŸ‘» Spooked the neighbourā€™s kids!





Thanks for Reading!

I hope this was a much fun reading as it was writing. Happy Halloween!




Helpful Links & Resources:



www.hanley.cloud