This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
One of the most fascinating and delicate plant in the world is the flower Calochortus albus, otherwise known as the globe lily or the fairy lantern. I decided to create a light source inspired by this spring flower aptly called "The Fairy Lantern." The main goal of this project is to have an interesting and colorful desk lamp that is not only functional, but also fascinating to watch!
To make this lamp, I started by creating CAD designs in Autodesk Inventor and then 3D printing the parts. Later I merged the pieces with Arduino hardware to have the petals of the flower move with a color-changing LED light. The color of the light can controlled on an Android phone via Bluetooth and the petals can open and close to simulate blooming. Here is a demonstration of my project below. Feel free to modify or add parts to this project in your own design.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Materials and Hardware
- 1 Arduino Micro-controller
- 1 BYJ48 Stepper Motor
- 1 RGB LED
- 1 Bluetooth Module (HC-05 or HC-06)
- 1 Battery Adapter
- 4 AA Alkaine Batteries
- 1 USB cable
- 20 Male-to-male jumper cables
- 4 more Male-to-male or Male-to-female jumper cables (for soldering)
- 1 Mini Bread Board with power rails
- 1 Hexagonal Nut
- 20 screws
- ULN2003 Driver
- 1 Round-head 4'' Screw
- Electrical Tape
- Flower pot / Box (optional)
In addition there are some items that you should have access to:
- A 3D Printer / 3D Printing Lab
- Soldering tools
- Wire cutters
- A Laptop
Step 2: Required Software
Download the following:
- Autodesk Inventor Professional: http://www.autodesk.com/
- Arduino Software: https://www.arduino.cc/en/Main/Software
Both softwares listed above are Windows 7/8/10 and Mac OSX compatible. Like most CAD tools, Autodesk requires payment unless you have a university email address for students.
For Android phone, download the following app on the Google Play store: https://play.google.com/store/apps/details?id=appi...
It's called the Color LED Controller and it will allow you to change the color of the flower from your phone via Bluetooth.
Step 3: Arduino Sketch
Here's the Arduino 1.6.8 code which controls the LED and stepper motor. Both the Wire library and the Software Serial library should be automatically available to you but you can always use the New Software Serial library to modify in your own project. (http://arduiniana.org/libraries/newsoftserial/). Simply download the file and save in your library folder.
To run the code, download it, open it from your Arduino software, and click the blue upload arrow with your USB plugged into your computer and micro-controller. In the code, the Bluetooth receiver collects data from your phone to change the colors of the lights. When the "Turn Off" button is pressed, the stepper motor is activated to open and close the petals while a randomly generated sequence of colors lights up the lamp.
SN: About the Stepper Motor
One issue I had is with the Arduino stepper library not working well with the 5 V stepper. It had problems turning counterclockwise with a very slow RPM. You can fix this problem by half stepping so that it's programmed with 8 steps total instead of 4, giving the motor the a much smoother motion. The Arduino code that control this motion is accredited to this awesome instructable: https://www.instructables.com/id/BYJ48-Stepper-Moto...
Step 4: Setting Up the Control System
Hardware can look daunting in the photos with all the crisscrossing wires and components. To help, I've set up a Fritizing diagram for this control system. There are three separate parts that are set up together in this project: the stepper motor (and driver), the HC-06 Bluetooth Module, and the RGB LED. I've included pictures of these three set up individually as well a complete image of them together. Follow the Fritizing diagrams one by one until it matches the first photo.
Setting up the Power Rails:
There is only one 5V input on the Arduino Uno and you're going to need three. To fix this, we'll set up a power rail on the ends of the breadboard. The 5V will run through the red column marked "+" and ground will run through the blue column marked "-". To start, connect a jumper wire from the 5V input on the Arduino to the + rail of the breadboard. Next connect another jumper wire from the GND input on the Arduino to the - rail of the breadboard.
We will use these two rails with the rest of our components.
Setting up the RGB LED:
Check out the second Fritzing Diagram with the LED. You'll need three 220 Ohm resistors and three jumper wires. The wires are color coded in the diagram for each color of the RGB. Here is where the other ends of the jumper wires should be placed:
PIN 3 >> Red Wire
PIN 4 >> Green Wire
PIN 5 >> Blue Wire
+ >> Common Cathode OR - >> Common Anode (Depending on which LED you have)
Remember that the power rails travel vertically from top to bottom. Connect the Common Cathode/Anode anywhere on the power rail below where you set up in part 1.
Setting up the Bluetooth Module:
There are four legs to the bluetooth module (HC-05 or HC-06). Connect them to 4 jumper wires and the set up is as follows:
PIN -0 >> RX
PIN 1 >> TX
+ >> VCC
- >> GND
Setting up the Stepper Motor:
The BJY48 Stepper Motor comes with a set of jumper wire connected to a port. Insert this into the motor driver. The one I am using is the ULN2003. It has four input pins IN1-IN4. Use 4 jumper wires to connect that to pins 8-11 on the Arduino board. In addition, the board also has two legs labelled + and -. Connect + to the positive power rail on the breadboard and connect - to the negative power rail on the breadboard.
Step 5: (optional) Extra Information About the RGB LED
** Note: this is optional information about the RGB LED and will not affect your project, but it can provide insight to how it works and will allow you to display your color of choice in the function call. Skip this step if necessary.
The RGB (Red-Green-Blue) LED is a very versatile component. As you can see from the pictures, there are four 'legs' to the LED which from left to right are: Red, Common Cathode/Anode, Green, and Blue.
The common cathode/anode is special because it has the longest leg, (which will help you distinguish it from the other three) and it connects to either ground (anode) or 5 V (cathode) depending on your LED type.
The way these LEDs work has to do with the combination of red, blue and green lights which can create different colors by setting a value from 0 to 255. For example, a red light would be 255 Red, 0 Green, and 0 Blue while pink is 250 Red, 29 Green, and 142 Blue. You can use this website (http://www.rapidtables.com/web/color/RGB_Color.html) to look up the hexadecimal values of different colors and upload your favorite colors to the LED.
Also, one thing to keep in mind is that for common cathode LEDs, the values should be subtracted from 255 to get the color that you want. However all of these factors are already taken care of in the Arduino sketch, so there's no need to modify anything, unless you want to!
Step 6: 3D Printed Parts
The goal of the design is to make something functional yet interesting to look at. For example, I wanted to create an "onion-like" curve for the petals that will give it an intimating look when it blooms. The shapes and colors of the connecting pieces are designed to look purposefully gear-like and mechanical/artificial compared to the natural look of the flower.
I created these parts in Autodesk Inventor and printed them at the Advanced Visualization Center at USF. If you do not have a 3D printer available, just download the zip file and send it to a local 3D printing business. They usually have very affordable prices and they can even ship it to you, too.
In addition, the most important part of the design is the holes that allow for a filament nail to connect pieces to each other. A good print should have clear cut holes, so allow for a 2mm offset which varies from machine to machine. If they all line up, then you're ready for assembling.
Download the files below and print.
Step 7: Assembling Your 3D Printed Parts
With your parts fresh out of the printer, it's finally time to construct your lamp!
- First, take a petal and line it up with one end of a gray bar. Add a filament screw between the holes to keep them in place. This should be a tight fit screw, but if the diameter is too small you can always use super glue.Connect the other end of the gray bar with the center hexagonal piece. Once again, add a screw to keep them together. At this point you can test out the motion of the center piece and see how it pushes the petals in and out.
Connect the bottom of the petal to the green base. Add a screw to keep it in place.
Repeat Steps 1-3 five more times for all six petals.
Open the petals so that you can now work on attaching the screw and nut. Thread the nut through the screw and connect it to the hexagonal hole in the center base.
On the bottom of the screw is where the motor adapter will go. This is that small, cylindrical piece with a large hole on one end for the screw and a smaller hole on the other end for the stepper motor. Make sure to press the adapter and nut securely in place
On the other end of the adapter, attach the rotating head of the motor. Once your finished, we can add the other electrical components.
Step 8: Android App
After downloading the app, enable Bluetooth on your phone and you'll be shown a list of near by Bluetooth devices. Click on the one labelled "HC-06" and you'll be prompted for a password. Enter "1234" and hit "OK". Now open your app and click on "BT LIST". Choose the HC-06 Module and wait for it to load (see second picture). Now everything is set up and you can start swiping the color wheel to change your LED color. Click on the "Turn Off" button and the LED will cycle through a series of colors while the petals open/close, until it eventually turns off.
Step 9: Putting It All Together
We're almost done! Following these last few steps to bring your flower to life:
Attach Stepper Motor to the Base:
The stepper motor was connected to the screw in the previous part. Make sure to keep the stepper motor in place by lining it's two holders with the holes of the green base and add another screw between them to hold it in place.
Place the LED in the Socket:
The third and largest hole on the green base is the LED socket. This will hold the LED in place. Make sure the other end of the LED is still connected to the breadboard when doing so.
Upload the Arduino Code with an External Power Source:
Use a battery adapter to connect the Arduino to 9 V from 4x 1.5 V AA Alkaline Batteries. The Arduino will remember the last code it implemented, so make sure you upload the LED Control sketch before connecting it to the batteries. See the previous step on uploading to your Android phone and controlling the flower.
Presentation / Finishing Touches:
I used a flower pot to hold all the electronics and a round cork board to keep it in place. If you want to do this as well, drill a hole in the cork board and feed your wire through the hole and into your flower pot. You can find both materials at a local construction or gardening store for under $5 USD.
Last but not least, remember to be creative! Feel free to add any special touches, such as paint, faux plants, or different colored 3D printed parts to adorn your flower. Otherwise, you've officially finished the project at this point. Thank you for viewing and have fun, makers!
Participated in the
First Time Author Contest 2016