How to Make an Ever-Blooming Mechanical Tulip

Hello everyone, I am Zhang Qiaolong, and today is Qixi Festival.

We should give our girlfriends/wives some gifts, why not take a look at this? A mechanical tulip sculpture that blooms with a gentle touch and emits colorful lights.

How to Make an Ever-Blooming Mechanical Tulip

1. Video Demonstration

2. Hardware Materials

  • 1 * Arduino Nano R3

  • 1 * SG90 Servo

  • 1 * TTP223 Touch Module

  • 1 * 1mm Brass Wire

  • 1 * 2mm Brass Tube

  • 1 * 0.3mm Insulated Copper Wire

  • 7 * WS2812 5050 LED Lights

  • 30 * White 1206 SMD LEDs

3. Implementation Process

1. Overall Idea

Before I tell you how to create this beauty, let me briefly talk about how it works. The tulip consists of 6 petals, each with 5 surface-mounted white LEDs.

Each petal is connected to an Arduino output pin. The flower core hides 7 RGB LEDs.

From an electrical perspective, the entire flower is negatively charged, while the veins in the petals are positively charged. The petals open via a pushrod that extends from the stem to the base. The pushrod is controlled by the motion of a small servo mechanism.

The small leaves on the side of the valve rod connect to a TTP223 touch sensor inside the base, creating a capacitive touchpad. The wooden base contains the servo, touch IC, and Arduino Nano. Let’s build one ourselves!

How to Make an Ever-Blooming Mechanical Tulip How to Make an Ever-Blooming Mechanical Tulip

2. Making the Petals (4 hours)

Let’s start with the most satisfying part – the blooming petals.

The first thing you need is a blooming mold. I used plaster to cast a tube mold. After drying, I shaped it into a tulip flower. You can also 3D print it, but I don’t have a 3D printer. Plaster is great because it’s easy to work with, and you can draw on it with a pencil.

Each petal is 1/4 of the template surface, so when they are all 6, they will slightly overlap, forming the precise appearance of a tulip flower.

I drew the petal shape on the plaster surface with a pencil. When I was satisfied with the petal shape, I carved it into the plaster with a knife to help secure the rod in place during welding.

The petals are made of 1mm brass rods, shaped around the form. Inside the petals are 5 1206 white LEDs and a “vein” structure from the same wire. First, create the circumferential wire, taking your time to bend it. Cut a small piece of tube and place it at the bottom flat part of the wire – this will be the hinge for the petals to move around.

Weld the ends of the wire together, making sure not to fill the tube with solder. It needs to move freely. Finish the petals with LEDs and vein structure. Watch me make a petal. Shame on me, this is the only shot I took of making this flower.

How to Make an Ever-Blooming Mechanical Tulip

Now make 5 more. All petals need to be exactly the same. This is really important. Otherwise, they won’t form a nice tulip shape when closed and may even get stuck.

How to Make an Ever-Blooming Mechanical Tulip

3. Assembling the Bloom (1 hour)

It’s time to weld all the petals together. The base of the flower is hexagonal – 6 petals. The petals are fixed to the hexagon via hinges. However, the hexagon is slightly irregular.

I failed many times. The petals need to overlap each other, and if the hexagon is regular, it won’t allow that. Three petals are close to the center (inner petals), and the other three petals are slightly offset (outer petals).

For this, I created a template and printed it on paper. The red shape is the final irregular hexagon made up of two nested regular hexagons. Weld all the hinges (tubes) to the hexagon.

The rays coming out from the center of the template will help you weld the petals into the correct position. The center of the petals needs to follow the rays coming out from the center of the hexagon. Finally, when you close the petals, you will have the final flower shape.

How to Make an Ever-Blooming Mechanical TulipHow to Make an Ever-Blooming Mechanical TulipHow to Make an Ever-Blooming Mechanical Tulip

How to Make an Ever-Blooming Mechanical Tulip

4. Making the Valve Rod and Push Rod (1 hour)

First, complete the mechanism inside the bloom, then add a rod and push rod. This adds a lot of pain to the making process. At one point, I almost wanted to throw it away and never look back. The movement of the petals is produced by a 1mm brass push rod moving freely inside the brass tube.

The petals connect to the push rod via a very small hexagon, with a hinge of 2mm long on each side – the push rod head. The hexagon sits vertically on the push rod, aided by a small rod passing through the center of the hexagon. This is a watchmaker’s job.

To make the push rod head, I created a second template. First, bend the wire to form a tiny hexagon. Then cut a small tube 2mm long and place it on the wire. Weld the wire to complete the hexagonal shape.

