Enchanted Rose 2.0 with Falling Petals

Revisiting the Enchanted Rose project four years later, this time with an open-source build based on Raspberry Pi.

Four years ago, my daughter was in a school production of Beauty and the Beast, and I volunteered to build a stage prop “Enchanted Rose,” which could drop these petals on cue. The initial project was fun, and the play was a total success. They did about ten productions in the spring of 2019.

I documented the build in a two-part blog series.

Those articles and their accompanying YouTube video made their way around the search engines. And in the years since, I’ve gotten emails from more than a dozen stage managers around the world (Colorado, Texas, California, London, NY, Florida, Hawaii, Scotland and more.) Stage crews, parents and students are looking to build the working prop.

Some even inquire about rental. Well, rental of the version 1.0 prop is out of the question. Not only was the original design based on servo motors and springs and fishing line, far too delicate to ship, the version 1.0 isn’t even in my possession anymore. I gifted it to the director. She’s also the school’s computer teacher, and she really wanted the prop.

As people trying to re-make it have let me know, the original instructions are now fairly out of date in at least two major ways. First, the Bluetooth board that the prop relied upon has since been discontinued. And second, the controller was a native iOS app written in Swift 3.0. Apple has updated the Swift language app so much that the old native app no longer compiles. Though I could get the app working again, Apple has made it fairly difficult to distribute apps ad-hoc, and I have no interest in publishing the app in the App Store as it is far too specialized.

But with every new inquiry from a hopeful production manager, I’ve felt it would be a nice thing to do to rebuild the prop, to better explain how to build one.

And so, here it is. Enchanted Rose 2.0 is a web-based one with a Raspberry Pi and an open-source approach. The basic mechanics are now working:

Enchanted Rose 2.0

Features

  • Control via private wifi network and mobile web browser, not native app
  • Total cost no more than $200
  • Durable enough to ship
  • Do NOT require that it connect to a local internet
  • Easy to use interface that an elementary school stage crew could use
  • Easy on-site setup. Ideally, just turn it on and it works.
  • Battery operated — most productions like to keep the illusion (and stage safety) by eschewing cords.

The main functions of the prop are to remotely:

  • Turn stem light on and off
  • Turn accent light on and off, and set colors and pattern
  • Drop 4 rose petals, one by one, on cue

Basic Approach

Lighting: The lighting circuitry is the same as in v1.0 design. That is, for the “stem lights”, a Raspberry Pi uses its GPIO port to send a signal to a resistor’s “base,” to allow a 4.5V circuit to complete.

For the Accent Lights, there are Neopixels; I found the 60-LED strand to be the right size. There’s a very good article on Adafruit telling you how to use a Raspberry Pi and Circuit Python to power Neopixels. Just as they recommend, I used a level converter chip (the 74AHCT125) to convert the Pi’s 3.3V output up to 5V without limiting the power drawn by the NeoPixels.

Both of the lights are powered by 4.5V, delivered by 3 AA batteries in a battery pack.

Drop Mechanism: For the drop mechanism, I made major changes from v1.0 to v2.0. Version 1.0’s use of magnet-spring-fishing-line servo-motor works for local productions just fine, and has some advantages (reliability once calibrated.) But it is far too delicate to ship. I experimented with electric solenoids pulling on magnets, but the smallest ones were too weak, and would require an enormous “bulb” to house.

I hit upon the idea of using pneumatic pressure! That is, pumps create puffs of air in tubes, which jettison the petal.

Software: Control of the prop is via a Python-based API, which has a front-end control app (link to repo below.) That is, the prop itself hosts a web server on the Raspberry Pi, and presents its own private “ad-hoc” network. The stage manager connects the prop’s ad-hoc network, and accesses the controller software. This general pattern can be used to build “remote control” devices.

There are three main components to this stage prop:

  1. The front-end control software, written in React/Next.js. You’ll find that code in the enchantedrose repository. From a technical standpoint, all this repo does is present a nice front-end layer onto the API.
  2. This hardware API, in this repo: Enchanted Rose Python API. This repo is the essential python-based API software. This controls the GPIO pins on the Raspberry Pi and presents an API on port 5000 to the world. The role of this software library is to provide an API for turning on/off lights, dropping petals, etc.
  3. The prop hardware itself.

Software

The two key pieces of software, other than the Raspbian Operating System itself, can be found here:

You’ll also need to install the NeoPixel driver libraries, which are well documented over at the Adafruit website.

Hardware

Each pump motor needs a circuit like the below. Since RPi cannot output 9V, we’ll make use of a transistor to switch a supplied 9V current on and off. (Note that in production, I ended up boosting the power supply to 8 AA batteries, or 12V. The motors can handle this higher voltage for short duration, even though they’re rated for 6-9V.)

Since these motors generate current spikes when they are powering down and powering up, it’s very important to protect your RPi with a diode, as follows (the directionality matters! pay attention to the line on the diode and the positive lead from the motor):

Wiring diagram for pump motors

There are four such circuits, with the power source and RPi being shared between them.

Accent Lights

The circuit and software to control Neopixels is well documented at Adafruit’s website.

Configuring Raspberry Pi for “Ad Hoc Network”

