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. So I contacted the director, volunteered to make the prop, and she was all for it.
A variant on this would be to use, say, a Raspberry Pi hosting a simple web server, which would be controllable over wifi. Basically, you need a microcontroller, some servo motors, a tiny bit of clever mechanical engineering to reliably drop the petals, and a way to communicate to the microcontroller from a phone, laptop or tablet.
Note: 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 steps changed in final implementation, and 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 that’s the case, use an alternative Bluetooth shield, 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=5ZQ5JJTwONc. You will have to adjust the Swift code included in this blog post to include the new board-specific libraries.
In addition to servo motors which control the falling petals, it has a variable-color LED-strip for optional magical effects on cue:
- 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
- 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)
- 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
- 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
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).
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
- Written in Arduino Sketch Editor and deployed to the Arduino via USB cable.
- You can get the code from Github here: https://github.com/stevemurch/EnchantedRoseProp
- 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.
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.
Read more… Part II: Finishing Touches
Steve’s an entrepreneur and software leader. Most recently, he founded HipHip.app, the easiest way to create celebration videos. He also founded bigthanks.org, helping people discover and share productive ways they can respond in times of crisis. Steve’s worked on consumer apps, online travel, games, relational databases, management consulting and telecom. He launched Alignvote in 2019, which helped Seattle voters find their best-match political candidates. Steve founded BigOven, the first recipe app for iPhone, now with more than 15 million downloads, which was purchased in 2018. Steve served as Chairman of Escapia Inc., the leading SaaS solution for the US vacation rental industry, sold to Homeaway, now part of Expedia. In 1997, Steve was cofounder, President, CEO and Chairman of VacationSpot, a pioneer in the online reservation of vacation rentals, bought by Expedia in January 2000. At Expedia, Steve was Vice President of Vacation Packages, leading the vacation package and destination services teams, helping to create two patents on the first-ever dynamic vacation packaging system on the Internet, which now represents billions in annual transactions for Expedia.
He has keynoted on several occasions at the Vacation Rental Managers Association (VRMA), and taught a graduate level course on the strategic management of innovation at the University of Washington Foster Business School in Seattle, Washington.
Steve worked for Microsoft from 1991 to 1997 in a variety of senior marketing and executive positions, and led the creation of the internet games group, helping develop several products and patents related to online multiplayer gaming. He helped launch Microsoft Access and was involved in the acquisition of Fox Software by Microsoft in 1993. He’s worked for IBM, Booz-Allen Hamilton and Bell Communications Research.
He holds an MS in Computer Science from Stanford University in Symbolic and Heuristic Computation (AI), an MBA from Harvard Business School, where he was named a George F. Baker Scholar (awarded to top 5% of graduating class), and a dual BS in Applied Mathematics / Computer Science and Industrial Management from Carnegie Mellon University (CMU) with University Honors. Steve volunteers when time allows with Habitat for Humanity, University District Food Bank, YMCA Seattle, Technology Access Foundation (TAF) and other organizations in Seattle.