Again, ensure not to weld the tube to the wire. Continue welding the wire to the center of the hexagon. And complete the rod by welding a 1mm wire perpendicularly to the center of the push rod head.

How to Make an Ever-Blooming Mechanical Tulip

Cut the brass tube to the desired length. Now comes the second critical part. The stem needs to be completely vertical to the hexagonal base of the flower, needs to be in its exact center, and needs enough space for the push rod head to move down to close the petals. First, I welded two wires to one end of the valve rod to form a V-shape expansion. These will be 2 of the 6 wires connecting the rod to the vertices of the hexagonal base.

Thus, invert the flower and weld the V-shaped expansion to two opposite vertices of the hexagonal base. Check the shape. If you place the rod inside the rod, it needs to come out at the center of the flower. Take your time here to perfect it. This is truly a critical part. When you use it, weld 4 wires between the rest of the hexagonal top and the top of the rod. Ensure not to weld the holes inside the tube!

5. Petal Mechanism (6 hours)

I almost threw it in the trash. You have to nail it! For this part, I was inspired by steam engines and their rods, pistons, and flywheels.

How to Make an Ever-Blooming Mechanical Tulip

How to Make an Ever-Blooming Mechanical Tulip

Fix the flower in an upward position with the stem. Pass the push rod through the valve rod, with the head facing up. Weld a short tube perpendicularly to the bottom end of the push rod and make a small link with a 1mm brass wire to connect the servo and the push rod (see above). It should be able to use the servo to push the push rod up and down. Connect your Arduino and give it a try.

Before starting to weld the link between the petals and the push rod head, it is necessary to use Arduino to adjust the servo mechanism. Write code so that the push rod moves up and down to align with the topmost position of the blooming hexagonal base. At the lowest position, it is at the bottom of the blooming V-shaped base.

To make the push rod movement as smooth as possible, use the hole closest to the center of the servo arm. The servo needs to rotate longer but with a shorter step. When the push rod moves up, it pushes the link and petals down. As it moves down, it closes the link and petals.

The petals currently lack a critical component – the petal pin. This hinge allows the petals to move. The hinge is located on a rod (see below), which is welded to each petal parallel to its base. The petal pin needs to be above the surface of the petals so that it can be seen fully opening in the animation.

Make a rod like this with a tube hinge and weld it to the first petal. This will require a lot of experimentation with the size of the rod and its distance from the base of the petal to allow the push rod to fully open and close the petals. Use trial and error. Weld the rod into the correct position and add a link between the push rod pin and the petal pin.

If your push rod is in the upper position while your petals are fully open, the space between the push rod pin and the petal pin is the length of the link.

How to Make an Ever-Blooming Mechanical Tulip

How to Make an Ever-Blooming Mechanical Tulip

How to Make an Ever-Blooming Mechanical Tulip

Now try to push the push rod up and down to see what happens. If it works smoothly without any friction, the petals can close and open the flower you completed (with the first petal).

If not, try different lengths of the link or different positions of the rod.To complete the blooming, replicate the same rods and links on the remaining 5 petals. When the flower blooms, the 3 outer petals need to be slightly lower to allow them to overlap the inner petals when closed.

Finally, you should be able to close and open the flower. Don’t panic if you don’t get the perfect shape on the first try. It just means that all the petals are not exactly the same. A lot of fine-tuning may be required to create the perfect shape – the lengths of the links and positions of the rods may vary slightly.

6. Flower Core (1 hour)

Inside the blooming flower, I placed 7 LEDs to emit light from within. These LEDs only need to control a single DATA line and can be daisy-chained. I soldered 6 of them between two small hexagons (of course, another template).

The lower hexagon is grounded, and the upper part is positive voltage. Solder the appropriate NeoPixels leads to these hexagons. These LEDs are placed at a 45-degree angle to shine sideways.

To make it better, place the seventh LED in the center of the upper hexagon. Last but not least, connect DATA IN and OUT to create the daisy chain.

This structure requires two wires to reach the base – VCC and DATA. The ground is taken from the flower frame. Solder a 0.3 insulated copper wire to the upper ring for VCC and the second wire to the first LED in the daisy chain for DATA. These wires will eventually reach the base.

Make them at least 3 times the length of the stem. Before soldering, the ends of these wires need to be released from their transparent insulation layer. The heat won’t damage them. Use a knife to remove the insulation. You can now test the LEDs to ensure they are working properly. Handle these copper wires gently.

If you accidentally strip the insulation elsewhere, a short circuit could occur!