I was excited to hit upon the idea of having the prop create its own “Ad Hoc Network” (i.e., it’s own Wifi SSID that you can join.) Not only did this eliminate the need to have the stage manager at each playhouse somehow find a way to connect the prop into their own local network, but it removed any requirement for a display or keyboard to ship with the device for configuration purposes.

All they have to do is plug in the device, wait for boot-up, and it presents its own Wifi Network (“EnchantRose”.) They then simply enter the password, bring up a web browser on their phone, and visit a pre-determined IP address which I’ve configured: http://192.168.11.1. It took a while to figure out how to configure Raspberry Pi to do this, since the instructions have changed seemingly with every release of Raspbian, the RPi operating system. But I figured it out by adopting existing instructions, and blogged it here.

What’s most exciting about this is that it’s a pattern that can has many applications in the world of “Internet of Things” — run Apache2 on your Raspberry Pi to host a website, and render that website visible via the Rpi’s own password-secured wifi network.

Current Status

The new version 2.0 prop is fully functional. I’m now in the “arts and crafts” stage of making it look much more realistic. There’s more work to be done there, as well as documenting a setup guide for stagehands.

I’ve gotten four more inquiries since November 2022, and will be selling this prop to one of them. I had considered renting it out, but it’s a bit of a logistical hassle to ship and receive. If you’ve got specific questions on assembly or the software, drop me a note. On with the show!

Turn a Raspberry Pi into a Web Server with Its Own Wifi Network (Tech Note)

The Raspberry Pi microcomputer is great for building “Internet of Things” devices. This technical post describes the steps to get your Raspberry Pi to broadcast its own local network and bridge to an Ethernet network if available. There are other guides showing how to do this on the Internet, but they are often woefully out of date, leading people down real rabbit holes.

The Raspberry Pi (RPi) microcomputer is great for building cheap “Internet of Things” devices. In this tech note, I outline how to set up a Raspberry Pi device so that it broadcasts its own local wifi network, so you can join it from a mobile phone. From there, you could launch a web browser and point it at the RPi’s website, which in turn controls the board’s I/O devices. This means you could use a mobile phone, say, and a Raspberry Pi device, and control it without any larger Internet connection.

The steps below also essentially turn the RPi into a “wifi access point,” which basically can take a hardline Internet network (LAN) and present a wifi front-end (WLAN.)

Turn your RPi into a wifi access point, or also its own ad-hoc network

So how do you get a Raspberry Pi to create its own wifi network? There are several “How To’s” on the web, but nearly all of them I followed are out of date. You need to install a few services, set up some configuration to define your network, and then reboot the Pi once everything is all set.

One great use-case is to build a standalone device which can be controlled via a web interface from, say, a mobile device. RPi’s can easily run web servers like Apache, so once you set up an RPi to broadcast its own private wifi network, you can easily interact with the Raspberry Pi’s devices and sensors via your website.

You’ve probably seen this kind of behavior if you’ve set up a wifi printer, or smart switch, or wifi security camera. These devices often have modes where they broadcast their own local wifi network, then you use a browser or a configuration app to “join” it, you do some setup process, and then it in turn uses what you’ve input to restart and join your home network with those configuration details thus supplied.

Enchanted Rose Prop 2.0

I had a use-case for this “ad hoc networking” with a stage prop I’m building.

A few years ago, I built an Enchanted Rose prop for my daughter’s school production of “Beauty and the Beast.” It let the stage manager drop petals and turn on lights on queue. It was based on Arduino and Bluetooth. I blogged the instructions in a two-part series. As a result thanks to Google, every couple of months or so, I get an inquiry from a production manager from somewhere in the world who wants to know more about how to build such a prop. Invariably, they follow these instructions and then hit a dead-end (which I’ve now noted in the posts.) The problem is, the version 1.0 device that I built is based upon an Arduino microcomputer (fine) with a Bluetooth add-on board which is now discontinued (not fine.) Worse, its controller was a proprietary Swift app which I wrote in a many-years-out-of-date dialect of Swift, which had to be installed straight from XCode onto a machine, as I opted not to publish it in the App Store. Apple has made many changes to Swift since then. The app as originally written no longer compiles, and Apple itself make it very difficult to distribute “one off” apps to people. (You can’t just post the app download somewhere, or email them a link — Apple requires that the developer add the person to an ad-hoc distribution list.)

So I began to think about how to rebuild it in a more open-source way.

Motivation for Ad-Hoc Network

At the heart of the version 2.0 of this prop is a Raspberry Pi Zero 2W, which runs its own little Apache web server to control lights and the falling petals. Ideally, a stage manager would simply need a mobile phone or iPad or some kind of web browser on a device equipped with wifi to communicate with the prop.

I’ve heard interest in this prop from stage managers in the UK, California, Colorado, Texas and more, and I wanted to re-build this prop in a more robust, even shippable way. So on the mechanical front, instead of using delicate springs and fishing line, it now uses pumps and air to push the petals off the rose. I’ve got the motors and circuits all working fine. Before moving on to the final aesthetics, I’m now working through matters related to the deployment setting(s) this prop will run in.

There’s a high school in California putting on this play in March. I don’t know what network environment is at that school, nor should I particularly care. I certainly don’t want to request and configure wifi passwords for the prop to “join” before shipping the device out. Rather than equip the prop with some kind of user interface to allow it to “join” the local WAN (needlessly wasteful screen and keyboard and instructions), it’s far better for it to broadcast its own tiny network, and be controlled from backstage just on its own. You’ve probably seen this type of “ad hoc” network when setting up, say, a printer or security camera, smart speaker, or smart switch.

