"animatronic" Bug Exo-Spine
by TimoKolk in Craft > Costumes & Cosplay
453 Views, 1 Favorites, 0 Comments
"animatronic" Bug Exo-Spine
So here we have a school project of mine where we had to make something with an Arduino, and i somehow ended up with a bug exo-spine thing that moves its legs when you bend forewards...
Anyways here are the steps i took to make this, including some pain with broken parts.
Supplies
- Worbla.
- Foam.
- Ducktape.
- Clingwrap.
- Arduino Uno.
- Servo.
- Either a 3-pin Tilt Switch or an Accelerometer.
- Metal wire.
- Cardboard.
- Contact glue.
- Superglue.
- Rope or shoelaces.
- Elastic.
- Wristwatch straps.
The Gorget
- Follow the instructions from this video but for your neck and upper body.
- Copy the pattern onto the foam and then glue them together with contact glue. make sure to leave the back open so you can still take the piece on and off.
- cover the foam with Worbla and sculpt a design.
- glue the wristwatch straps onto the back so you can strap it closed.
The Spine, Internal
- Take some cardboard and draw the design for your spine.
- then construct the internal mechanism as shown in the pictures for each segment.
- at the bottom add an elastic band to make sure the mechanism returns to its starting position.
- cut the cardboard into its separate segments.
- Add Ducktape to the back to prevent excess movement.
The Spine, External
- Copy the shapes for the segments you drew on your cardboard and transfer them onto your Worbla at a slightly larger scale.
- sculpt the Worbla so there is room underneath for the mechanism.
- glue the Worbla onto the cardboard.
- make an upper segment without any cardboard with enough room underneath for your Arduino.
- add some rope to the bottom segment.
Arduino Option 1, Accelerometer
This is how I was initially going to do this project but my parts kept breaking. So I ended up going with Option 2, listed later.
Copy this code into your Arduino.
#include <Wire.h> // Wire library #include <Servo.h> // Servo library int ADXL345 = 0x53; // The ADXL345 sensor I2C address, included in tutorial float Z_out; // Data output Servo myservo; // Create servo void setup() { Serial.begin(9600); Wire.begin(); // Initiate the Wire library // Set ADXL345 in measuring mode Wire.beginTransmission(ADXL345); // Start communicating with the device Wire.write(0x2D); // Access/ talk to POWER_CTL Register - 0x2D // Enable measurement Wire.write(8); // (8dec -> 0000 1000 binary) Bit D3 High for measuring enable Wire.endTransmission(); // End transmision so it won't interfere myservo.attach(9); // Attaches the servo on pin 9 } void loop() { Wire.beginTransmission(ADXL345); // Start transmission again Wire.write(0x32); // Start with register 0x32 (ACCEL_XOUT_H) Wire.endTransmission(false); Wire.requestFrom(ADXL345, 6, true); // Read 6 registers total, each axis value is stored in 2 registers Z_out = ( Wire.read()| Wire.read() << 8); // Z-axis value Z_out = Z_out/32; // Divide value to make it more sensitive Serial.print("Za: "); Serial.println(Z_out); float y = map(abs(Z_out), 0, 12.8, 0, 120); myservo.write(y); // tell servo to go to position in variable 'pos' delay(4); // waits 15ms for the servo to reach the position }
Make sure you solder your wires.
Arduino Option 2, Tilt Switch
So because of broken parts I ended up going with this instead, works fine but is far less nuanced than the other option.
Copy this code into your Arduino.
/* Better Debouncer * * This debouncing circuit is more rugged, and will work with tilt switches! * * http://www.ladyada.net/learn/sensor/tilt.html */ #include <Servo.h> Servo myservo; // create servo object to control a servo int inPin = 2; // the number of the input pin int outPin = 13; // the number of the output pin int LEDstate = HIGH; // the current state of the output pin int reading; // the current reading from the input pin int previous = LOW; // the previous reading from the input pin // the following variables are long because the time, measured in miliseconds, // will quickly become a bigger number than can be stored in an int. long time = 0; // the last time the output pin was toggled long debounce = 50; // the debounce time, increase if the output flickers void setup() { pinMode(inPin, INPUT); digitalWrite(inPin, HIGH); // turn on the built in pull-up resistor pinMode(outPin, OUTPUT); myservo.attach(9); // attaches the servo on pin 9 to the servo object myservo.write(190); delay(15); } void loop() { int switchstate; reading = digitalRead(inPin); // If the switch changed, due to bounce or pressing... if (reading != previous) { // reset the debouncing timer time = millis(); } if ((millis() - time) > debounce) { // whatever the switch is at, its been there for a long time // so lets settle on it! switchstate = reading; // Now invert the output on the pin13 LED if (switchstate == HIGH) { LEDstate = LOW; myservo.write(190); delay(15); } else { LEDstate = HIGH; myservo.write(8 0); delay(15); } } digitalWrite(outPin, LEDstate); // Save the last reading so we keep a running tally previous = reading; }
Make sure you solder your wires.
Putting It Together
- make a flat version of your upper segment.
- glue your Arduino onto it
- layer your Gorget, Arduino panel, and the upper segment on top of each other.
- punch 4 holes through them.
- string your rope through the holes.
- attach your top piece of spine mechanism to your servo.
- attach the rope from the bottom piece of the spine to a belt or pants so the whole construction stays in place when the servo moves.
- paint your parts however you want.
You Did It, Now Go Celebrate
- Get yourself a cake or something.
- Eat it.