Place the pistil structure in the center of the flower. Slightly offset from the hexagonal base of the flower to leave enough space for the petal links. For me, it is 1 cm higher than the blooming hexagon.

Connect all the vertices with brass rods to form a solid structure. The flower is complete! Now test to see if the petals can still move freely.

How to Make an Ever-Blooming Mechanical Tulip

How to Make an Ever-Blooming Mechanical Tulip

7. Rooting (2 hours)

The petals and LEDs need power wires to light up. The entire flower sculpture will be a ground, but the RGB LEDs have 6 petals and 2 wires that need to connect to the Arduino on the base. For this, a 0.3mm thin copper wire with transparent insulation will be wound around the tube stem. The two wires for the LEDs have already been completed.

Solder the other 6 to the loose vein wires near each petal hinge and run the wires through the flower structure below the stem. Ensure not to bend these wires at sharp angles, as they may easily break.

Now gather all the wires near the top end of the valve rod and use a zip tie to secure them. Do not overtighten, allowing the wires to pass through. Now organize all the wires inside the bloom well.

Ensure that the petals can move freely and that the push rod does not collide with the wires. Are you done? Now tighten the zip tie.

How to Make an Ever-Blooming Mechanical Tulip

The wires now cannot control themselves as they run around the valve rod. You need to patiently and slowly wrap them around the stem. Tight and even. I spent at least an hour completing this step.

When you reach the end of the rod, place another zip tie to secure the wires there and use transparent strong glue to fix them in place. Be careful not to seal the tube with the push rod!

How to Make an Ever-Blooming Mechanical Tulip

The last missing wire is a ground wire. Solder another copper wire to the bottom end of the valve rod. You should end up with 9 wires coming out of the flower.

Now, it is wise to connect all the wires to the Arduino and test for any short circuits and that all the LEDs light up.

How to Make an Ever-Blooming Mechanical Tulip

How to Make an Ever-Blooming Mechanical Tulip

8. Making the Flower Pot (2 hours)

I want this flower to grow out of an artificial flower pot, which will also hide all the electronics. I used a piece of wood to shape it into a cylinder 4 cm high and 9 cm in diameter. I do not have a lathe, so I used a circular saw to cut the original shape and then used a pressure drill as a temporary lathe.

Then I carved a 2.5 cm deep and 7 cm diameter opening to fit the servo, Arduino Nano, and touch sensor IC. At the bottom, there is also a small opening to precisely install the Arduino Nano USB port to be able to connect the USB cable from the side.

How to Make an Ever-Blooming Mechanical Tulip

If you have a flower pot, you can drill a hole with a diameter of the flower stem in the place where the flower grows – possibly in the center. Try to fit your flower. Be careful with the wires. If you bend them at sharp angles, they will break.

Finally, I also added a large hole from the inside of the base to provide more space for the servo arm and link. You can make any shape of flower pot you like, just remember that you need to accommodate all the electronic devices.

How to Make an Ever-Blooming Mechanical TulipHow to Make an Ever-Blooming Mechanical Tulip

9. Touch Leaf Pad (1 hour)

The mechanical tulip needs some interactive element to allow people to bloom it. I chose the TTP223 touch sensor. But where to place a touchpad?

I decided to add a little leaf on the side of the stem, which makes the flower more natural and also serves as a capacitive touchpad. Touching it will trigger the TTP223 sensor and tell the Arduino to open the flower.

When you complete such a complex sculpture, this will be a piece of cake for you. Use the same technique as the petals to omit the LEDs. I also created a template for myself. Drill a small hole in the base near the rod hole to fix the leaf there.

If you do not want or cannot use a capacitive touch sensor, you can add a regular button on the base. It will do the same job.

10. Putting It Together (2 hours)

This is the final step of assembly! Are you nervous? Insert the flower stem back into the hole in the base. Now, this is an important step. Measure twice before cutting! Open the blooming flower. And cut the end of the push rod coming out from the valve rod flush with the valve rod.

Now, when you close the flower again, the push rod should pull out from the stem. Weld a short tube perpendicularly to the push rod. This will be the hinge for the link with the servo arm. When you release the flower and the rod, it should fully open because the tube will also act as a stop.

You can now glue the rod to the base. Ensure that the end of the valve rod tube is flush with the inside of the base to leave as much space as possible for the servo arm. I used strong glue again. Ensure not to glue the push rod to the valve rod. This will ruin your work!

Next, glue the leaf pad on. Be able to connect the leaf pad to the TTP223 touch sensor before you solder the copper wire to it.

How to Make an Ever-Blooming Mechanical Tulip