But wow, getting ad-hoc networking up and going in Raspberry Pi is complicated!

THAR BE DRAGONS. It has taken a full day to get this up and running. Not only is Linux itself pretty arcane, but a much bigger problem is that so many of the instructions on ad-hoc networking for Raspberry Pi’s are wildly out of date. The Raspberry Pi Foundation changes these methods seemingly with every release of the OS.

So, to save my future self (and anyone Googling who lands here) many headaches… After much tinkering, the following instructions successfully configured a Raspberry Pi Zero 2W device to create and broadcast its own wifi network with a password. It allows clients (such as mobile browsers) to join it, and visit its control webpage hosted by the device on its Apache server. In short, the below just plain worked for me. Many, many other “how-to’s” on the web did not. A day wasted; I don’t want to do that again.

After you complete the below, you should be able to use a wifi device and “join” the network that the Raspberry Pi broadcasts. I successfully did so from both a Mac desktop and an iPhone. I could also then visit the apache page hosted on the Pi from these devices. This opens up a world of possibilities for “build and deploy anywhere” devices.

The notes which follow are adapted from: documentation/access-point-bridged.adoc at develop · raspberrypi/documentation (github.com)

There are a lot of steps here, but once you’re finished configuring your RPi, it should have its own private wifi network, and yet still be connectable via Ethernet. This is called an “Access Point” configuration.

Prerequisite: Use Raspbian “Buster,” a prior version of Raspbian OS

Make sure you use Raspbian “Buster” for the instructions. “Buster” is not, in fact, the most current version of the OS.

For the instructions below to work, you must use the older “Buster” version of Raspbian. Let me repeat, because some of you will be very tempted to use the latest version of Raspbian OS, and then will wonder why the network isn’t showing up. The Ad-hoc networking steps described below have only been tested to work on the “Buster” version. In fact, I tried and failed to get them to work on the latest (“Bullet”) version of Raspbian OS. Perhaps I did something wrong; perhaps by now it’s all resolved. But I tried twice, and only “Buster” worked perfectly.

The Raspberry Pi Foundation is great, but it’s pretty frustrating that they’re constantly tweaking the network setup code and drivers. There. are so many web pages which refer to old versions and drivers. (One clue you’re looking at an outdated how-to: if you see mention of “/etc/network” or the “interfaces” file. This method is discontinued and you’ll see no mention of it below.)

If you are dedicating your Raspberry Pi to its own ad-hoc network, I highly recommend you start over with it, back up whatever files you have on the SD card, and then use the Raspbian OS imager to create a bootable card with a fresh copy of Raspbian OS “Buster” on it. So, grab an archived copy of Buster. Unzip it. Then, launch the Raspberry Pi Imager, and click the GEAR icon to:

  1. ENABLE SSH with a password, and
  2. Set it up with your home wifi’s network name (SSID) and password.

After your card is written, you should be able to pop it out and put it in your RPi, and turn on the device. After a few moments, you should be able to ssh into it (Mac) or use PuTTY (Windows) to connect. To find the device’s IP address, go into your wifi’s router and look for a recently joined Raspberry Pi device. (Generally, the IP address will be the same from session to session.)

For Mac OSX, this looks something like:

ssh pi@192.168.x.y

where x and y are numbers. Every Internet device connected to your wifi is assigned a different address; this will vary from device to device. The default password for “pi” is “raspberry”.

Later in these setup instructions, we’re going to have it create its own wifi network with its own subnet, and connect on the backend with Ethernet. This is called a “Wide Area Network Access Point” or “Wifi Access Point” configuration, in which the RPi will basically have two IP addresses: one over the wire, and the other wireless.

1. Set up “root” user

Instead of the default user “pi”, for some operations you may need root access. For instance, NeoPixel libraries need Raspberry Pi “root” permission to run. So it’s best to set up a root user password first thing:

Then, log out of ssh and log back in with ssh root@<ip address>

From here on, you’ll want to sign in as root.

Enable remote login for the “root” user

  1. sudo nano /etc/ssh/sshd_config
  2. Find this line: PermitRootLogin without-password
  3. Change to: PermitRootLogin yes
  4. Close and save file.
  5. reboot or restart sshd service using: /etc/init

2. Get web server running

Install Apache2 Web Server with one line of code:

sudo apt install apache2 -y

This will create a folder in /var/www/html which the Apache web server will run. The install will also ensure that it starts at boot time.

3. Set up Ad Hoc Networking

OK this is the crucial part. HAVE PATIENCE, and follow this closely. (Full notes are at this Github location.)

Setting up a Routed Wireless Access Point

We will want to configure our Raspberry Pi as a Wireless Access Point, so that it broadcasts a wifi ssid, and so mobile devices can connect to it. Ideally, the RPi would also remain connectable to an Ethernet network for development purposes, to install new libraries, etc.

So a “Routed Wireless Access Point” is perfect for our needs.

AGAIN, BE SURE YOU ARE WORKING ON RASPBIAN “BULLET”, NOT “BULLSEYE” OR LATER.

