Engineering Applications
Project Brief
Skill Development
We are going to learn the above 4 things to be able to do our semester 2 project.
Independence
This year, Ms. White is helping us so that we can choose a project.
Robotic Arm
Our robotic arm is to help us build skills to do our semester 2 project!
Research
This arm looks sturdy and reasonable to execute but it does not look like it has much rotation in the base.
This arm has the same problem, but the syringes add a unique design to this model.
Building
For my claw, I decided to build a magnet like shape, I created multiple layers and glued them together for more stability.
Finished Carboard Claw
This is the final claw, it does not have an arm yet but that is the next step.
Claw in Action
This is a GIF of my claw picking up a pack of Duracell batteries.
Code For Claw
#include <Servo.h>
Servo myservo; // create servo object to control a servo
Servo servo;
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(3); // attaches the servo on pin 9 to the servo object
servo.attach(4);
}
void loop() {
// in steps of 1 degree
myservo.write(0);
servo.write(130); // tell servo to go to position in variable 'pos'
delay(1500); // waits 15ms for the servo to reach the position
delay(1500); // waits 15ms for the servo to reach the position
myservo.write(100);
servo.write(0); // tell servo to go to position in variable 'pos'
delay(1500); // waits 15ms for the servo to reach the position
// tell servo to go to position in variable 'pos'
delay(1500); // waits 15ms for the servo to reach the position
}
Base for Arm
This GIF shows the base of the arm rotating 180 degrees. When the arm is fully moving, this will give it even more mobility.
Claw
This is the claw that will be on the end of the arm, it will grab items I code it to grab.
Code for Base and Claw Working Together
#include <Servo.h>
Servo myservo; // claw
Servo servo; //base
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(4);
servo.attach(3);
}
void loop() {
// in steps of 1 degree
myservo.write(100);
delay(1000); // waits 15ms for the servo to reach the position
myservo.write(180); // tell servo to go to position in variable 'pos'
delay(1000); // waits 15ms for the servo to reach the position
// in steps of 1 degree
servo.write(0);
delay(1000); // waits 15ms for the servo to reach the position
servo.write(180); // tell servo to go to position in variable 'pos'
delay(1000); // waits 15ms for the servo to reach the position
}
Right Servo working
This is the right servo for the arm.
Both Arm Servos
These are both the right and left servos working, going in opposite directions to have the arm go up and down.
Cod For Arm / Claw / Base
#include <Servo.h>
Servo claw; // create servo object to control a servo
Servo base;
Servo rightservo;
Servo leftservo;
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
claw.attach(4);
base.attach(3);
rightservo.attach(5);
leftservo.attach(6);
}
void loop() {
// in steps of 1 degree
claw.write(100);
delay(1000); // waits 15ms for the servo to reach the position
claw.write(180); // tell servo to go to position in variable 'pos'
delay(1000); // waits 15ms for the servo to reach the position
// in steps of 1 degree
base.write(0);
delay(1000); // waits 15ms for the servo to reach the position
base.write(180); // tell servo to go to position in variable 'pos'
delay(1000); // waits 15ms for the servo to reach the position
leftservo.write (90);
rightservo.write (90);
delay (1000);
rightservo.write (0);
leftservo.write (0);
delay (1000);
}
Arm fully built
This is the fully put together arm, it consists of 14 shafts, 5 metal rods, 4 servos and 40 spacers. The next step is coding it to pick up an object.
Right Servo Working
The right servo on the arm allows the arm to reach out and down.
Left Servo Working
This servo moves the arm up and down.
Arm picking up object
The arm is fully built and coded! My code tells the arm to slowly pick up and move the battery box to the other side. (Code is below)
Robot Code
#include <Servo.h> // this refers to a "library" that knows how to control servos
Servo base; //defines a "servo" object and names it "firstservo"
Servo claw;
Servo rightservo;
Servo leftservo;
int rpos = 0;
int lpos = 0;
int bpos = 0;
int cpos = 0;
void setup() {
base.attach(10);
claw.attach(4);
rightservo.attach(5);
leftservo.attach(9);
//Up, Forward, Centered, Open
rightservo.write(0);//back
leftservo.write(110);//up
base.write(90);//middle
claw.write(180);//open
delay(1000);
//Retracted, folded down, right, open
rightservo.write(0);//back
for (lpos = 110; lpos >= 60; lpos -= 1) { // small arm up
leftservo.write(lpos);
delay(15);
}
for (bpos = 90; bpos >= 0; bpos -= 1) { // based moves right
base.write(bpos);
delay(15);
}
// for (bpos = 90; bpos >= 0; bpos -= 1) { // based moves right
// rightservo.write(bpos);
// delay(15);
// }
claw.write(180);//open
delay(1000);
//Fully extended, right, open
for (lpos = 60; lpos <= 90; lpos += 1) { // forward position
leftservo.write(lpos);
delay(15);
}
for (rpos = 0; rpos <= 90; rpos += 1) { // forward position
rightservo.write(rpos);
delay(15);
}
base.write(0);//right
for (cpos = 180; cpos >= 90; cpos -= 1) { // based moves right
claw.write(cpos);
delay(15);
}
delay(1000);
//Fully extended, right, closed
rightservo.write(90);//back
leftservo.write(90);//up
base.write(0);//right
claw.write(90);
delay(1000);
// //Retracted, folded down, right, open
for (rpos = 90; rpos >= 0; rpos -= 1) { // forward position
rightservo.write(rpos);
delay(15);
}
for (lpos = 90; lpos >= 60; lpos -= 1) { // forward position
leftservo.write(lpos);
delay(15);
}
base.write(0);//right
claw.write(90);//closed
delay(1000);
//Retracted, folded down, right, open
rightservo.write(0);//back
leftservo.write(60);//up
for (bpos = 0; bpos <= 180; bpos += 1) { // forward position
base.write(bpos);
delay(15);
}
claw.write(90);//closed
delay(1000);
//
// //Fully extended, left, closed
for (lpos = 60; lpos <= 90; lpos += 1) { // forward position
leftservo.write(lpos);
delay(15);
}
for (rpos = 0; rpos <= 90; rpos += 1) { // forward position
rightservo.write(rpos);
delay(15);
}
base.write(180);//left
for (cpos = 90; cpos <= 180; cpos += 1) { // forward position
claw.write(cpos);
delay(15);
}
delay(1000);
//
// //Fully extended, left, open
rightservo.write(90);//back
leftservo.write(90);//up
base.write(180);//left
claw.write(180);
delay(1000);
//
// //Retracted, folded down, left, open
for (rpos = 90; rpos >= 0; rpos -= 1) { // forward position
rightservo.write(rpos);
delay(15);
}
for (lpos = 90; lpos >= 60; lpos -= 1) { // forward position
leftservo.write(lpos);
delay(15);
}
base.write(180);//left
claw.write(180);//closed
delay(1000);
//
// //Up, Forward, Centered, Open
// rightservo.write(0);//back
for (lpos = 60; lpos <= 110; lpos += 1) { // forward position
leftservo.write(lpos);
delay(15);
}
for (bpos = 180; bpos >= 90; bpos -= 1) { // forward position
base.write(bpos);
delay(15);
}
}
void loop() {
}
// clawservo.write(90);//open
// delay(4000);
//
Code Test
Today, we had to take a test where we were given motions to code for our robots. (Code is below)
Robot Test Code
#include <Servo.h> // this refers to a "library" that knows how to control servos
Servo base; //defines a "servo" object and names it "firstservo"
Servo claw;
Servo rightservo;
Servo leftservo;
int rpos = 0;
int lpos = 0;
int bpos = 0;
int cpos = 0;
void setup() {
base.attach(10);
claw.attach(4);
rightservo.attach(5);
leftservo.attach(9);
//Up, Forward, Centered, Open
rightservo.write(0);//back
leftservo.write(110);//up
base.write(90);//middle
claw.write(180);//open //SWITCH 90 TO 180 FOR CLAW TO OPEN!!!!!! DO THIS NEXT CLASS OLIVIA!!!
delay(1000);
//turn left
rightservo.write(0);
leftservo.write(110);
for (bpos = 90; bpos <= 150; bpos += 1) { // based moves right
base.write(bpos);
delay(15);
}
claw.write(180);//open
delay(1000);
//leftservo down
rightservo.write(0);
for (lpos = 110; lpos >= 80; lpos -= 1) { // small arm up
leftservo.write(lpos);
delay(15);
}
base.write(150);
claw.write(180);
delay (1000);
//out
for (lpos = 80; lpos <= 90; lpos += 1) { // forward position
leftservo.write(lpos);
delay(15);
}
for (rpos = 0; rpos <= 90; rpos += 1) { // forward position
rightservo.write(rpos);
delay(15);
}
base.write(150);
delay(1500);
for (cpos = 180; cpos >= 90; cpos -= 1) { // forward position
claw.write(cpos);
delay(15);
}
delay (1000);
//retract
for (rpos = 90; rpos >= 0; rpos -= 1) { // forward position
rightservo.write(rpos);
delay(15);
}
for (lpos = 90; lpos >= 60; lpos -= 1) { // forward position
leftservo.write(lpos);
delay(15);
}
base.write(150);//left
claw.write(90);//closed
delay(1000);
//up little
rightservo.write(0);
for (lpos = 60; lpos <= 110; lpos += 1) { // small arm up
leftservo.write(lpos);
delay(15);
}
base.write(150);
claw.write(90);
delay (1000);
//base turn
rightservo.write(0);//back
leftservo.write(110);//up
for (bpos = 150; bpos >= 70; bpos -= 1) { // forward position
base.write(bpos);
delay(15);
}
claw.write(90);
delay(1000);
//down little
rightservo.write(0);
for (lpos = 110; lpos >= 80; lpos -= 1) { // small arm up
leftservo.write(lpos);
delay(15);
}
base.write(70);
claw.write(90);
delay (1000);
//out
for (lpos = 80; lpos <= 90; lpos += 1) { // forward position
leftservo.write(lpos);
delay(15);
}
for (rpos = 0; rpos <= 90; rpos += 1) { // forward position
rightservo.write(rpos);
delay(15);
}
base.write(70);
delay(1000);
for (cpos = 90; cpos <= 180; cpos += 1) { // forward position
claw.write(cpos);
delay(15);
}
delay (1000);
//retract
for (rpos = 90; rpos >= 0; rpos -= 1) { // forward position
rightservo.write(rpos);
delay(15);
}
for (lpos = 90; lpos <= 110; lpos += 1) { // forward position
leftservo.write(lpos);
delay(15);
}
base.write(70);//left
claw.write(180);//closed
delay(1000);
//og position
rightservo.write(0);//back
leftservo.write(110);//up
for (bpos = 70; bpos <= 90; bpos += 1) { // forward position
base.write(bpos);
delay(15);
}
claw.write(180);//open
}
void loop() {
}
Circuit Diagram
Here is a circuit diagram of my wiring I made, this is useful if my wires get misplaced and helps organize them.
SKITTLE PROJECT
Scoop Claw
I think a scoop claw would be beneficial in this project because it would be able to hold more skittles.
Moving ramp
Instead of having an arm, we could make a tunnel that moves to the correct skittle's cup once recognizing the color.
Base
I couldn't find a picture of my idea, but we could make the base move after the skittle's color is recognized.
Idea Development
Here is the sketch for our skittle sorter, we decided to do a clock design where the minute hand acts as the tunnel to organize the skittles.
Day 1: Figuring out mechanism
On this day, we were playing around with how we were going to get the skittles from the sensor to their sorted boxes.
Day 2: Cardboard peices and wiring
The cut-out cardboard pieces on the top picture include the outline and the piece to separate the skittles to be sorted.
The bottom picture shows the servo and wiring behind the circular cardboard piece.
Day 3: Body Built
The body is put together besides the moving hour hand and the face of the clock is not glued on. This class we worked on coding the actual sensor.
Day 4: Second servo and boxes
On this day, we made the boxes for the skittles to be sorted into and cut the hole for the second servo. The second servo has the ramp which moves to the specific position to put the skittle into a box.
Day 5: Reconfigured tunnel
The skittle kept getting stuck at the base of the tunnel, so I made a new one which worked better. We are stuck with how to get the skittle from the first tunnel to the second one.
Day 6: Guiding tunnel
We decided to completely reconfigure the tunnel guiding the skittles to their boxes by adding a path for the skittles after they're sorted. They then go through the bottom.
Day 7: Bottom tunnel
We attached the tunnel that guides the skittle to its spot at the bottom of the clock to take advantage of gravity. This was was much more efficent and ran more smoothly.
Day 8: Appearence tweaks
I recut the clock face so it fit neatly in the circular frame. I ended up having to do this multiple times because the tunnel had to be directly over the sensor for it to run smoothly.
Day 9: Base
I had the job of figuring out how to make a sturdy base. Our first thought was, "how do we get it to look most like a clock?" We wanted to do a rounder shaft to hold the circular frame up, but that was a specification for a time when we actually had time. I went with a boxier, more sturdy shaft.
Day 10: Boxes
Because of the tunnel's steep angle, the skittles came shooting out of the tube. We added tissue to the boxes but it was not enough padding so we added hot glue on the inside of the boxes. The rubbery texture helped with the bouncing but it was still a consistent problem.
Day 11: Tube
After testing dumping all the skittles in the tube at once, we noticed there was some serious clogging. This paper tube that fits on the inside of the frontal cardboard tube is smaller, which separates the skittels so at the base there is less likely a chance for two skittles to get clogged.
Day 12: Final Product!
This is our final product! It sorted the majority of the bin of skittles. If we were to continue to improve this project, I would say we should work on the bouncing of the skittles and the sorter sorting more than 1 skittle at a time.
Our task is to create a device that sorts the Drew Recycling STREAM. We are going to compare the skittles sorter with the goal of recycling the Drew Recycling Stream
Color Sorting Machine
This machine is automatic and sorts plastics.
DIY Sorter
This machine sorts waste into either glass, metal or plastic labeled bins. It uses an Arduino uno, an inductive sensor, a capactive sensor, and an ultrasonic sensor.
https://www.instructables.com/Automatic-Waste-Sorting-Machine/
Smart Recycling Bin
This waste bin detects the material of the trash by taking two photos of the material. The computer identifies the material and lights up the correct area to throw your trash away.
Wase Sorting Machine
After inserting the trash, the entire bottom of the bin turns for the waste to be let into the specific area.
Stepper motor
This is a new motor we are working with, it is much more precise than the other motors we've used before.
Code For Stepper Motor
/* Example sketch to control a stepper motor with L298N motor driver, Arduino UNO and Stepper.h library. More info: https://www.makerguides.com */
// Include the Stepper library:
#include <Stepper.h>
// Define number of steps per revolution:
const int stepsPerRevolution = 200;
// Initialize the stepper library on pins 8 through 11:
Stepper myStepper = Stepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// Set the motor speed (RPMs):
myStepper.setSpeed(3
00);
}
void loop() {
// Step one revolution in one direction:
myStepper.step(200);
delay(2000);
// Step on revolution in the other direction:
myStepper.step(-200);
delay(2000);
}
Honda CT 70
Before
During
Finished!
Machine Learning and the Body
For the slides above, my classmates and myself each picked a piece of technology that uses Machine Learning to increase the accuracy of their data. I chose self driving cars, as you can see in the left slide. There, I summarize how the company Tesla programs their cars to use sensors to scan their surroundings. The middle slide summarizes the optimization techniques Machine Learning models use to be as accurate as possible. The right slide sums up Machine Learning as a whole with added examples of applications that use Machine Learning.
Machine Learning Project
What is the goal of my model?
The goal of the model I created is to be accurate in predicting the items I chose for the model to identify. My overall category was vegetables which included a red bell pepper, a cucumber, broccoli and a carrot as you can see below.
Data collection process
The total number of pictures taken was 804, around 250 pictures were taken of each vegetable. In each picture, there are 48 x 48 pixels. Below you will see a picture of each vegetable that the computer taken by the computer.
Pepper
Cucumber
Broccoli
Carrot
My Model!
This model takes the data (pictures of veggies) from a google drive folder, analyzes them and predicts which veggie it thinks it is based on the amount of data I have.
My Data
Building the model
This prints a summary of the model, including the shape of each layer and the parameters.
The first layer is the data input layer, where the information is entered. The second layer is a dense layer that computes using the function sigmoid. You can see that this layer shows the number of neurons (1024) The third is another dense layer that calculates the output.
Accurately labeled images
Below, you can see my model predicting correctly which veggie is in the frame. This shows the prediction the model made for the randomly produced image and whether or not the model was accurate.
Mislabeled images
The accuracy of the predictions in my model is 100%, which means I have zero mislabeled images. I have many images from various angles in each of the veggies' folders which gives my model more data to analyze for a more precise prediction.