Introduction: Automated Cigar Cutter

Picture of Automated Cigar Cutter

This instructable will provide you with the necessary part files, Arduino sketches and instructions to replicate my project. This project was created for the MAKE Course at the University of South Florida. To see other's projects please visit makecourse.com

Note: This instructable assumes you are of age in your area to partake of tobacco products, if you are not of age please continue to browse Instructables to find a more appropriate project.

The YouTube Video is the final video presentation of this project for my class. It also covers the functioning portions of this project along with a final demonstration.

Step 1: Gather Materials

Picture of Gather Materials

To replicate my project you will need to purchase the following parts listed below. You will also need to 3D print the parts listed.

1. Arduino

2. Jumper wires

3. 4 - AA battery pack or a decent 5V power supply

4. 3 - Servos

5. Small breadboard

6. DC-47P DC Series Heavy Duty Electronics Enclosure

7. 3D Print an Enclosure Lid

8. 3D Print a Cigar Holder

9. Double Guillotine Cigar Cutter

10. Capacitive Touch Sensor

11. 1/2 inch safety toggle switch

12. Zip-ties

I have included the .STL and .IPT files of the two 3D printed components. .IPT is and Autodesk Inventor part file.

Step 2: Some Assembly Required

Picture of Some Assembly Required

Assembling the device is quite simple. First off you will need to complete the wiring shown in the Fritzing Diagram. NOTE: I elected to use an Arduino Micro but an Uno would use the same pins. Be sure on other micro controllers that pins 3, 5 and 6 have PWM capabilities for this device to perform properly.

Having these wired up you will need to place the Arduino, Cigar Servo and Breadboard into the bottom of your electronics enclosure.

The Cigar Servo will require a way of mounting it stationary centered underneath the square cut out of the lid. I used the optional shelf for the electronics box and used zip ties to secure the servo to holes that I drilled. There are many ways to achieve this stationary hold. The servo will need the long arm and will need a small screw threaded into the last small hole. This screw will slide up and down the groove on the cigar tray to enable the servo to transport the cigar.

Step 3: Moving on to the Lid

The lid will need the remaining two servos to pop up into place. You will also need to mount the safety switch as well as the capacitive touch sensor. Having these items secured to the lid we will need to test all the electronics before closing the box up.

I suggest using the sweeping servo code on your Arduino with the exception of adding in all three servos and setting the correct pin numbers.

The following is the test code that I used.

/* Sweep
by BARRAGAN
This example code is in the public domain.

modified 8 Nov 2013

by Scott Fitzgerald http://arduino.cc/en/Tutorial/Sweep */

#include

Servo myservoa, myservob, myservoc; // create servo objects to control servos

// twelve servo objects can be created on most boards

int pos = 0; // variable to store the servo position


void setup() {

myservoa.attach(3); // attaches the first servo on pin 3 to the servo object

myservob.attach(5); // attaches the second servo on pin 5 to the servo object

myservoc.attach(6); // attaches the last servo on pin 6 to the servo object

}


void loop() {

for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree

myservoa.write(pos); // tell servoa to go to position in variable 'pos'

myservob.write(pos); // tell servob to go to pos

myservoc.write(pos); // tell servoc to go to pos

delay(15); // waits 15ms for the servo to reach the position

}

for(pos = 180; pos>=0; pos-=1) // goes from 180 degrees to 0 degrees {

myservoa.write(pos); // tell servoa to go to position in variable 'pos'

myservob.write(pos); // tell servob to go to pos

myservoc.write(pos); // tell servoc to go to pos

delay(15); // waits 15ms for the servo to reach the position

}

}

Step 4: Uploading the Cigar Cutter Source Code

Now that we are sure that we have our breadboard wired correctly and that all of our servos are functioning and are we will upload the projects source code. Below I have the Source code shown and commented explaining its functions.

/*******************************************************

PURPOSE: Light-A-Bull MAKE Course Project

Created by Karl Lewis

DATE: 11/2014

*******************************************************/

/****************************************************************************************************************************

Here I will use the #define function to assign a recognizable variable to pins on the Arduino. This define feature will make an easier recognition of what each function is doing. Without this all functions would be read off of by pin numbers which is less recognizable and require referring to what is connected to that pin.

****************************************************************************************************************************/

#include //Includes the servo library included with the Arduino IDE

//These are my Servos

Servo left, right, transport; //left will be on the left side of the cutter, right on the right, and transport moves the cigar

#define switchPin 13 //this define function will allow me to place 'switchPin' in code instead of 13

#define debounceTime 200

long time;

int lpos = 0; //defining integers to be used with the servos

int rpos = 55;

int cpos = 0;

void setup(){

left.attach(5); //the left servo will be controled by pin 5

right.attach(6); //the right servo will be controled by pin 6

transport.attach(3); //the servo moving the cigar will be controlled by pin 3

pinMode(switchPin, INPUT); //this will set the switchPin up as an input

}