You can find out what OS version you’re running with the following command:

A Raspberry Pi within an Ethernet network can be used as a wireless access point, creating a secondary network. The resulting new wireless network (called “Enchanted Rose” in my case) is entirely managed by the Raspberry Pi.

A routed wireless access point can be created using the inbuilt wireless features of the Raspberry Pi 4, Raspberry Pi 3 or Raspberry Pi Zero W, or by using a suitable USB wireless dongle that supports access point mode. It is possible that some USB dongles may need slight changes to their settings. If you are having trouble with a USB wireless dongle, please check the forums.

This documentation was tested on a Raspberry Pi Zero W2 running a fresh installation of Raspberry Pi OS Buster.

Before you Begin

  1. Ensure you have root access to your Raspberry Pi. The network setup will be modified as part of the installation: local access, with screen and keyboard connected to your Raspberry Pi, is recommended.
  2. Connect your Raspberry Pi to the Ethernet network and boot the Raspberry Pi OS.
  3. Ensure the Raspberry Pi OS on your Raspberry Pi is up-to-date and reboot if packages were installed in the process.
  4. Take note of the IP configuration of the Ethernet network the Raspberry Pi is connected to:
    • In this document, we assume IP network 192.164.4.0/24 is configured for the Ethernet LAN, and the Raspberry Pi is going to manage IP network 192.168.11.0/24 for wireless clients.
    • Please select another IP network for wireless, e.g. 192.168.10.0/24, if IP network 192.168.11.0/24 is already in use by your Ethernet LAN.
  5. Have a wireless client (laptop, smartphone, …) ready to test your new access point.

Install Access Point and Management Software

In order to work as an access point, the Raspberry Pi needs to have the hostapd access point software package installed:

Enable the wireless access point service and set it to start when your Raspberry Pi boots:

sudo systemctl unmask hostapd
sudo systemctl enable hostapd

In order to provide network management services (DNS, DHCP) to wireless clients, the Raspberry Pi needs to have the dnsmasq software package installed:

Finally, install netfilter-persistent and its plugin iptables-persistent. This utility helps by saving firewall rules and restoring them when the Raspberry Pi boots:

sudo DEBIAN_FRONTEND=noninteractive apt install -y netfilter-persistent iptables-persistent

Software installation is complete. We will configure the software packages later on.

Set up the Network Router

The Raspberry Pi will run and manage a standalone wireless network. It will also route between the wireless and Ethernet networks, providing internet access to wireless clients. If you prefer, you can choose to skip the routing by skipping the section “Enable routing and IP masquerading” below, and run the wireless network in complete isolation.

Define the Wireless Interface IP Configuration

The Raspberry Pi runs a DHCP server for the wireless network; this requires static IP configuration for the wireless interface (wlan0) in the Raspberry Pi. The Raspberry Pi also acts as the router on the wireless network, and as is customary, we will give it the first IP address in the network: 192.168.11.1.

To configure the static IP address, edit the configuration file for dhcpcd with:

sudo nano /etc/dhcpcd.conf

Go to the end of the file and add the following:

interface wlan0
    static ip_address=192.168.11.1/24
    nohook wpa_supplicant

Enable Routing and IP Masquerading

This section configures the Raspberry Pi to let wireless clients access computers on the main (Ethernet) network, and from there the internet.

NOTEIf you wish to block wireless clients from accessing the Ethernet network and the internet, skip this section.

To enable routing, i.e. to allow traffic to flow from one network to the other in the Raspberry Pi, create a file using the following command, with the contents below:

sudo nano /etc/sysctl.d/routed-ap.conf

File contents:

# Enable IPv4 routing
net.ipv4.ip_forward=1

Enabling routing will allow hosts from network 192.168.11.0/24 to reach the LAN and the main router towards the internet. In order to allow traffic between clients on this foreign wireless network and the internet without changing the configuration of the main router, the Raspberry Pi can substitute the IP address of wireless clients with its own IP address on the LAN using a “masquerade” firewall rule.

  • The main router will see all outgoing traffic from wireless clients as coming from the Raspberry Pi, allowing communication with the internet.
  • The Raspberry Pi will receive all incoming traffic, substitute the IP addresses back, and forward traffic to the original wireless client.

This process is configured by adding a single firewall rule in the Raspberry Pi:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Now save the current firewall rules for IPv4 (including the rule above) and IPv6 to be loaded at boot by the netfilter-persistent service:

sudo netfilter-persistent save

Filtering rules are saved to the directory /etc/iptables/. If in the future you change the configuration of your firewall, make sure to save the configuration before rebooting.

Configure the DHCP and DNS services for the wireless network

The DHCP and DNS services are provided by dnsmasq. The default configuration file serves as a template for all possible configuration options, whereas we only need a few. It is easier to start from an empty file.

Rename the default configuration file and edit a new one:

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo nano /etc/dnsmasq.conf

Add the following to the file and save it:

interface=wlan0 # Listening interface
dhcp-range=192.168.11.2,192.168.11.20,255.255.255.0,24h
                # Pool of IP addresses served via DHCP
domain=wlan     # Local wireless DNS domain
address=/gw.wlan/192.168.11.1
                # Alias for this router