Invert the flower. Be careful around the sculpture not to break it now! What a waste that would be! First, place the servo in its final position. Its arm should already be ready from the test bench. Just find the best position to connect the link to the push rod where the servo arm can move freely inside the base.

To secure the servo system in place, I used a metal plate and two screws. I wanted to maintain flexibility in case of servo failure or placement errors. But if you are confident, you can glue it down.

If you have the TTP223 module, solder the wires to the original TTP223 module touch pad (the side where the components are). You need to scrape the protective silk mask to expose the copper layer. Stick the touch module.

How to Make an Ever-Blooming Mechanical Tulip

The last component to enter the base is the Arduino Nano itself as the brain of the tulip. Place it into the opening in the base so that it can connect to the computer and all other components:

  • Servo Data Line – D9
  • TTP223 Touch Sensor Data – D2 (using interrupt)
  • NeoPixel Data – A0 (any output pin can be used)
  • Petals – D3, D4, D5, D6, D10, D11 (any output pin can be used)
  • Flower Ground – GND
  • VCC Line – 5V
  • TTP223 Touch Sensor GND – GND
  • TTP223 Touch Sensor VCC – 5V
  • Servo GND – GND
  • Servo VCC – 5V

11. Coding (1 hour)

  1. #include <Adafruit_NeoPixel.h>#include <Adafruit_TiCoServo.h>#include "SoftPWM.h"#define NEOPIXEL_PIN A0#define TOUCH_SENSOR_PIN 2#define SERVO_PIN 9//#define SERVO_OPEN 1750#define SERVO_OPEN 1650#define SERVO_SAFE_MIDDLE 1000#define SERVO_CLOSED 775#define RED 0#define GREEN 1#define BLUE 2float currentRGB[] = {0, 0, 0};float changeRGB[] = {0, 0, 0};byte newRGB[] = {0, 0, 0};#define MODE_SLEEPING 0#define MODE_BLOOM 3#define MODE_BLOOMING 4#define MODE_BLOOMED 5#define MODE_FADE 6#define MODE_FADING 7#define MODE_FADED 8#define MODE_FALLINGASLEEP 9#define MODE_RAINBOW 90byte mode = MODE_FADED;byte petalPins[] = {3, 4, 5, 6, 10, 11};Adafruit_NeoPixel pixels = Adafruit_NeoPixel(7, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ400);Adafruit_TiCoServo servo;int servoChange = 1; // openint servoPosition = SERVO_SAFE_MIDDLE;void setup() {  Serial.begin(115200);  pixels.begin();  servo.attach(SERVO_PIN, SERVO_CLOSED, SERVO_OPEN);  pinMode(TOUCH_SENSOR_PIN, INPUT);  attachInterrupt(digitalPinToInterrupt(TOUCH_SENSOR_PIN), _touchISR, RISING);  randomSeed(analogRead(A7));  SoftPWMBegin();  pixelsUnifiedColor(pixels.Color(0, 0, 0));  //pixelsUnifiedColor(pixels.Color(255, 70, 0));  prepareCrossFade(140, 70, 0, 140);  servo.write(servoPosition);}int counter = 0;byte speed = 15;void loop() {  boolean done = true;  switch (mode) {    case MODE_BLOOM:      prepareCrossFadeBloom(500);      changeMode(MODE_BLOOMING);      break;      case MODE_BLOOMING:      done = crossFade() && done;      done = openPetals() && done;      done = petalsBloom(counter) && done;      if (done) {        changeMode(MODE_BLOOMED);      }      break;    case MODE_FADE:      //prepareCrossFade(0, 0, 0, 800);      changeMode(MODE_FADING);      break;    case MODE_FADING:      done = crossFade() && done;      done = closePetals() && done;      done = petalsFade(counter) && done;      if (done) {        changeMode(MODE_FADED);      }      break;    case MODE_FADED:      //prepareCrossFade(140, 70, 0, 140);      changeMode(MODE_FALLINGASLEEP);      break;    case MODE_FALLINGASLEEP:      done = crossFade() && done;      done = closePetals() && done;      if (done) {        changeMode(MODE_SLEEPING);      }      break;    case MODE_RAINBOW:      rainbow(counter);      break;  }  counter++;  delay(speed);}void changeMode(byte newMode) {  if (mode != newMode) {    mode = newMode;    counter = 0;  }}void _touchISR() {  if (mode == MODE_SLEEPING) {    changeMode(MODE_BLOOM);  }  else if (mode == MODE_BLOOMED) {    changeMode(MODE_FADE);  }}// petals animationsboolean petalsBloom(int j) {  if (j < 250) {    return false; // delay  }  if (j > 750) {    return true;  }  int val = (j - 250) / 2;  for (int i = 0; i < 6; i++) {    SoftPWMSet(petalPins, val);  }  return false;}boolean petalsFade(int j) {  if (j > 510) {    return true;  }  for (int i = 0; i < 6; i++) {    SoftPWMSet(petalPins, (510 - j) / 2);  }  return false;}// animationsvoid prepareCrossFadeBloom(unsigned int duration) {  byte color = random(0, 5);  switch (color) {    case 0: // white      prepareCrossFade(140, 140, 140, duration);      break;    case 1: // red      prepareCrossFade(140, 5, 0, duration);      break;    case 2: // blue      prepareCrossFade(30, 70, 170, duration);      break;    case 3: // pink      prepareCrossFade(140, 0, 70, duration);      break;    case 4: // orange      prepareCrossFade(255, 70, 0, duration);      break;  }}void rainbow(int j) {  uint16_t i;  byte num = pixels.numPixels() - 1;  pixels.setPixelColor(pixels.numPixels() - 1, 100, 100, 100);  for (i = 0; i < num; i++) {    pixels.setPixelColor(i, colorWheel(((i * 256 / num) + j) & 255));  }  pixels.show();}// servo functionboolean openPetals() {  if (servoPosition >= SERVO_OPEN) {    return true;  }  servoPosition ++;  servo.write(servoPosition);  return false;}n closePetals() {  if (servoPosition <= SERVO_CLOSED) {    return true;  }  servoPosition --;  servo.write(servoPosition);  return false;}// utility functionvoid pixelsUnifiedColor(uint32_t color) {  for (unsigned int i = 0; i < pixels.numPixels(); i++) {    pixels.setPixelColor(i, color);  }  pixels.show();}void prepareCrossFade(byte red, byte green, byte blue, unsigned int duration) {  float rchange = red - currentRGB[RED];  float gchange = green - currentRGB[GREEN];  float bchange = blue - currentRGB[BLUE];  changeRGB[RED] = rchange / (float) duration;  changeRGB[GREEN] = gchange / (float) duration;  changeRGB[BLUE] = bchange / (float) duration;  newRGB[RED] = red;  newRGB[GREEN] = green;  newRGB[BLUE] = blue;  Serial.print(newRGB[RED]);  Serial.print(" ");  Serial.print(newRGB[GREEN]);  Serial.print(" ");  Serial.print(newRGB[BLUE]);  Serial.print(" (");  Serial.print(changeRGB[RED]);  Serial.print(" ");  Serial.print(changeRGB[GREEN]);  Serial.print(" ");  Serial.print(changeRGB[BLUE]);  Serial.println(")");}boolean crossFade() {  if (currentRGB[RED] == newRGB[RED] && currentRGB[GREEN] == newRGB[GREEN] && currentRGB[BLUE] == newRGB[BLUE]) {    return true;  }  for (byte i = 0; i < 3; i++) {    if (changeRGB > 0 && currentRGB < newRGB) {      currentRGB = currentRGB + changeRGB;    }    else if (changeRGB < 0 && currentRGB > newRGB) {      currentRGB = currentRGB + changeRGB;    }    else {      currentRGB = newRGB;    }  }  pixelsUnifiedColor(pixels.Color(currentRGB[RED], currentRGB[GREEN], currentRGB[BLUE]));  /*    Serial.print(currentRGB[RED]);    Serial.print(" ");    Serial.print(currentRGB[GREEN]);    Serial.print(" ");    Serial.print(currentRGB[BLUE]);    Serial.println();  */  return false;}uint32_t colorWheel(byte wheelPos) {  // Input a value 0 to 255 to get a color value.  // The colours are a transition r - g - b - back to r.  wheelPos = 255 - wheelPos;  if (wheelPos < 85) {    return pixels.Color(255 - wheelPos * 3, 0, wheelPos * 3);  }  if (wheelPos < 170) {    wheelPos -= 85;    return pixels.Color(0, wheelPos * 3, 255 - wheelPos * 3);  }  wheelPos -= 170;  return pixels.Color(wheelPos * 3, 255 - wheelPos * 3, 0);}

/* Original author: jiripra/* Translation: Arduino_xy

/* Address: https://create.arduino.cc/projecthub/jiripraus/ever-blooming-mechanical-tulip-1b0323

-END-

Hello everyone, I am Zhang Qiaolong, a university teacher teaching electronics, welcome to follow!

Leave a Comment

×