Scissor Drive Servo Hat

2,088

13

1

About: Making and sharing are my two biggest passions! In total I've published hundreds of tutorials about everything from microcontrollers to knitting. I'm a New York City motorcyclist and unrepentant dog mom. My ...

Intro: Scissor Drive Servo Hat

This simple 3D printing and servo motor project is a get-well sentiment for Simone Giertz, an awesome maker who just had brain tumor removal surgery. The scissor device is drive by a micro servo motor and Trinket microcontroller running a little Arduino code, and is powered by a 3xAAA battery pack. This project is a collaboration with Leslie Birch!

I modeled the base plate and motor mount using Tinkercad, a free and easy 3D modeling tool, which has a panel of common electronics components built-in. I was able to drag out a micro servo and then model the base to fit around it, and see where it would line up with the scissor mechanism.

The scissor snake was designed by ricswika on Thingiverse, and it was easy to bring it into Tinkercad and modify the handle and gripper ends to fit together with our base piece.

For this project, you will need:

Find this circuit on Tinkercad

The is diagram and simulation shows the Trinket's Attiny85 microcontroller, battery, and servo. Click Start Simulation to run the code and see the servo spin.

Tinkercad Circuits is a free browser-based program that lets you build and simulate circuits. It's perfect for learning, teaching, and prototyping.

Step 1: Tinkercad Model

I uploaded the basic scissor snake model into Tinkercad, then modified it by dragging out a hole shape from the side panel and shaping them to cover each handle and the grippers at the end, then grouping the holes with the original shape. I then went on to create new tabs on the base ends and holes for attaching the plastic golf ball as well as to the base/servo.

The base piece was modeled from scratch using Tinkercad's built-in circuit components. I dragged out a micro servo motor from the electronics components panel and modeled around it, creating an interface for securing the motor and attaching the scissor snake. I also put some holes in the base for sewing it onto the hat.

You can copy this Tinkercad design and export each piece for printing yourself. The vertical scissor snake is for demonstration purposes-- don't attempt to print this duplicate part. =D

Step 2: Assemble 3D & Servo Mechanism

We used stiff steel wire to link up the fixed side of the scissor snake to the base and the moving part to the servo. After bending an angle in a small piece of the wire, we used jewelry beads and a dab of hot glue to secure the other ends of our "axles". The servo motor itself is held in place with more of the same wire and a little hot glue. We had to do some experimentation with the positioning of the servo horn to allow its range of motion to overlap with that of the scissor snake.

Step 3: Circuit and Arduino Code

The circuit connections are as follows:

  • Trinket BAT+ to servo motor power
  • Trinket GND to servo motor ground
  • Trinket pin #0 to servo motor signal
  • 3xAAA battery pack power (red wire) to Trinket BAT+ (on underside of board)
  • 3xAAA battery pack ground (black wire) to Trinket GND (on underside of board)

The Arduino code for this project is based off of the SoftServo example in the Trinket Servo tutorial. You'll need to install the SoftServo library in order to use it, which you can do by searching in the Library Manager (Sketch -> Include Libraries -> Manage Libraries...). For more info on installing and using code libraries in Arduino, check out my free Instructables Arduino class, lesson 4.

/*******************************************************************
  SoftServo sketch for Adafruit Trinket.
  (0 = zero degrees, full = 180 degrees)
 
  Required library is the Adafruit_SoftServo library
  available at <a href="https://github.com/adafruit/Adafruit_SoftServo"> https://github.com/adafruit/Adafruit_SoftServo
</a>
  The standard Arduino IDE servo library will not work with 8 bit
  AVR microcontrollers like Trinket and Gemma due to differences
  in available timer hardware and programming. We simply refresh
  by piggy-backing on the timer0 millis() counter
 
  Required hardware includes an Adafruit Trinket microcontroller
  a servo motor
 
  As written, this is specifically for the Trinket although it should
  be Gemma or other boards (Arduino Uno, etc.) with proper pin mappings
 
  Trinket:        BAT+   Gnd   Pin #0  
  Connection:     Servo+  -    Servo1
 
 *******************************************************************/

#include <Adafruit_SoftServo.h>  // SoftwareServo (works on non PWM pins)

// We demonstrate two servos!
#define SERVO1PIN 0   // Servo control line (orange) on Trinket Pin #0
int pos = 40;    // variable to store the servo position 
Adafruit_SoftServo myServo1;  //create servo object
   
void setup() {
  // Set up the interrupt that will refresh the servo for us automagically
  OCR0A = 0xAF;            // any number is OK
  TIMSK |= _BV(OCIE0A);    // Turn on the compare interrupt (below!)
  
  myServo1.attach(SERVO1PIN);   // Attach the servo to pin 0 on Trinket
  myServo1.write(pos);           // Tell servo to go to position per quirk
  delay(15);                    // Wait 15ms for the servo to reach the position
}

void loop()  {
  for(pos = 40; pos <= 180; pos += 3) // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myServo1.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 180; pos>=40; pos-=3)     // goes from 180 degrees to 0 degrees 
  {                                
    myServo1.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  }
}

// We'll take advantage of the built in millis() timer that goes off
// to keep track of time, and refresh the servo every 20 milliseconds
volatile uint8_t counter = 0;
SIGNAL(TIMER0_COMPA_vect) {
  // this gets called every 2 milliseconds
  counter += 2;
  // every 20 milliseconds, refresh the servos!
  if (counter >= 20) {
    counter = 0;
    myServo1.refresh();
  }
}

Step 4: Wear It!

We sewed the base to the band of a derby hat, behind the flower. Leslie customized the flower with more fabric as well as added the green hand to the hat to tie the color scheme together.

Best wishes for a speedy recovery, Simone! We all love you and you got this.

Share

    Recommendations

    • Audio Contest 2018

      Audio Contest 2018
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge
    • Plastics Contest

      Plastics Contest

    Discussions

    0
    None
    Aracuan

    4 months ago

    This reminds me of the mechanism within the hat of one of Sir Terry Pratchetts witches. It folds down in stealth mode and extends into the traditional pointy form with a lot of weird noises.
    Boi-oi-oi-oi-oing included. Thanks for the great 'ible.