The Raspberry Pi will deliver IP addresses between 192.168.4.2 and 192.168.4.20, with a lease time of 24 hours, to wireless DHCP clients. You should be able to reach the Raspberry Pi under the name gw.wlan from wireless clients.

NOTEThere are three IP address blocks set aside for private networks. There is a Class A block from 10.0.0.0 to 10.255.255.255, a Class B block from 172.16.0.0 to 172.31.255.255, and probably the most frequently used, a Class C block from 192.168.0.0 to 192.168.255.255.

There are many more options for dnsmasq; see the default configuration file (/etc/dnsmasq.conf) or the online documentation for details.

Ensure Wireless Operation

Note, I successfully skipped this subsection

Countries around the world regulate the use of telecommunication radio frequency bands to ensure interference-free operation. The Linux OS helps users comply with these rules by allowing applications to be configured with a two-letter “WiFi country code”, e.g. US for a computer used in the United States.

In the Raspberry Pi OS, 5 GHz wireless networking is disabled until a WiFi country code has been configured by the user, usually as part of the initial installation process (see wireless configuration pages in this section for details.)

To ensure WiFi radio is not blocked on your Raspberry Pi, execute the following command:

This setting will be automatically restored at boot time. We will define an appropriate country code in the access point software configuration, next.

Configure the AP Software

Create the hostapd configuration file, located at /etc/hostapd/hostapd.conf, to add the various parameters for your new wireless network.

sudo nano /etc/hostapd/hostapd.conf

Add the information below to the configuration file. This configuration assumes we are using channel 7, with a network name of EnchantedRose, and a password AardvarkBadgerHedgehog. Note that the name and password should not have quotes around them, and the passphrase should be between 8 and 64 characters in length, or else “hostapd” will fail to start.

country_code=US
interface=wlan0
ssid=EnchantedRose
hw_mode=g
channel=7
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Note the line country_code=US: it configures the computer to use the correct wireless frequencies in the United States. Adapt this line and specify the two-letter ISO code of your country. See Wikipedia for a list of two-letter ISO 3166-1 country codes.

To use the 5 GHz band, you can change the operations mode from hw_mode=g to hw_mode=a. Possible values for hw_mode are:

  • a = IEEE 802.11a (5 GHz) (Raspberry Pi 3B+ onwards)
  • b = IEEE 802.11b (2.4 GHz)
  • g = IEEE 802.11g (2.4 GHz)

Note that when changing the hw_mode, you may need to also change the channel – see Wikipedia for a list of allowed combinations.

Troubleshooting hostapd: If for some reason your access point is not coming up, try running hostapd manually from the command line: sudo hostapd /etc/hostapd/hostapd.conf

You’ll likely get some kind of error message back.

Running the new Wireless AP

Now restart your Raspberry Pi and verify that the wireless access point becomes automatically available.

Once your Raspberry Pi has restarted, search for wireless networks with your wireless client. The network SSID you specified in file /etc/hostapd/hostapd.conf should now be present, and it should be accessible with the specified password.

If SSH is enabled on the Raspberry Pi, it should be possible to connect to it from your wireless client as follows, assuming the pi account is present: ssh pi@192.168.11.1.

If your wireless client has access to your Raspberry Pi (and the internet, if you set up routing), congratulations on setting up your new access point!

If you encounter difficulties, contact the forums for assistance. Please refer to this page in your message.

Once this is done, the network should be “EnchantedRose”, and the main web address should be 192.168.11.1.

Build Your Own Enchanted Rose Prop (Part II)

Part 1 of this article covers the basic parts list, code, and assembly.

UPDATE (January 2023): I’ve built a version 2.0 of this prop. See “Enchanted Rose 2.0: Raspberry Pi Prop with Falling Petals” for updated instructions. 

UPDATE (April 2021): The Bluetooth shield used in this Arduino-based project is apparently discontinued. If I were to build this project again today, I’d make it a Raspberry Pi Zero W with Headers (or 3B+) based device. Take note on that order page of the adapter cables and power supply you should also get.

The RPi would run a simple Flask (python) server to control the servo motors. I’d attach an Adafruit Servo Motor HAT to do the servo motor control, and then build a simple web application to control the prop. This would eliminate all the Swift Coding involved in the app controller, and allow for much easier building/debugging. I would absolutely use the same drop mechanism. That is, servo motors, spring loaded magnets mounted in a wooden golf-ball sized drawer handle.

To be clear, this updated approach would mean I would not order the Redbear Labs BLE shield nor the Arduino, nor would I futz with the fun but unnecessary iOS app. But nothing prevents you from building a nice one to control a Raspberry Pi based prop!

Now that the Enchanted Rose Prop is nearing completion, I wanted to cover a few final details. Here’s a video of the app and prop in its current form:

Aesthetic Touchup

Some paint and floral tape was used to give the stem a little more rose-like appearance. Still in progress, but you get the idea.

Ring Lights

The ring lights are a Neopixel 1 meter long strip. I cut the strip between the LEDs at roughly the 40 LED mark. Doing so has no effect on the Neopixel, as long as you cut between LEDs.

Big gotcha: These lights only want 5V maximum! I fried the first set by overpowering it. Don’t make that mistake — it’s irreversible.

Stem Accent Lights

I purchased a cheap set of LED lights to add some interest to the stem.

These are powered by their own 3-AA battery pack. I’m sure I could use the same 3 AA-battery pack used by the Neopixel strip, but after frying one of those strips, I chose not to risk wasting another $30 tempting fate. To turn these on and off, an N-channel MOSFET transistor is used, with its gate actuator tied to pin 10 of the Arduino.

Basically, the MOSFET transistor lets current pass through if voltage is applied to the Gate pin (pin 1 in the diagram above.) When voltage on the gate goes LOW, the LED accent lights turn off. When voltage on the gate goes HIGH, the accent lights turn on.

Soundproofing

The servo motors are a little squeaky when moving. I installed some foam sound barriers (ordinary shipping packaging) to help dampen the sound.

Drop Mechanism

The initial approach of using piano wire to move flexible wires up and down worked fine from a dropping standpoint, but it had two distinct disadvantages in practice:

  1. the vertical extension above the bud made it hard to get the upper petals to to look real
  2. the “re-set” procedure was going to be way too hard for young adults to do Did I mention that after I had the prop working for an adult, my wife told me that the crew would be entirely comprised of fifth graders? “Hardening” the prop for fifth grade use for 8 performances in ways such as this was actually the most time-consuming part of the project.

So instead, I revised the attach/drop mechanism, to fishing-line-pulls-a-magnet.

I drilled four holes into a wooden 1 1/2″ golf-ball. Tip: use two drill bits, a small one that goes all the way through (just for the fishing line), and a wider one for the hole where the spring mechanism sits. You’ll want to give the spring something to push against, so don’t go all the way through the wooden ball with the drill, as I mistakenly did.

The key part are rod magnets which are inserted into thread covers and put into a spring:

I later added rubber caps over these magnets (but first drilled a small 6mm hole in the center.) I then hot-glued these caps-with-holes over these magnets. In “normal” state, the magnet protrudes through the caps to make surface contact with the washers inside the petals. When the Servo motor moves, it temporarily (2-3 seconds, programmable delay) pulls the fishing line which separates the magnet from the petal, and then resets it to the normal position. The advantage of this design is that it only uses servo motor power during the drop operation.

Result: TOTAL SUCCESS. Worked flawlessly in production and could even be re-set by kids (though I admit I double-checked pre-show.)

The fishing line is pushed through the (orange) nylon thread cover and a double knot is used to prevent it from pulling through. Then, the rod magnet is inserted, finally that’s inserted into a spring. That subassembly is repeated three more times, and inserted into the four holes in the wooden “bud.” You’ll want to make the exit hole for the fishing line quite a bit smaller than the upper hole, so the springs have something to push against. The only thing that comes through the bottom of that wooden ball is four strands of fishing line, which are fed down into the stem, one to each of the four servos.

The petals have a small metal washer hot-glued to the base, which is magnetically attached to the bud. When the servo motor turns, the rod magnet is pulled down about a half inch to an inch into the chamber, and this action causes the petal to fall. The servo motor returns to “slack” position and the spring returns the rod magnet back to its ready position.

The petals can then be reattached.

This drop mechanism is much more durable, and now that the magnets are “self-resetting”, I’m thinking of switching the slider-control based drop mechanism to a simple push-button interface.

(Update: I did so, and those changes are reflected in the Github code. It’s a simple four-button interface for the drop mechanism, one for each petal; this initiates a retraction of the servo, a pause for a second or so, and then restoration to the ready position.)

Epilogue

The performances— all eight showings — were smashing successes!

Izzy, the fifth-grade prop controller, did a great job controlling it and the prop functioned just as designed.

Izzie and The Rose Prop

If there was a flaw, it was that one of the petal drops (of the 32) worked but got hung up on the LED light bush below it, so it appeared not to drop, but that was pretty minor and not a big deal.

Note that I did decide to replace the full set of AA batteries in the entire prop after the fourth performance. I can’t speak to whether that was unnecessarily premature, but there were no battery failures. Each performance was about 90 minutes, and the power to the prop was turned on about a half hour before and after each performance.

The Enchanted Rose Prop is now in the hands of the school theater director (and computer tech teacher; she’s one and the same) as a partial thank-you for all her great work with the kids.

Build Your Own Enchanted Rose Prop

NOTE: There’s a version 2.0 of this project! Follow this link for information on Enchanted Rose 2.0.

My daughter is in Beauty and the Beast this spring. So I thought it’d be a good opportunity to test my Internet of Things (IoT) skills using Arduino, Bluetooth and iOS, and build a remote-controlled Enchanted Rose prop which has variable-color lighting and can drop petals on cue. I contacted the director, volunteered to make the prop, and she was all for it. Read on to see how you too can construct one of these.


UPDATE September 2022: Enchanted Rose 2.0

The plans which follow are version 1.0, based on Arduino, Bluetooth, and a dedicated iOS app written in Swift to control the prop. But the Bluetooth shield in this project has since been discontinued, and the iOS app, while nice and functional, is hard to distribute to others and troubleshoot. Apple is constantly upgrading (breaking compatibility) for its Swift programming language, making it a headache to get running on each instance. 

In the roughly 4 years since I published this piece, I’ve heard inquiries from multiple production managers (UK, CA, CO, NY and more) who want to acquire or rent such a prop. Rather than continue with support on this, I’m building a newer version which will be available for rent.

