Smoking Crystal Skull
Want to create the perfect set for an unforgettable Halloween party? Or add some mystical atmosphere to a kid’s room?
This fun interior decoration project describes how to create a Smoking Crystal Skull: an upsetting cloud of fog coming out of a terrifying translucent skull with breathing illumination.
I wanted to create something unique and special for my son and try to share with him my passion for craft, electronics and code. So now in turn I'm sharing with the community where I took a lot of ideas, in the hope to spark new inspiration.
The fog is created by an ultrasonic mist maker, this is the magical element of the project - I haven't found much mention of such a solution for home decoration. A fan ensures a dynamic air flow, on top of the pulsing illumination, coming from a waterproof strip of LEDs. All of that is enclosed in a translucent skull shaped water dispenser.
The brain that controls the Smoking Crystal Skull is a small ESP8266 processor module, similar to Arduino with Wifi capabilities.
The project requires some level of experience in electronics, programming and basic crafting with carton and cables. The cost is relatively cheap, well under $80, with standard components that can be sourced easily (see below). It took me a couple of evenings to create this Smoking Crystal Skull.
The Smoking Crystal Skull may also be used as a perfume diffuser, but make sure to include some pumpkin fragrances...
Supplies
The overall project remains relatively cheap, using standard components, as listed here:
- 1x Clear Glass Skull Shaped Water Dispenser (link or link) - The Crystal Skull
- 1x carton box to hide the electronics (link) - The Brain Control Box
- 1x ESP8266 generic SoC (link) - The Brain
- 1x Ultrasonic mist maker 24V with 230V plug (link) - The Fog maker
- 1x Small Fan TZL9110 (link) - The Fan for dynamic air flow
- 1x Waterproof LED Strip (link) - The LED strip for illumination
- 1x Small OLED 0.96 display (link) - The Debug console
- 1x DC-DC 24V-5V module (link) - to power the brain from 24V power plug
- 2x Mosfet IRLZ44 transistors (link) - to isolate the power from the command
- 1x pcb or 1x breadboard 400pt (link)
- 3x rocker switches and 1 main on/off switch
- 5x 10kOhm resistors
- misc connectors and 22AWG wires
- soldering iron, hot glue gun and other regular electronics tools (tape, screwdriver, wire strippers, ...)
I included links to AliExpress stores, but depending on your location you may source the components from amazon (not available in my country) or other stores.
Sourcing the Crystal Skull
The firststep is to find the crystal skull. The closest solution to crystal I found is made out of a clear glass skull-shaped water dispenser. I found mine in a local supply store, but similar can be ordered online.
It has one large opening on the top, and a water dispenser hole in the bottom front. Unfortunately the water dispenser hole is too low to either route the cables through it or eject the fog, as the water level needs to be above it for the ultrasonic mist maker to work corectly (it needs to be fully covered by water).
So the Smoking Crystal Skull can be used fully closed (fan off) with dense fog trapped inside or with the top opening partially open so the fog'd overflow from the top (fan on), as per your liking.
Routing the Cables and Assembling the Fan
Then, the next step is about routing the cables and the wires for the best look.
There is a need to easily change the water from time to time, rearrange the LED strip for the best effect, and allow for the fog to flow outside of the Smoking Crystal Skull.
So the simplest solution is to route the fan and ultrasonic mist maker cables through the top cover.
A simple screw driver was used to create two openings in the metallic cover, but any drill made be used. Then simply pass the cables into the 2 holes just created - make enought space to pass the connectors too...
Note that my ultrasonic mist maker cable already included some strain relief that covers the hole, the finish looks polished. Not that chance with the USB fan cable, so I simply made a knot. Sealing is not crutial at this stage, it's more about the cosmetic.
I painted these 2 cables and the fan blades in gray with a simple acrylic spray to hide them with a lower contrast.
I routed the LED strip via the water dispenser tap, as the wires are super small, but you may choose to simply follow the other wires over the top.
Fan assembly
The fan module is fixed under a protective plastic cover to prevent water spill.
This cover is a simple can plastic cover that I drilled manually with a screw driver (again), see image provided. The idea is to have the blades exposed to the fog, but the fan module isolated from the water and humidity. This part is attached just below the metallic cover, hold by the cable, electronic tape and hot glue.
Hot glue was used to complete the sealing.
Crafting the Brain Control Box
Once the glass skull and the wires are setup, time to move to the control box - the brain. I use a very simple square carton box (17x17cm - 6.7"x6.7") to hide the electronics of the Smoking Crystal Skull.
It’s super easy to drill holes with a simple cutter knife as the box is made out of paper craft.
On the front panel, the box features one main on/off switch for the power, and 3 rocker switches to control the fog (ultrasonic mist maker), the fan and the LED strip.
There is an input on one side for the 24V cable, and three outputs on the opposite side for the ultrasonic mist maker, the fan and the LED strip.
An existing micro USB plug is used to attach/detach the fan with a micro USB cable, as I had these components laying around.
The original 24V jack plug supplied with the ultrasonic fog maker is used to power it.
Hot glue has been used to maintain every components in place.
I also designed a pattern to decorate the cover of the box, made out of nylon and cut with a Cricut joy machine (not included as it's copyrighted).
Building the Circuit (HW)
The circuit is built around an ESP8266, cheap and simple to program. The section below describe how the circuitry works, you may skip it if you're familiar with electronics. In this case, simply refer to the full schematics to wire the circuit. I'm also including simple drawings for easy reading but the schematics are the reference.
The main difficulty is to use only one power adaptor: the ESP8266, the fan, the led strip and the OLED screen run on 5V while the ultrasonic mist maker works on 24V. So this 24V supply becomes the unique source of power for the full project.
I tried to use a L7809CV line adaptor, but there is way too much power to dissipate, the circuitry remains active for 10s and then the linear adaptor start to power off, cutting down the full circuit. Switching to a 25V-3V 3A DC-DC LM2596 fully solved the issue. I connected a rocker switch to one of the input pin of the DC to turn on/off the circuit completely.
The fan L9110 is low power, so I connected it directly to a output pin of the ESP8266. The intensity of the fan may be controlled to limit its noise to the minimum.
The LED strip are controlled thru a Mosfet transistor (IRLZ44), getting the 5V power out of the DC-DC. There is a low frequency pulsing scheme generated by the SW via a PWM pin to add drama to the Smoking Crystal Skull.
Indeed the ultrasonic mist maker works on 24V, so it's also controlled by a Mosfet transistor (IRLZ44) to isolate the power (24V) from the command (5V).
The OLED screen is used for debugging purposes, to understand live the status of all the elements. It's connected on SLA/SDA. It's not needed to control the Smoking Crystal Skull, and can easily be removed.
I connected the 3x rocker switches to ESP8266 inputs (with 10kOhm pull down resistors), so the number of GPIO becomes limited, knowing that D3/D4 can't be used.
SSD2 and SSD3 do not support PWM, so they can't control the fan or LED strip. But they support interrupts, so they work perfectly fine for buttons. Regarding D8, the boot fails if pulled HIGH, but works fine for buttons with interrupt.
D0 / GPIO16 -> NC D1 / GPIO 5 -> OLED SLK D2 / GPIO 4 -> OLED SDA D3 / GPIO0 -> NC D4 / GPIO2 -> NC D5 / GPIO14 -> FOG_PIN D6 / GPIO12 -> FAN_INA D7 / GPIO13 -> LED_STRIP D8 / GPIO15 -> SWITCH_BUTTON_2 -> fog RX / GPIO 3 -> NC TX / GPIO1 -> NC SD1 / MOSI -> NC SD2 / GPIO10 -> SWITCH_BUTTON_1 -> display SD3 / GPIO9 -> SWITCH_BUTTON_3 -> fan
I started using a breadboard with Dupont wires, but encountered some instabilities. So I moved to a simple 4cm x 6cm (1.5"x2.36") PCB board with soldered wires and recycled connectors that were lying around (see pictures).
Animating the Crystal Skull (SW)
The section below explains how the code works. Again you may skip this step and simply download the code included and update it to your own needs if your familiar with ESP8266 progamming.
The code controls the Smoking Crystal Skull, including the ultrasonic mist maker, the fan and the pulsing LED strip. Each elements may be controlled either from the physical switches on the brain control box (on/off) or from the internal web server (percentage of the intensity).
Several other outputs have been integrated for debugging purposes, entirely optional:
- OLED screen, hidden in the brain box, for run time debugging.
- ESP8266 serial port, to debug on the host during the development.
- internal EEPROM to save settings upon restart.
The main loop handles these interfaces every second. The frequency may be increased for a better reactivity if needed.
The brain box rocker switches are handled under interruption.
I used the Arduino IDE to program the ESP8266. In case this is new for you please follow this tutorial on how to add support for ESP8266 in Arduino.
The code is included, with plenty of comments. Simply update the code with the #TOBEUPDATED comment to set it up to your needs.
GPIO / Pinout
#define SWITCH_BUTTON_1 9 // SSD2 - no PWM output but interrupt on input #define SWITCH_BUTTON_2 15 // D8 - Boot fails if pulled HIGH #define SWITCH_BUTTON_3 10 // SSD3 - no PWM but interrupt #define FAN_INB 12 // D6 - FAN_INA is set to LOW directly without a pin, as we don't go in reverse - SSD2 doesn't include a PWM #define LED_STRIP 13 // D7 #define FOG_PIN 14 // D5
WebServer
The web server is the main interface used to access the device remotely, from a phone or a PC on the same network. This web server is used by HomeBridge to control the Crystal Skull from Apple Home app, described in the next steps.
It's accessible on 192.168.x.x pending your router settings. The Wifi configuration is defined in the setup() routine.
An aRest API has been implemented in the web server to simplify the programing interface, with a JSON syntax similar to:
{"variables": { "ledStatus": 80, "fanStatus": 25, "fogStatus": 100, "OLEDStatus": 1, "runTime": 288 }, "id": "6", "name": "CrystalSkull IoT", "hardware": "esp8266", "connected": true }
List of the actions to control the different parameters on the web server:
ledOn(String command); // turn led strip on with specified intensity (in %) ledOff(); // turn led strip off fanOn(String command); // turn fan on with specified intensity (in %) fanOff(); // turn fan off fogOn(String command); // turn the ultrasonic mist maker with specified intensity (in %) fogOff(); // turn fog off dumpEEPROM(); // display the content of EEPROM to the serial port (debug) homebridgeStatus(); // answer to the homebridge status query homebridgeOn(); // turn on all peripherals (fan, fog, led) homebridgeOff(); // turn off all peripherals (fan, fog, led)
Syntax: http://192.168.XX.XX/fanOn?param=75 The parameter is a percentage (0-100%), not the not the actual value (0-MAX_OUTPUT).
If no parameter is provided, the previously active version is used from EEPROM.
To note, I discover that some versions of ESP8266 use a scale of 0-255 (V3 Nodemcu-CH340 ~31x57mm), while some others to 0-1023 (V2 Nodemcu-CP2102 ~25x48mm), see attached picture.
OLED screen
Some of the key variables (IP, fan, fog) are displayed on the small OLED screen at run time.
Interrupts
The goal is to spend as little time as possible under interruption mode, so the buttons are only triggering a flag, which is in turn handled during the main loop, not under interrupt. The buttons I used have some level of rebound, so the code includes some de-bouncing mechanisms.
Internal EEPROM
The key data are stored in EEPROM so saved upon restart, or if a parameter is turned on without any value.
MAP
#define EE_LED 1 // EEPROM MAP -> LED Status #define EE_FAN 2 // EEPROM MAP -> Fan status #define EE_FOG 3 // EEPROM MAP -> Fog status #define EE_PLED 4 // EEPROM MAP -> previous LED Status #define EE_PFAN 5 // EEPROM MAP -> previous Fan status #define EE_PFOG 6 // EEPROM MAP -> previous Fog status
EEPROM is committed only once per main loop if there are any changes to the values, to preventing too much writing to the EEPROM.
Breathing LEDs
The LED strip pulses on a low frequency, simulating the feeling of a breath... I went for a very simple ramp from 100% to 50% and back (see the pictures), with 25ms steps.
It may be changed to any other pattern you may like, such as a sinusoid, but I found this one pretty simple, effective and inline with the mood of the Smoking Crystal Skull.
Robustness
The device restarts itself every day for stability purposes.
Parameters
The magical element of the project is the ultrasonic mist maker, I go full on with 100% to generate that beautiful smoking effect.
At 100% the fan is super loud, so I set the intensity around 25%, which allows for enough air flow with a more decent noise level when the top opening is open. Below this value the fan doesn't start.
I usually keep the LEDs at 80%, to create a mid dimmed breathing pulsing atmosphere.
Communicating With Telepathy (optional HomeKit Support)
The next step is to integrate the Smoking Crystal Skull into HomeKit, so we can use the Home app to automate the project from an iPhone. This is fully optional.
The simplest way I found is to use HomeBridge, an open source platform that acts as a bridge layer between Apple HomeKit and non certified Smart Home Devices.
Here are several tutorials that detail the installation of HomeBridge if you don't have one setup yet:
- https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian
- https://www.iottrends.tech/blog/a-complete-guide-to-homebridge/
- https://www.the-ambient.com/guides/homebridge-setup-homekit-ultimate-guide-1915
Once the HomeBridge server is up and running (in my case on on a Raspberry Pi), the next step is to install the plugin that will control the Smoking Crystal Skull. It's relatively simple, as the webserver is implemented in the Brain, so it's simply a question of sending the correct http request. Let's use homebridge-http-lightbulb plugin which is well used, maintained and documented. It may be installed directly from the HomeBridge user interface, in the plugin tab, or use command line on the HomeBridge server:
sudo npm install -g homebridge-http-lightbulb
Here is the config file config.js on the HomeBridge server:
{ "bridge": { "name": "Homebridge RPI", "username": "XX", "port": XX, "pin": "XX" }, "accessories": [ { "accessory": "HTTP-LIGHTBULB", "name": "Smoking Crystal Skull", "onUrl": "http://192.168.x.x/homebridgeOn", "offUrl": "http://192.168.x.x/homebridgeOff", "statusUrl": "http://192.168.x.x/homebridgeStatus", "brightness": { "setUrl": "http://192.168.x.x/ledOn?param=%s", "statusUrl": "http://192.168.x.x/ledStatus", "statusPattern": "\"ledStatus\": ([0-9]+)" } }
This version turns the Smoking Crystal Skull On or Off from the Home app, it uses the previously saved intensity to control the peripherals (fan, fog, leds).
The "brightness" parameters controls the intensity of the LEDs, but can be easily updated to control the fan:
"brightness": { "setUrl": "http://192.168.x.x/fanOn?param=%s", "statusUrl": "http://192.168.x.x/fanStatus", "statusPattern": "\"fanStatus\": ([0-9]+)" }
I'd be interested to fork the plugin to control the intensity of all elements individually, and use a fan or skull icon instead of a light, but it goes way beyond the deadline of this project.
With this integration, I make sure that the Smoking Glass Skull doesn't stay on for the full night, but turns off at 8:30pm each evening!
Embarking on a Rewarding Journey
Our Smoking Crystal Skull has been working for a few weeks so far without any major issue. My kids are still super excited about it and keep enjoying playing with it a lot.
The ultrasonic mist maker can serve as a perfume diffuser. So to add the smell on top of the other senses, we dropped some DIY lily fragrance from the kids toys in the water... but it was not inline with the Halloween mood of the Smoking Crystal Skull... But don't forget to change the water from time to time, as the fog maker amplifies odors.
It has been a great fun creating this project, building and documenting it. I got inspired by several other instructables and delighted to share back to the community. Don't hesitate to comment and provide feedback in the section below !