Haunted Watering Can
This fun interior decoration project describes how to create a Haunted Watering Can: a watering can filled with overflowing mist, running water and breathing illumination.
This is an evolution of my previously crafted Smoking Crystal Skull project. It's using similar components and skills (electronics, programming and basic crafting with carton). The cost is cheap, well under $50, and pretty easy to build - I took me a couple of evenings to create this Haunted Watering Can.
The internal mist is created by an ultrasonic mist maker. A small submersible pump makes the water circulate with a nice sound on top of the pulsing illumination coming from a waterproof led strip. The Haunted Watering Can is controlled by ESP8266 processor module. All of that is enclosed in a translucent watering can.
The Haunted Watering Can may also be used as a perfume diffuser, but make sure to include some pumpkin fragrances...
Supplies
The overall project uses pretty standard components, as listed here:
- 1x ESP8266 generic SoC (link)
- 1x Ultrasonic mist maker 24V with 230V plug (link)
- 1x Submersible Water Pump 5V (link)
- 1x Waterproof LED Strip (link)
- 1x Small OLED 0.96 display for debugging purpose (link) - Optional
- 1x DC-DC 24V-5V module (link) to generate 5V from the 24V power input
- 3x Mosfet IRLZ44 transistors (link) to control the pump, ultrasonic mist maker and the leds
- 1x breadboard 400pt (link)
- 3x rocker switches and 1 main on/off switch
- 3x 10kOhm resistors
- misc connectors and 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.
On top of the electronics you will also need:
- a translucent watering can with some fake plants and stones for decoration.
- a carton box to hide the circuit & electronics.
Building the Circuit (HW)
Let's start with the circuit ! It's 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 easier reading.
We want to use one unique power supply for the circuit. However the ultrasonic mist maker works on 24V, while the ESP8266, the pump, the led strip and the OLED screen run on 5V. So we need to include a 25V-3V 3A DC-DC LM2596 to create the 5V voltage.
I connected a rocker switch to one of the input pin of the DC to turn on/off the circuit completely.
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 Haunted Watering Can. Similar for the water pump, it's controlled by a second Mosfet transistor (IRLZ44), as it may draws too much power from the ESP8266 pin.
Indeed the ultrasonic mist maker works on 24V, so it's controlled by a third 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 Haunted Watering Can, and can easily be removed.
The 3 peripherals (LED strip, pump, ultrasonic mist maker) are connected with 3x switches in series for a direct control.
The circuit has been built with a breadboard and Dupont wires.
Developping the Code (SW)
Now that we have the circuit built, let's focus on the code.
It controls the Haunted Watering Can including the ultrasonic mist maker, the pump and the pulsing LED strip.
They may be controlled from the internal web server.
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.
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.
The following section describes some key topics of the code, simply skip it if you're familiar with coding.
Web server
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 Haunted Watering Can 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 programming interface, with a JSON syntax similar to:
{"variables": { "ledStatus": 80, "fogStatus": 100, "pumpStatus": 100, "OLEDStatus": 1, "runTime": 187 }, "id": "1", "name": "Haunted Watering Can", "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 pumpOn(String command); // turn pump on with specified intensity (in %) pumpOff(); // turn pump 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 (pump, fog, led) homebridgeOff(); // turn off all peripherals (pump, 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, fog, pump) are displayed on the small OLED screen at run time.
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_PUMP 2 // EEPROM MAP -> Pump status #define EE_FOG 3 // EEPROM MAP -> Fog status #define EE_PLED 4 // EEPROM MAP -> previous LED Status #define EE_PPUMP 5 // EEPROM MAP -> previous Pump 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 Haunted Watering Can.
Robustness
The device restarts itself every day for stability purposes.
Downloads
Crafting the Box and Wires
After the circuit and the code, it's time to integrate them in a nice box.
The Brain Box
I'm using a 17x17cm carton box because they are available in my local supply store next door, but any carton box will work. There are super easy to cut with a knife or a cutter, it's really basic crafting.
One one side, let's drill a circular hole for the input power, and a cut a square hole for the main on/on switch.
On the front side, let's align 3 holes for the on/off switches that controls the pump, the leds and the ultrasonic mist maker. As you can see in the pictures, the respectives wires are routed just below, so it's easy to remember which switch controls what.
I cut a vinyl for the top side to make it look more Halloween themed, but that's indeed fully optional.
The Watering Can
Next, let's drop the pump and the ultrasonic humidifier into the translucent watering can. They need to be fully covered by water to operate correctly.
Let's add some fake plants and some small stones for a nicer touch, and to hide a bit the wires.
And that's it!!!
Connecting the Haunted Watering Can to HomeKit
The next optional step is to integrate the Haunted Watering Can into HomeKit, so we can use the Home app to automate the project from an iPhone.
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.
Let's use homebridge-http-lightbulb plugin which is well used, maintained and documented. It may be installed directly from the HomeBridge user interface.
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": "Haunted Watering Can", "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 Haunted Watering Can On or Off from the Home app, and control the intensity of the LEDs.
Celebrating
Remember to change the water from time to time, as the ultrasonic humidifier amplifies odours...
Et voilĂ !
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 !