That of course also means the new design must be shippable, not as delicate as this version 1.0 design is. The 1.0 design is being tossed; the 2.0 design will employ a web server powered by a Raspberry Pi.

Follow me on Twitter to see when the version 2.0 is available (ETA early October 2022.) If you’d like to rent the 2.0 version of the prop, reach out, and please include your production date and ship-to address, and we can discuss. 

So, to summarize: While version 1.0’s design described in this two-part blog series might help guide you in building your own remote-control Enchanted Rose, it employs a few parts and software components that are no longer available. I cannot provide any tech help on the Swift control app, as there are just too many idiosyncracies and configuration issues. The 2.0 version I’m building at present is a different design, based on a Raspberry Pi controlling solenoids to drop the petals. This approach will be far more durable for shipment, and should be plug-and-play for any production.

Now back to the 1.0 article.


This is a two-part article. Lessons are learned along the way, so be sure to read the complete two-part article (Part II here) before proceeding and/or sourcing parts. Some of the design decisions were changed in final implementation; this is more in narrative form with learning lessons along the way.

Part 1 : Basic Prop Setup

At this writing, the vast majority of the prop is working, but it’s not yet fully finished. Some aesthetic touches remain. The performances are still a couple months away, so I’ll be updating this post as the project nears completion.

Here’s a demo of the project in its current stage. This stage uses a v2 mechanism to drop the petals.

Figuring out the best petal-dropping mechanism was actually the most time-consuming part of this project. I found it relatively easy to get an app to control servo motors using Bluetooth, but the question is — how to do you translate servo-motor turns into petal drops?

I originally started out with the idea of stiff piano wire, attached to servo motors in the base moving up and down and the petals having small cocktail straw segments hot-glued to them. This worked, if the prop was set perfectly.

But for various safety reasons (and especially after my wife reminded me that a fifth-grade crew was going to be operating and re-setting this prop), I switched to a version 2.0 design of tiny rod magnets mounted on springs in the “bud,” pulled by fishing line connected to the servos.

There’s a parts list and notes below, with links to the complete source code. Hopefully this this may help other performances that might have this same prop need.

The prop has three basic components:

  • Physical Prop (Rose and Dome)
  • Control App (iOS)
  • Arduino Microprocessor Software

The app “speaks” to the prop via Bluetooth, ably powered by this BLE Shield from Red Bear Labs:

UPDATE (November 2019): I believe the above model, which I used in this project, is now discontinued. If you insist on sticking with Arduino and Bluetooth, you might try other Bluetooth shields, like this one: https://www.adafruit.com/product/2746. You can see a demo of this shield in action here: https://www.youtube.com/watch?v=5ZQ5JJTwONcYou will have to adjust the Swift code included in this blog post to include the new board-specific libraries. Swift has changed considerably since the release of this article. That’s in part why I’d recommend you consider a Raspberry Pi – Wifi approach rather than and Arduino/Bluetooth/iOS-app approach. 

In addition to servo motors which control the falling petals, it has a variable-color LED-strip for optional magical effects on cue:

Parts List, v1.0

  • Display dome (“cloche”) with wooden base
  • 2–3 large Silk roses (will cannibalize some to get petals)
  • Arduino MEGA — While an UNO will work just fine if you don’t want the Neopixel accent light, I chose a MEGA here because the NeoPixel and BLE shield together don’t supply enough available pins to control 4 separate servo motors. (UPDATE April 2021: I’d opt for a Raspberry Pi Zero W, since it can speak WiFi and run Python and small websites.)
  • Wood for base: 3 12×12″ thin plywood sheets, 1 2 foot segment of 1×1
  • 3M Mounting Tape and hot glue gun
  • Coffee straws (if you stick with version 1 design), OR four small rod magnets, 1 1/2″ wooden ball and metal washers (if you use version 2 design)
  • Electronics “breadboard” and jumper wires
  • 17 AA batteries, yes 17. You’ll need 3 for the Neopixel lighting strip (and no more!), 8 to power the servos, and 6 to power the Arduino & BLE Shield. If you want to be fancy, I’m sure you could use a regulator to get from the 9V down to the 5V for the Neopixel, but after frying one of them, I wasn’t interested in risking it.
  • 3-AA battery case (1)
  • 6-AA battery case (1)
  • 8-AA battery case (1)
  • Red Bear Labs Bluetooth Low Energy (BLE) shield see note above – discontinued; you’ll most likely have to use a different BLE shield (Update April 2021: Not needed if you go with the Raspberry Pi approach, since the communication from controller to prop would be via Wifi.)
  • Adafruit NeoPixel strip (60 LEDs, 1 meter)
  • 18″ Aluminum tube
  • 4 springs, about 1/8″ diameter by 1 1/2 inches — not too stiff. I purchased my springs from a local hardware store; the spring from inside a ballpoint pen might also work as well.
  • 4 silicon/rubber thread covers
  • High-strength (e.g., 60lb) fishing line
  • 4 servo motors (Update April 2021: With a Raspberry Pi Zero W approach, I’d definitely opt for a motor controller board, since controlling servos via software on the Raspberry Pi ends up with all kinds of timing issues and motor jitter; you really want a piece of hardware to take control of the Pulse Code Modulation. The right board for the job is this one by Adafruit.)
  • 1000 mu capacitor
  • 300 ohm resistor
  • Sound baffling and/or black felt curtain for the base
  • (optional) 3 toggle switches for power — alternatively, you can just remove a battery from each pack
  • Soldering iron and solder

Physical Prop

What actually causes the petals to drop are four servo motors located beneath the base. They move string that temporarily pulls down a spring-mounted magnet through the stem. This breaks a magnetic connection between the magnet and a washer hot-glued to the petal, causing petals to drop. After a second or two, the servo motor returns to its normal position (with the spring resetting the magnet to being just 1mm proud of the hole).

Use a vise to hold the ball before drilling through. Also, drill with two different sizes of drill bits — be sure to make bottom holes much smaller than top holes, to give something for the springs to rest & push against, so the springs cannot fall through

Dry-fit test, before fishing line was passed through the orange nylon thread cover

To assemble, find the exact center of the dome’s base, and drill a hole just large enough for the aluminum tube. Build a supporting structure which goes under the base, which consists of a shelf for the servos and room for the electronics underneath. Next, affix the servos to the “servo shelf” — I used wall mounting tape from 3M for this purpose. Run piano wires from each servo up through the aluminum “stem.”

The original design was to have the petals attached to the wire by means of small straw segments. When the piano wire withdrew 1/2″ or so into the tube, the petals should fall.

While this simple mechanism worked, I found it was extremely difficult to “reset” for every performance with the wires bunched so tightly together at the flower.

So the final version uses the spring-loaded magnet technique, which works great. Take the silicon/rubber thread covers, drill a very tiny hole in the bottom, thread high-test fishing line through, and tie a double knot at the end. Then, push the rod magnets into the thread covers, and thread the thread covers into the springs, as shown above.

Small metal washers are then hot-glued to individual petals. When the fishing line is pulled by the servo, the magnet withdraws into the stem and separate from the washers on the petals, causing the petals to fall off.

An electromagnetic way of attaching/dropping petals would also work, but for pragmatic reasons, I didn’t pursue that approach: the performance is 1–2 hours long, and I worried about the batteries giving out before the cue. With the magnet and fishing line approach, the petals can stay attached without power.

Control App (iOS)

  • Written in Swift 4 (XCode) and published straight to the device.
  • You’ll need a Mac and the IDE XCode (free at this writing). You do not need a developer program license, since you’ll be publishing the app straight to your iOS device (works with both iPhone and iPad.)
  • You can get the source code from Github here: https://github.com/stevemurch/EnchantedRoseBLE
  • This source code requires you to install the CocoaPod for the color picker. As with all Cocopod-based projects, you’ll need to open the .xcworkspace file, NOT the standard project file, to get the app to compile.
  • This source code assumes that your servos are linked to pins 2, 3, 5 and 6.

Arduino Software for the Microcontroller

Gotchas

  • You will RUIN your $35 Neopixel strip if you accidentally power it with more than 5V! I learned that lesson the hard way; in my haste I wired in the Neopixel strip to the 12V power rail being used for the servos. That permanently fried the light strip instantly. Don’t do that. Instead, create another 4.5V power rail, using 3 (and only 3) AA batteries. The Neopixel strip is awesome, but very sensitive to too much voltage. Be sure to read the Neopixel documentation that shows how to wire in a 1000 mu capacitor and 300 Ohm resistor.
  • The servo motors however require much higher voltage to operate smoothly (12V.) So I powered these entirely separately, using a separate power rail on the breadboard. Make sure you wire the common grounds together, and both back to the Arduino.
  • The Neopixel documentation suggests you power on the Arduino before powering on the Neopixel. So we’ll be powering up in the following order: (1) Board, (2) Servos, (3) Neopixel, (4) Launch app. If you fail to do it in that order, the app might try to connect before a signal is available from the prop and timeout. Simply relaunch the control app and it should discover the device.
  • Connection is excellent, and works through walls and for more than 40 feet. If connection is lost, simply restart the app.
  • It turns out there is a known conflict between the Neopixel strip and servo motors (has to do with timing/interrupts). The fix involves using a custom servo library which limits the Uno to just two servos. So, I decided to upgrade to an Arduino MEGA to get more servo ports. I also used the custom library for servos located here: https://learn.adafruit.com/neopixels-and-servos/the-ticoservo-library
  • This source code assumes that your servos are linked to pins 2, 3, 5 and 6 (note: there’s no 4), and that your Neopixel control pin is 7. All are digital pins.

Basic wiring diagram — note the batteries are just representative; each source has different voltage requirements.

Wiring (BLE Shield not shown, but it’s plugged into Arduino board)

At current writing, all servos and lights work, including the ability for stage crew to set the lighting color. I’m now working on improving the physical petal dropping, by making it easier to re-set (done, and Github code reflects that.) UX changed slightly from the screen below — I changed it to four pushbuttons, one for each petal.

App Screenshot

Servo shelf on top, electronics below. The servo shelf is doughnut-shaped.

Version 1.0 of Petals. I didn’t think this method will be easy for a stage-crew to re-set, so I switched to magnets and hot-gluing small metal washers to the petals.

Physical Prop (in progress — leaves and petals will be attached to stem, and perhaps the stem will be bent.)

Read more… Part II: Finishing Touches