void loop(){

left.write(lpos); //this will make the left servo's angle equal the integer lpos

right.write(rpos); //likewise this will equal integer rpos

transport.write(cpos); //and this will be the integer cpos


if (readSwitch(debounceTime) == true){ //If loop starts the devices functions when the input reads LOW

delay(1000);

//First we will open the cigar cutters by using a for function

//I was unable to come up with a clever method to move both servos simultaneously so I move halfway

//with each and then the other half.

for(lpos = 0; lpos <= 30; lpos+= 1){ //half of left's movement

left.write(lpos);

delay(15);

}

for(rpos = 55; rpos >= 25; rpos -= 1){ //half of left's movement

right.write(rpos);

delay(15);

}

//Second half of movement

for(lpos = 30; lpos <= 65; lpos+= 1){ //secong half of left's movement

left.write(lpos);

delay(15);

}

for(rpos = 25; rpos >= 0; rpos -= 1){ //second half of right's movement

right.write(rpos);

delay(15);

}

delay(2000);

//Now we tansport the cigar into position to cut

for(cpos = 0; cpos <= 90; cpos += 1){

transport.write(cpos);

delay(15);

}

//This will now cut the cigar using the left and right servos

for(lpos = 65; lpos >= 30; lpos -= 1){ //First half of left

left.write(lpos);

delay(15);

}

for(rpos = 0; rpos <= 25; rpos += 1){ //First half of right

right.write(rpos);

delay(15);

}

//Second half of movement

for(lpos = 30; lpos >= 0; lpos -= 1){ //Second half of left

left.write(lpos);

delay(15);

}

for(rpos = 25; rpos <= 55; rpos += 1){ //Second half of right

right.write(rpos);

delay(15);

}

delay(2000);

//Now the cigar will return to the home position

for(cpos = 90; cpos >= 0; cpos -=1){

transport.write(cpos);

delay(15);

}

}

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

New Tab Labeled Functions

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


/****************************************************************************************************************************

This portion is used to read my input switch(capacative touch) to activate the circuit. I found that the touch pad operates identically to a mechanical input switch so I have left this debounce process on this input.

****************************************************************************************************************************/


byte readSwitch(long debounce){ //The debounce variable is defined on main page

static long lastTime; //New variable called lastTime, it represents the last time the switch was active

static byte previousState; //New variable called previousState represents the previous state of the input

byte currentState = digitalRead(switchPin); //New variable currentState which will use a digital read of input

if (currentState == LOW && previousState == HIGH && millis()-lastTime > debounce){ //If my input pin just went from high to low and its been longer than the bounce time then

lastTime=millis(); //This sets lastTime to the last time and resets the debounce timer previousState = LOW; //Set previousState to LOW

return(true); //Returning true or 1 signifies an input has in fact occurred. //This returned 'true' value is used to activate the if statement on the previous page

}


else{ //If the 'if' statement was not met it will perform the tasks in the 'else' statement

//NOTE: 'elseif(){} will create a secondary if statement to preform, with 'else' it will be performed // if the 'if' doesn't.

previousState=HIGH; //Set the previousState to HIGH

return(false); //Return 'false' which will indicate that the switch was not pressed

}

}

Step 5: Testing Setup Again

Picture of Testing Setup Again

Before adding the cutter it is a good idea to make sure that your setup will function as desired. Once the Arduino is programmed add the external power source for the servos to function on. On power up the device should move all three servos to their 'home' position. After getting there they should not make any movement.

Once you verify this place a finger over the capacitive sensor. This should activate the project! If all has been wired correctly the two servos on the lid should adjust move away from the center. (CCW for the left one and CW for the right one). Then the cigar transport servo should move forwards. Now the two on the lid will return to their home/cut position. Finally the cigar servo will return to home.

At this point we want to make sure all of our servos are turning in the correct direction. Looking at my cigar transport servo, this motor should turn CCW staring down on the gear for 'moving forwards' and CW when 'moving backwards.'

Step 6: Placing Arms on the Servos

Picture of Placing Arms on the Servos

After verifying that the servos are turning in the direction that we need, we will add the arms to the servos. To do this we will first power up our device. The servos will now go to the 'home' position, once they are there power down the device.

For the cigar transport you will want the arm to be leaning backwards at about a 45-55 degree angle from the shelf that the servo is attached to. As mentioned before you will need a long arm, my servo didn't come with one so I used a secondary arm and attached them together using single strand copper wire. In the image above my servo is in the 'cut' position so it will be leaning the opposite direction for home.

Now to add the cigar cutter, I again used zip ties and drilled holes through the lid to mount it down. After securing it centered on the lid we will add the servo arms. Here I had long arms for my servos so I used them. Having the cutter completely closed we want to add our arms so they will be applying pressure in this position. Find the closest match for the arm to fit the servos, then twist the motors slightly away from the center as if you were opening the cutters. Now move the arm one more notch towards the center on the servo head. Fasten the arm with a screw.

Now when you power up the device you should have the cigar tray pull back and the cutter being firmly held shut.

Step 7: Your Finished!

Picture of Your Finished!

With that the device should be ready to function. Place a cigar on the tray, any distance extending past the end of the tray should be considered gone once the device has been activated. Flip on the toggle switch and then activate the device via the capacitive sensor. The functioning device should operate like this.

Note: BE CAREFUL! The cigar cutter is sharp and if you decide to stick your finger inside of it you are going to have a bad day!

Comments

bubbastich (author)2014-12-18

couldn't find the video of this in action.

johnr7154 (author)2014-12-13

I love the designs made using 3D printer!

kakashibatosi (author)2014-12-13

PUT A GINGERBREAD MAN ON IT! Gingerbread man guillatine. Merry christmas!

peppypickle (author)2014-12-12

too cool! such a great concept! wonderful job on this Instructable!

About This Instructable

4,195views

49favorites

More by krlewis:Automated Cigar Cutter
Add instructable to: