This is my first arduino project what I made for a HKU schoolproject Games and Interaction
If you follow these steps you can make one yourself!
Step 1: What Do You Need
For the technical part:
-Arduino (I used a UNO)
-Two servo SG-90
-HC-SR04 Ultrasonic sensor
-Styrofoam egg 20 cm (in 2 pieces)
-Felt (Depends on the size how much you need I used 20x30cm felt)
-Green felt (5x)
-Pink/ red felt (2x)
-White felt (1x)
-Glue (I used a glue that dried invisible and is usable for any typ of materials)
-Wood stick (+- 30cm in length make sure it's thick enough to hold a servo motor)
Step 2: Software
- Download the arduino software: http://arduino.cc/en/Main/Software
Step 3: Connect It All Together
Step 4: Write the Code
With this code your hc-sr04 ultrasonic sensor will measure the distance and will transform it into distance in CM.
When there is a movement detected in a range of 15 cm it will tell the servo's to turn for 35 degrees so your plant will make a bite movement. You'll also get a small delay of 10 seconds after biting so the mounth of the plant won't open immediately. You can change the code if you want a other reaction from your plant.
-Connect your Arduino to your computer via USB.
-Open the Arduino Software.You have to identify your arduino in the software; do this under Tools - Serial Ports to specify the port in which your Arduino is inserted.
-Select your Arduino model under Tools - Board.Upload the code to your Arduino
Step 5: Build It Yourself!
Start with your frame I used a small cross frame so my stick can stand on his own use whatever you want so it can stand and won't fall
1.Saw 2 holes (the size of your servo) in the upper part of our woodstick so you can hide them
make sure that you place the first servo mirrored from the other servo and that his movement is going UP.
Put you other servo in the second hole and check of the movement from this servo is going DOWN
If your servo won't move like this you'll never get any bite movements!
If the position of the servo's are correct you can easy tape them to the stick so they won't move anymore.
2. Now you can start to make the plant his head.
Glue your green felt on your styrofoam egg. My felt wasn't big enough so I used 2 pieces of felt for 1 side of the egg. When your egg is green from the outside cut the felt for like 2 cm from the edge. Fold and glue it in the hollow side of the egg and try to get this as smooth as possible.
3. Use a thin piece of cardboard (I used a cereal box for this) and cut it in the form of your egg try to fit this in the inside of the egg as best as possible make 2 of them and cover it with the pink/red felt.
When this is ready and dry make a row of teeths like 3 cm high and glue it on the edge of the pink felt.
4. Glue your 'ínside' mouth in your egg so you get 2 pieces of mouth
5. Place a hard square piece of plastic on your servo (I used a glue gun for this) make a incision the side of the square in the backside of your egg. Make sure you can't make this incision in the middle of your egg because then your pieces won't fit together. Just hold your egg in the middle of the stick and found out yourself where you have to make your incison. Then gently push your egg with the incison on the plastic square.
6. You can use some green strokes of felt and wrap it around your stick ou can hide your cables inside.
7. Place your sensor infront of your plant if you have some leftover green felt you can hide your sensor make sure the front of your sensor is visible or it won't work.