Thursday, December 11, 2014

Final Assembly Time!

We finally put together the acrylic prototype. There are a couple photos below, and one of the glue being dried. 

Assembly for this one was a lot tougher than the cardboard one. It all started with the models being laser cut out of acrylic. Mentioned on one of the posts below, a piece of acrylic cracked during assembly. Ended up using a makeshift soldering iron (Pliers and a nail) and a lighter to fix the problem. After that, it was discovered the sides did not snap together as nicely as with the cardboard. One side worked perfectly, but the other side needed something to hold it. The solution in this case was to use glue to hold the tab in place. One of the pictures below shows a hairdryer being used to speed up the process. Once the sides were put together, the servo had to be put in place. Since we couldn't mount it under the platform as we did for the cardboard, it was mounted on top. There was no good way to mount it, and it ended up being taped into place. It's a little ugly, but works. The rubber band was fed through the hole cut out in the front corners and tied into place. The band is held by multiple knots on each side, to prevent it form slipping back through. The band is stretched back around the bottom of the servo. When triggered by the code, the servo will turn forward, releasing the band and shooting a projectile. 

During testing, it was found that the best projectile, that we could find at least, was a guitar pick. It offered the best consistency and distance, while not being large enough to potentially harm the sleeping person. Among other objects tested were rubber band balls, cardboard tubes, pens, bottle caps, and a few others. Overall, the design worked well enough. 





Below is the final code used. It operates the servo and the LCD. It's the same servo code as before, but modified in order to show the time for the cycle. In all our testing we used fifteen seconds, but as an actual alarm clock it would be much longer. You can change the display with the " lcd.print("Fifteen Second"); // Fifteen Charachter Max" under the void setup. Note: The display can only do up to fifteen characters. 

#include <Servo.h>
#include <LiquidCrystal.h>
Servo servo1;  // servo control object
int led = 9;
int fiveseconds = 5000;
int fifteenseconds = 15000;
int thirtyseconds = 30000;
int oneminute = 60000;
int tenminutes = 600000;
int thirtyminutes = 1800000;
int onehour = 3600000;
int onehourthirtyminutes = 5400000;
int twohour = 7200000;
int twohourthirtyminutes = 9000000;
int threehours = 1800000000;
int threehourthirtyminutes = 36000000;
int fourhours = 54000000;
int fourhourthirtyminutes = 72000000;
int fivehours = 90000000;
LiquidCrystal lcd(12,11,5,4,3,2);

void setup () 
{
  servo1.attach(9);
  lcd.begin(16, 2);
  lcd.clear();
  lcd.print("Fifteen Second"); // Fifteen Charachter Max
}

void loop() {
  
  lcd.setCursor(0,1);
  lcd.print(millis()/1000);
  pinMode(led, LOW);
  delay(fifteenseconds);
  pinMode(led, HIGH);
  
  servo1.write(180);    // Tell servo to go to 90 degrees

  delay(1000);         // Pause to get it time to move

  servo1.write(90);   // Tell servo to go to 180 degrees

  delay(1000);         // Pause to get it time to move




}

Tuesday, December 2, 2014

The parts were first made of cardboard and used to test the idea/mechanics of the launcher. Launched candy using elastics which are held to the cardboard by pins through a hole.


Below is a test code used for this project. Int led is used to tell the program to use pin 9 on the board. I chose led for the pin because it's what I've used in every other code. All the other int are time variables. The smaller ones, on the order of seconds is intended for testing and demonstration, while the longer time periods are used to set hours. The servo library is used for the servo variables. 

I looked at one of the sample codes in order to figure out how to set up the servo. In the void loop, it starts off with having the pin give a low signal for the "TIMEVARIABLE". In this place, you put in the int to determine how long until the servo turns. Then, the pinMode turns to high, providing power to the servo. The details after make the servo turn 180 degrees forward, then back to the original position. Since it is a loop, it can be set to fifteen or thirty seconds in order to show multiple shots for testing. However, each time, you still need to pull back the rubber band and load a projectile. 

#include <Servo.h>
Servo servo1;  // servo control object
int led = 9;
int fiveseconds = 5000;
int fifteenseconds = 15000;
int thirtyseconds = 30000;
int oneminute = 60000;
int tenminutes = 600000;
int thirtyminutes = 1800000;
int onehour = 3600000;
int onehourthirtyminutes = 5400000;
int twohour = 7200000;
int twohourthirtyminutes = 9000000;
int threehours = 1800000000;
int threehourthirtyminutes = 36000000;
int fourhours = 54000000;
int fourhourthirtyminutes = 72000000;
int fivehours = 90000000;

void setup () {
  servo1.attach(9);
}

void loop() {

  pinMode(led, LOW);
  delay(TIMEVARIABLE);
  pinMode(led, HIGH);
  
  servo1.write(180);    

  delay(1000);         

  servo1.write(90);   

  delay(1000);         



}