Arduino Powered Wearable Tail
by lovronix in Circuits > Wearables
2357 Views, 11 Favorites, 0 Comments
Arduino Powered Wearable Tail
One day I saw my daughter running around with a jump rope around her hip pretending that she is a pony and that she has a tail. Soon after that I got an idea to make a controlable tail that swings on command.
Components
For this project I needed:
1. Old belt (i used old army belt because of easy size adaptation)
2. Arduino nano
3. Slider potentiometar (first idea was rotary potentiometer, but I had this one laying around so...)
4. Servo motor
5. Battery (I used two 3,7V 2,6Ah in serial connection)
6. Various cables (lying around in garage)
7. Some decorative strings (use any suitable material)
8. Green (or any) LED
9. Resistor
10. 3D printer (optional), or any suitable cases for the components.
Connecting Components
First I soldered Arduino on prototype board and connected Ground and Vin from the battery pack (without batteries). After that I connected LED to resistor to pin 4 and to Ground, Servo to Vin (because it didn't work well on 5V pin), Ground and pin 9, and at the end I connected Slide potentiometer to A2, 5V and Ground.
Check schematics.
Code and Testing
Arduino code is simple. It reads the slider's data and accordingly rotates servo motor and controles the LED.
#include <Servo.h> Servo myservo; int readA2; int led = 4; void setup() { myservo.attach(9); myservo.write(90); pinMode(A2, INPUT); pinMode (led, OUTPUT); digitalWrite (led, HIGH); } void loop() { readA2 = analogRead(A2); int rep = map (readA2, 0, 1023, 0, 10); // transforming 0 - 1023 values to 0-10 switch (rep) // 0 means stop, 10 is fastest moving of the tail { case 0: { stani(); break; } case 1: { mahanje(1000); break; } case 2: { mahanje(900); break; } case 3: { mahanje(850); break; } case 4: { mahanje(800); break; } case 5: { mahanje(750); break; } case 6: { mahanje(700); break; } case 7: { mahanje(500); break; } case 8: { mahanje(400); break; } case 9: { mahanje(300); break; } case 10: { mahanje(250); break; } } } // moving the tail void mahanje(int brzina) { myservo.write(20); delay(brzina); myservo.write(160); delay(brzina); } void stani() { myservo.write(90); }
Downloads
3D Printing
Before printing I had to draw the desired design of the boxes that are going to be attached to the belt. I used Fusion 360. There are some great lessons here on the Instructables where I learned how to work in Autodesk Fusion 360.
Here are the links:
- https://www.instructables.com/class/3D-Design-Class/
- https://www.instructables.com/class/Beginner-3D-Printing-Class/
- https://www.instructables.com/class/Intermediate-3D-Printing-Class/
- https://www.instructables.com/class/Advanced-3D-Printing-Class/
After creating everything in Fusion 360, I have exported each file to Slic3r Prusa Edition and then saved it as gCode file, no support, 30% infill, infill overlap 75%, brim 5mm, flow 60% (3D printing settings can vary from printer to printer), and printed in on Vertex K8400 printer with PLA.
Finishing and Testing
After printing, I had to put all the components together (mind the length of the cables), and test it. After first successful test, I have glued the strings to servo and attached the components to the belt.
That was that.
This is my first instructable. All comments are welcome.