Mechanical Dragon (Arduino + Automata)
465 Views, 2 Favorites, 0 Comments
Mechanical Dragon (Arduino + Automata)
For my school assignment, I needed to work with an Arduino but I don't have the word "easy" in my dictionary so I decided to also add automata to it, keep in mind I have never done any of that before. Also instead of working with a laser-cut, I decided to use the wood workplace without any previous experience.
The end result is a moving leviathan using automata that with the help of an input of a light sensor, that is linked with a servo, swims!
Supplies
Wood, metal wire, wood glue, 1 thin 1 thick pliers, scissors, pencil, arduino, resistance 2 x 330 ohm, jumper wire 20x, photosensitive resistor, 2 led lamps, USB cable, SG90 mini servo, aluminium, paper, pencil, clay, acrylic paint, wool.
Research
Look around the internet, Instructables, youtube, and Pinterest for inspiration. My eye caught onto automata, it looked so easy in the videos so I had decided I could do it myself as well. It's something I never worked with and I knew it would be quite a bit of trial and error to figure it out. I used youtube videos of end results to determine how and what I wanted to make. I had not looked up anything online concerning automata, I wanted to learn it myself.
Sketch
Time to sketch the idea! envision what you want to make, and make sure it's readable so you can ask for help from the teacher.
My concept is to make a swimming dragon towards some coins because dragons are sure as hell as hoarders And you see I am quite a fan of dragons, I always was and I am sure some of you can relate. So I decided to think up an idea on how to incorporate it into my design. It will be a hard path ahead but at least I can lessen it with my personal interest. My idea is to make a leviathan, that's a sea dragon that finds a treasure chest with a coin and swims toward it, the photosensitive resistor (light sensor) will be the trigger. You use a coin to make it dark and then the dragon sees something shiny and swims towards it. That's when the servo starts spinning so the automata starts to work and the dragon moves. This idea can be used in the future as a bank/save for money, you see kids like dragons a swell
Write Code + Test Out With Arduino to See If It Works
Write the code and plug everything into the Arduino.
Code with an explanation of what each part does
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = A0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int pos = 0; // variable to store the servo position
int treshold = 400; //Beginning of the light switch (bright) the higher it is the easier it is, the less darkness it needs to work
int ledpin1 = 13;
int ledpin2 = 12;
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
//red_led
pinMode(ledpin1, OUTPUT);
//green_led
pinMode(ledpin2, OUTPUT);
}
void loop() {
int LDRval = analogRead(potpin);
if (LDRval < treshold) {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
for (pos = 30; pos <= 140; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'int pos= 0'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 140; pos >= 30; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
}
delay(1);
}
Schematics of the Electronica
Here is the schematics of the electronica
Downloads
Wood Base
I went to the woodwork area at my school, the first time I worked there so I was accompanied by the overseer each step of the way. I made sure the holes were evenly spread apart by measuring them with a ruler, then drilling holes. Using a weird machine to make indents into all the sides and I had a little oval piece of wood to wedge in between, I also used some wood glue to glue it together.
Make the Leviathan (aka the Movable Item)
Here you can see pictures of the body. The first one is iteration 1, a paper mache body that I made with water and flour. It was very sticky and very heavy, and hard to mould. Once it dried it was lighter than the starting weight but I decided to go with aluminium because you can shape it easier and it's just as light. I decided to first make the leviathan and then cut it in three pieces because then you will have a cleaner cut and it will look like it's been one before instead of 3 different pieces trying to fit together.
Begin Testing the Automata
Add wires to the box that we made. Test out the automata by checking if it actually spins, and that the wires stay in approximately the same space, because if they slip the whole thing won't work.
I did not know that bending the wires in a slightly different way can destroy the whole movement by jamming or needing excess strength for it to move. You can see in the first picture is iteration 2, and second picture iteration 3, and in the video iteration 4 of me moving the wires into different positions because it just did not work or it looked bad. As you can see in the "NOT smooth video" after a couple of hours of adjusting everything, every bend, every distance. To make it "smooth"
If you take a look at the third video, the test with the head weight I also changed the shape of the middle wire, before they were not even distance from each other, the wires had to be bent sideways, which adds extra weight on a core, its best to distribute it, also makes the wire longer which makes things more wobbly and also makes it harder to move the piece, the longer the wire the harder it will be.
Body Modification
After testing the body on the automata, it was too heavy to move and the weight distribution was off, the torso and the tail were too big, so I first cut them to size. Tested again, still too heavy, so I decided to re-make the torso and cut the tail so everything would be the same size at the head. I always use a thin layer of clay above the aluminium so it would weigh it down as little as possible.
Combining the Automata With Arduino
I taped some wool to the three-part body of the leviathan because it will be held together by wool so it won't swing away from each other and ensure smoother motion.
Now that I put everything together I need to match the servo with the automata handle. That was a bit of a challenge because I seem to be blocking the full range of movement each time, after some twists and turns (literally, I had to bend the wire) it came together.
The body does not align and it bends towards all kinds of sides, so I cut the wire to make it even at the beginning because later they are meant to be uneven to indicate movement. and made sure the wires aligned as well.
Wood Cutting
The project needs to look presentable, and a couple of boxes aren't going to cut it so it's time to go to the woodwork area and cut and sand all the tiny items. I could've done it with the laser cutter as well but I know how that works. Also it looks bland and boring. I wanted to learn more about how to work by hand with wood.
I started off with sketches on some leftover wood, there is a load of it, and mostly no need to buy new wood unless you want to make furniture. We have a sea dragon, a leviathan so it's fitting that the setting would be underwater/sea. I Cut out sea creatures such as fish, octopi, starfish, sea snakes, sea snails, a clam, and some coral. Working with such small, precise, and delicate wood pieces is dangerous with the big machines, thank goodness I have longer nails than my finger because if I cut into my finger I can feel some vibrations of the nail and I can react before it actually cuts me. Basically don't work with small things again, use the laser cutter. But I have already started so I must continue.
I made waves for the top and sand for the bottom of the automata. I made a box to hide the soldering and Arduino. I thought of stacking the box and the sea dragon but then the dragon could not swim towards the gold coin. Because that's what he's after and triggers the whole mechanism so it's in front of it.
Iteration 5 I originally planned to add crepe paper to cover the automata but scrapped that in the end because I liked to see the mechanism. The assignment said that you aren't allowed to see the Arduino part but nothing about the automata so I thought it to be a lovely compromise.
Iteration 6, I tried out 2 different layouts, the one that was stacked upon each other wouldn't make sense with the design so I scrapped it.
Solder
Solder everything in the exact same order as the bread board.
I have made a sketch for myself of which pins go where before I start soldering so I can double-check where it needs to go. and I am happy I did because I made quite a couple of mistakes but I could always check and fix it before it was a permanent mistake.
Putting My Project Together
Glueing and nailing everything together.
Finished Result
Here's the final result of my project! I'm very proud of it, I had not seen other classmates make such a contraption.
(Click the download button below for the video)
Reflection
My thoughts during this whole process were mostly
"Why did I make it hard while some others had it easier and can even get a better grade than me"
But hey, that is life. I enjoyed making it even with all the hiccups along the way. I challenged myself with making something new and something made by hand, I am saddened by the lack of feedback on my project. I would've liked to hear more than "it alright" from the teachers. I want to know what is going through their minds and improve upon that. I want to hear that I messed up like I always do and know where I had shortcomings to fill those up for the next project.
I am amazed at what other people made in my year as well, every idea was very unique which brought me more ideas for the future.
The moral of the assignment is that I'm happy I made something that I had a hard time with. I used my ETCCP knowledge that I got just this year and challenged myself with a new medium, wood. At least it wasn't some boring assignment where I already did things I knew before and I see myself working with gears and automata, but this time I'll look up online how the gears are made instead of trying to invent them myself and figure it all out from scratch.