To begin with the Engineering Applications class, we had to spread out all of our materials and label them. These parts will go toward my robotic arm project.
In the project brief, we get an understanding of what the project that we are doing is, and what the project constraints are. We need the project brief document to do this.
This is the problem to our very first project for this school year.
This will be our plan or solution to our problem. This is the engineering process.
Using a web editor, I created my first circuit diagram. It has a servo motor, 3 wires, and an Arduino Nano. Circuit diagrams are used for the construction of electronic equipment. You do not use a breadboard in a circuit diagram.
Using Tinker Cad, I learned how to make a circuit picture. This is similar to the circuit diagram but this includes a breadboard.
In Research, we find similar products that demonstrates ours. We evaluate them and understand how they work. This research shows that I found two drawbot ideas and the wiring for two servos
This is a schematic of the wiring of two servos using a breadboard. Red and black wires are for power and white or yellow wires are for function. Those wires can go directly into the Arduino.
This drawbot has 2 servos and an Arduino. One servo to move the pen back and forth, and one servo to move the pen left and right. There are also jumper wires, screws, a A-B cable,and plastic servos horns.
This drawbot is more of an robotic arm, but it is the same concept. Yes, it has multiple servos but each one rotates at a different angle for the robotic arm to perform correctly. It still consists of jumper wires, an Arduino, screws, and plastic gears.
In Idea Development, we brainstorm potential solutions and narrow for feasibility. After deep research, I came to the solution that my drawbot will look very similar to this one , because I like the design.
We have been asked to choose a direction or configuration for our proposed drawing machine. I chose to do cardboard because the one I chose uses plywood and cardboard is the closet thing to plywood in my house.
In 3D Prototyping, we create multiple physical models of potential solutions. I made almost 4 different drawbots and each one was better than the last. The one below is the one before my final product.
Using Tinker Cad, I created a circuit picture that corresponds to my actual prototype. It includes 2 servos, 6 wires and an Arduino nano. This is similar to the circuit diagram but this includes a breadboard.
Using a web editor, I created my second circuit diagram. It has a 2 servo motors, 6 wires, and an Arduino Nano. You do not use a breadboard in a circuit diagram. The red wires are plugged into 5V, black wires are plugged into GND, one control wire is plugged into D3 and the other is plugged into D4.
This is an example of 2 servos working at the same time. Using the code below, and Arduino, I created a 2D drawing machine.
#include <Servo.h>
int servoPin = 3;
int servoPin2 = 4;
Servo Servo1;
Servo Servo2;
void setup() {
// We need to attach the servo to the used pin number
Servo1.attach(servoPin);
Servo2.attach(servoPin2);
}
void loop(){
// Make servo go to 0 degrees
Servo1.write(0);
delay(1000);
// Make servo go to 90 degrees
Servo1.write(90);
delay(1000);
// Make servo go to 180 degrees
Servo1.write(180);
delay(1000);
Servo2.write(0);
delay(1000);
// Make servo go to 90 degrees
Servo2.write(90);
delay(1000);
// Make servo go to 180 degrees
Servo2.write(180);
delay(1000);
}int redPin = 11;
int greenPin = 10;
int bluePin = 9;
In Evaluation and Testing, we get feedback from clients, and asses the functionality of the prototype. Along with a peer review critique on google sheets, I tested my drawbot plenty of times and evaluated each change so that it would do what it was supposed to do. See videos shown below.
In Production, we create the final solution out of real materials and implement them. After remaking and remaking my drawbot, it came down to looking and functioning like the one below.
This is the presentation of my 2D drawing robotic arm. It shows all parts/components and what they do. It also explains what each pattern does and the code that corresponds to that pattern.
Servos - Motors for each arm of the robot. One rotates the whole thing and the other only rotates the pen.
Servo Horn & Screw - Attached to the cardboard arm and servo motor with super glue.
Arduino & Breadboard - The brain of the whole robot. Using software code to make the robot actually work.
Jumper Wire - Based off the code, it varies for which pin each wire goes into. Mines are plugged into 3 & 4.
Pen - What draws each figure.
Below, you will find the code for each figure drawn.
#include <Servo.h>
int Longpos = 0;
int Shortpos = 0;
Servo Long;
Servo Short;
void setup() {
Long.attach(3);
Short.attach(4);
}
void loop(){
Short.write(130);
for (Longpos= 50; Longpos<= 140 ; Longpos+= 1) {
Long.write(Longpos);
delay(15);
}
delay(1000);
for (Longpos= 130; Longpos>= 90; Longpos-= 1) {
Long.write(Longpos);
delay(15);
}
delay(800);
for (Shortpos = 145; Shortpos <= 110; Shortpos -= 1) {
Short.write(Shortpos);
delay(15);
}
delay(1000);
for (Shortpos = 0; Shortpos <= 80; Shortpos += 1) {
Short.write(Shortpos);
delay(15);
}
delay(1000);
for (Longpos= 50; Longpos<= 30 ; Longpos-= 1) {
Long.write(Longpos);
delay(15);
}
delay(1000);
for (Longpos= 90; Longpos<= 130 ; Longpos+= 1) {
Long.write(Longpos);
delay(15);
}
delay(1000);
}
#include <Servo.h>
Servo Long;
Servo Short;
int Longpos= 0;
int Shortpos = 0;
void setup() {
Long.attach(3);
Short.attach(4);
}
void loop() {
for (Longpos= 90; Longpos<= 120 ; Longpos+= 1) {
Long.write(Longpos);
delay(15);
}
delay(1000);
for (Shortpos = 90; Shortpos <= 30; Shortpos -= 1) {
Short.write(Shortpos);
delay(15);
}
delay(1000);
for (Longpos= 120; Longpos>= 90; Longpos-= 1) {
Long.write(Longpos);
delay(15);
}
delay(800);
for (Shortpos = 90; Shortpos <= 140; Shortpos += 1) {
Short.write(Shortpos);
delay(15);
}
delay(1000);
for (Longpos= 120; Longpos>= 100; Longpos-= 1) {
Long.write(Longpos);
delay(15);
}
delay(2000);
}
#include <Servo.h>
int Longpos = 0;
int Shortpos = 0;
Servo Long;
Servo Short;
void setup() {
Long.attach(3);
Short.attach(4);
}
void loop(){
Long.write(130);
delay(1000);
Short.write(180);
delay(1000);
Long.write(90);
delay(1000);
Short.write(70);
}
We layed out all pieces to configure which piece each person was missing
After assembling my base and servos, I had to calibrate them. When I say calibrate them I mean look at the rotation of my servos and make sure they do not go below the sides of my base. If they do, that means the arms of my robot will not function properly.
#include <Servo.h>
Servo Right;
Servo Left;
int Rightpos= 0;
int Leftpos = 0;
void setup() {
Right.attach(3);
Left.attach(4);
}
void loop() {
for (Rightpos= 80; Rightpos<= 166; Rightpos+= 1)
{Right.write(Rightpos);
delay(15);}
delay(3000);
for (Rightpos= 166; Rightpos>= 80; Rightpos-= 1)
{Right.write(Rightpos);
delay(15);}
delay(5000);
for (Leftpos = 66; Leftpos <= 147; Leftpos += 1)
{Left.write(Leftpos);
delay(15);}
delay(3000);
for (Leftpos = 147; Leftpos >= 66; Leftpos -= 1)
{Left.write(Leftpos);
delay(15);}
delay(5000);
}
Today we progressed on our robotic arm by adding more arms to each side. This is what we accomplished today!
Today we progressed on our robotic arm by building the "square" and getting the robot to move forward, backward, up, and down.
Today we progressed on our robotic arm by building our base. The base allows the robot to rotate itself 180 degrees due to the type of servos used. The robot now moves up, down, back, forth, and left and right.
#include <Servo.h>
Servo Right;
Servo Left;
int Rightpos= 0;
int Leftpos = 0;
void setup() {
Right.attach(3);
Left.attach(4);
}
void loop() {
for (Rightpos= 80; Rightpos<= 125; Rightpos+= 1)
{Right.write(Rightpos);
delay(15);}
delay(3000);
for (Rightpos= 125; Rightpos>= 80; Rightpos-= 1)
{Right.write(Rightpos);
delay(15);}
delay(5000);
for (Leftpos = 90; Leftpos <= 144; Leftpos += 1)
{Left.write(Leftpos);
delay(15);}
delay(3000);
for (Leftpos = 144; Leftpos >= 90; Leftpos -= 1)
{Left.write(Leftpos);
delay(15);}
delay(5000);
}
#include <Servo.h>
Servo Right;
Servo Left;
Servo Bottom;
int Rightpos= 0;
int Leftpos = 0;
int Bottompos = 90;
void setup() {
Right.attach(3);
Left.attach(4);
Bottom.attach(5);
}
void loop() {
for (Rightpos= 80; Rightpos<= 125; Rightpos+= 1)
{Right.write(Rightpos);
delay(15);}
delay(3000);
for (Rightpos= 125; Rightpos>= 80; Rightpos-= 1)
{Right.write(Rightpos);
delay(15);}
delay(5000);
for (Leftpos = 90; Leftpos <= 144; Leftpos += 1)
{Left.write(Leftpos);
delay(15);}
delay(3000);
for (Leftpos = 144; Leftpos >= 90; Leftpos -= 1)
{Left.write(Leftpos);
delay(15);}
delay(5000);
for (Bottompos= 0; Bottompos<= 180; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(15);}
delay(3000);
for (Bottompos= 180; Bottompos>= 0; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(15);}
delay(5000);
}
This video shows my claw fully functioning. My range of motion is 80 degrees.
This is my fully functioning robot, also picking up and dropping objects. The left servo controls the upper arm, causing that arm to move up and down. The right servo controls the lower arm causing that arm to forward and back. The bottom servo controls the base of the robot, causing the whole robot to move left and right. Finally, the claw servo controls the claw, causing it to open and close.
#include <Servo.h>
Servo Right;
Servo Left;
Servo Bottom;
Servo Claw;
int Rightpos= 0;
int Leftpos = 150;
int Bottompos = 0;
int Clawpos = 0;
void setup() {
Right.attach(3);
Left.attach(4);
Bottom.attach(5);
Claw.attach(6);
}
void loop (){
Left.write(180);
delay(1000);
Bottom.write(95);
delay(1000);
Left.write(180);
delay(1000);
Right.write(120);
delay(1000);
Claw.write(165);
delay(1000);
Right.write(90);
delay(1000);
Bottom.write(30);
delay(1000);
Right.write(120);
delay(1000);
Left.write(180);
delay(1000);
Claw.write(110);
delay(1000);
Right.write(90);
delay(1000);
Right.write(90);
delay(1000);
Left.write(180);
delay(1000);
Bottom.write(120);
delay(1000);
Left.write(180);
delay(1000);
Right.write(120);
delay(1000);
Claw.write(165);
delay(1000);
Right.write(90);
delay(1000);
Bottom.write(30);
delay(1000);
Right.write(120);
delay(1000);
Left.write(180);
delay(1000);
Claw.write(110);
delay(1000);
Right.write(90);
delay(1000);
Right.write(90);
delay(1000);
Left.write(180);
delay(1000);
Bottom.write(140);
delay(1000);
Left.write(180);
delay(1000);
Right.write(120);
delay(1000);
Claw.write(165);
delay(1000);
Right.write(90);
delay(1000);
Bottom.write(30);
delay(1000);
Right.write(120);
delay(1000);
Left.write(180);
delay(1000);
Claw.write(110);
delay(1000);
Right.write(90);
delay(1000);
Right.write(90);
delay(1000);
Left.write(180);
delay(1000);
Bottom.write(160);
delay(1000);
Left.write(180);
delay(1000);
Right.write(120);
delay(1000);
Claw.write(165);
delay(1000);
Right.write(90);
delay(1000);
Bottom.write(30);
delay(1000);
Right.write(120);
delay(1000);
Left.write(180);
delay(1000);
Claw.write(110);
delay(1000);
Right.write(90);
delay(1000);
Right.write(90);
delay(1000);
Left.write(180);
delay(1000);
Bottom.write(180);
delay(1000);
Left.write(180);
delay(1000);
Right.write(120);
delay(1000);
Claw.write(165);
delay(1000);
Right.write(90);
delay(1000);
Bottom.write(30);
delay(1000);
Right.write(120);
delay(1000);
Left.write(180);
delay(1000);
Claw.write(110);
delay(1000);
Right.write(90);
delay(1000);
Right.write(90);
delay(1000);
}
Using a web editor, I created my final circuit diagram. It has a 4 servo motors, 12 wires, and an Arduino Nano. You do not use a breadboard in a circuit diagram. The red wires are plugged into 5V, black wires are plugged into GND, control wires are plugged into D3, D4, D5, and D6.
Using Tinker Cad, I created a circuit picture that corresponds to my actual fully functioning robotic arm. It includes 4 servos, 12wires and an Arduino Nano. This is similar to the circuit diagram but this includes a breadboard.
We decided in class that we would use the next several class periods to refine our coding skills by getting our robots to dance to jingle bells.
This video shows part 1 and 2 of the robot dancing to Jingle Bells.
This video shows the full robot dance and since I did not have the jingle bells to go along with it, I had to use a rubber band. All motions are there and on beat. Enjoy!
#include <Servo.h>
Servo Right;
Servo Left;
Servo Bottom;
Servo Claw;
int Rightpos= 0;
int Leftpos = 0;
int Bottompos = 0;
int Clawpos = 0;
void setup() {
Right.attach(3);
Left.attach(4);
Bottom.attach(5);
Claw.attach(6);
delay(2500);
for (Leftpos= 179; Leftpos<= 180; Leftpos+= 1)
{Left.write(Leftpos);
delay(10);}
for (Rightpos= 99; Rightpos<= 100; Rightpos+= 1)
{Right.write(Rightpos);
delay(10);}
for (Clawpos= 159; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
}
void loop (){
for (Bottompos= 90; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 80; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 80; Bottompos<= 100; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(12);}
for (Bottompos= 100; Bottompos>= 90; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(12);}
{delay(500);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
{delay(500);}
for (Rightpos= 100; Rightpos<= 140; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Leftpos= 175; Leftpos<= 180; Leftpos+= 1)
{Left.write(Leftpos);
delay(5);}
for (Clawpos= 120; Clawpos<= 165; Clawpos+= 1)
{Claw.write(Clawpos);
delay(25);}
for (Rightpos= 140; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
{delay(1000);}
for (Bottompos= 90; Bottompos<= 120; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 120; Bottompos>= 60; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 60; Bottompos<= 120; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 120; Bottompos>= 60; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 60; Bottompos<= 120; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 120; Bottompos>= 60; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 60; Bottompos<= 120; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Bottompos= 120; Bottompos>= 90; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 120; Clawpos<= 160; Clawpos+= 1)
{Claw.write(Clawpos);
delay(10);}
for (Clawpos= 160; Clawpos>= 120; Clawpos-= 1)
{Claw.write(Clawpos);
delay(10);}
for (Bottompos= 90; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 45; Bottompos<= 135; Bottompos+= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 45; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Bottompos= 135; Bottompos>= 90; Bottompos-= 1)
{Bottom.write(Bottompos);
delay(5);}
for (Rightpos= 100; Rightpos<= 160; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 160; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 100; Rightpos<= 160; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 160; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 100; Rightpos<= 160; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 160; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 100; Rightpos<= 160; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 160; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 100; Rightpos<= 160; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 160; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 100; Rightpos<= 160; Rightpos+= 1)
{Right.write(Rightpos);
delay(25);}
for (Rightpos= 160; Rightpos>= 100; Rightpos-= 1)
{Right.write(Rightpos);
delay(25);}
}
Our 2nd semester project will be to make a pinball machine
This is the final product requirements.
This is a similar image of what our pinball machine will look like.
This is what we will have mastered after constructing this product.
The goal of the project brief in the design process is to define the problem. What are we making and what do we need or what are the constraints of the project. It gives us prototype and final project requirements to evaluate. During this phase of the design process, I was provided with a layout of the pinball machine where it showed us our required electrical components, mechanical components, body, and design. Above, you can see the project requirements.
I like the use of push pins in this machine. It could be used as my unique design component in my final product
I like the use of a fidget spinner in this design. That also could be used as my unique mechanical component in my final product.
I like the structure and size of this machine. Though I may use 2 stalks to stand the machine diagonally, the size can still be the same as this shown above.
I like the use of the side buzzers and the curved ramp at the top of the gameboard.
This design is very similar to my figure 8 design. The use of all the curves gives a more futuristic look and better style.
The use of Plinko is very brilliant to me, so that is why it is being used in my own design. This could possibly be my special design component of my board.
This person used some type of upstairs downstairs function on their board. Seems do-able, but maybe I'll pass on it. I could instead an like a fidget spinner in the middle as my special mechanical component.
The goal of the research in the design process is to find information. Learn from the experiences of others. This can help me find out about existing productions and avoid mistakes that were made in the past. During this phase of the design process, I researched 9 different pinball machines. 3 homemade, 3 professional, and 3 cardboard ones. After researching, I looked at what each pinball machine had the other didn't and began coming up with ideas of my own.
This is my prototype dimensions. Probably won't be final dimensions but we will see how this prototype holds up.
The goal of the idea development in the design process is to specify requirements, brainstorm different ideas, sketch out iterations, and choose the best solution. During this phase of the design process, I drew a sketch that followed all prototype constraints. Each dimension was labeled and was determined to be the best solution.
These are all 6 views from my 3D Prototype of my pinball machine.
In this video, both flippers work reliably. Left and right both work fine and can hit the ball really hard. How it each flipper works is, there is a stick that slides up against a rectangle wood piece underneath the flipper. As the rectangle rotates up, the flipper rotates up as well. Also, a rubber band is used to cause the flipper to come back to it's original position.
This is very much similar to the idea I had about making my plunger. They used a spring, and I will be using a rubber band.
Now this person, they did too much with their plunger. Even though it was made out of wood, the concept was pretty much the same.
This video is completely out of my range for the materials I have at home, but I like the idea of how they constructed it.
This was the greatest idea I've seen. I'm probably going to use this idea method because it is just genius.
This is a video of my working plunger. How it is constructed is all explained in the video.
There are only 3 wires required to get the Neo Pixel to work. They are shown above.
This video shows my neo pixels functioning. Lights show red, blue, white, orange, and purple
// A basic everyday NeoPixel strip test program.
// NEOPIXEL BEST PRACTICES for most reliable operation:
// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections.
// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel.
// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR.
// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS
// connect GROUND (-) first, then +, then data.
// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip,
// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED.
// (Skipping these may work OK on your workbench but can fail in the field)
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
#define LED_PIN 6
// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 5
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
// Argument 1 = Number of pixels in NeoPixel strip
// Argument 2 = Arduino pin number (most are valid)
// Argument 3 = Pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
// setup() function -- runs once at startup --------------------------------
void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.
strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip.show(); // Turn OFF all pixels ASAP
strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255)
}
// loop() function -- runs repeatedly as long as board is on ---------------
void loop() {
// Fill along the length of the strip in various colors...
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color( 0, 255, 0), 50); // Green
colorWipe(strip.Color( 0, 0, 255), 50); // Blue
// Do a theater marquee effect in various colors...
theaterChase(strip.Color(127, 127, 127), 50); // White, half brightness
theaterChase(strip.Color(127, 0, 0), 50); // Red, half brightness
theaterChase(strip.Color( 0, 0, 127), 50); // Blue, half brightness
rainbow(10); // Flowing rainbow cycle along the whole strip
theaterChaseRainbow(50); // Rainbow-enhanced theaterChase variant
}
// Some functions of our own for creating animated effects -----------------
// Fill strip pixels one after another with a color. Strip is NOT cleared
// first; anything there will be covered pixel by pixel. Pass in color
// (as a single 'packed' 32-bit value, which you can get by calling
// strip.Color(red, green, blue) as shown in the loop() function above),
// and a delay time (in milliseconds) between pixels.
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
strip.setPixelColor(i, color); // Set pixel's color (in RAM)
strip.show(); // Update strip to match
delay(wait); // Pause for a moment
}
}
// Theater-marquee-style chasing lights. Pass in a color (32-bit value,
// a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms)
// between frames.
void theaterChase(uint32_t color, int wait) {
for(int a=0; a<10; a++) { // Repeat 10 times...
for(int b=0; b<3; b++) { // 'b' counts from 0 to 2...
strip.clear(); // Set all pixels in RAM to 0 (off)
// 'c' counts up from 'b' to end of strip in steps of 3...
for(int c=b; c<strip.numPixels(); c += 3) {
strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
}
strip.show(); // Update strip with new contents
delay(wait); // Pause for a moment
}
}
}
// Rainbow cycle along whole strip. Pass delay time (in ms) between frames.
void rainbow(int wait) {
// Hue of first pixel runs 5 complete loops through the color wheel.
// Color wheel has a range of 65536 but it's OK if we roll over, so
// just count from 0 to 5*65536. Adding 256 to firstPixelHue each time
// means we'll make 5*65536/256 = 1280 passes through this outer loop:
for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {
for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
// Offset pixel hue by an amount to make one full revolution of the
// color wheel (range of 65536) along the length of the strip
// (strip.numPixels() steps):
int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
// strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or
// optionally add saturation and value (brightness) (each 0 to 255).
// Here we're using just the single-argument hue variant. The result
// is passed through strip.gamma32() to provide 'truer' colors
// before assigning to each pixel:
strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
}
strip.show(); // Update strip with new contents
delay(wait); // Pause for a moment
}
}
// Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames.
void theaterChaseRainbow(int wait) {
int firstPixelHue = 0; // First pixel starts at red (hue 0)
for(int a=0; a<30; a++) { // Repeat 30 times...
for(int b=0; b<3; b++) { // 'b' counts from 0 to 2...
strip.clear(); // Set all pixels in RAM to 0 (off)
// 'c' counts up from 'b' to end of strip in increments of 3...
for(int c=b; c<strip.numPixels(); c += 3) {
// hue of pixel 'c' is offset by an amount to make one full
// revolution of the color wheel (range 65536) along the length
// of the strip (strip.numPixels() steps):
int hue = firstPixelHue + c * 65536L / strip.numPixels();
uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB
strip.setPixelColor(c, color); // Set pixel 'c' to value 'color'
}
strip.show(); // Update strip with new contents
delay(wait); // Pause for a moment
firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames
}
}
}
This diagram requires a resistor and 2 wires to get the touch sensor to work. They are shown above.
This video shows my touch sensor working correctly. Turns on when I touch and turns off when I touch again.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4, 6);
long val;
int pos;
#define led 13
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop()
{
val = Sensor.capacitiveSensor(30);
Serial.println(val);
if (val >= 30 && pos == 0)
{
digitalWrite(led, HIGH);
pos = 1;
delay(500);
}
else if (val >= 30 && pos == 1)
{
digitalWrite(led, LOW);
pos = 0;
delay(500);
}
delay(20);
}
Not only this diagram requires a resistor and 2 wires to get the touch sensor to work, it also has a servo motor which has 3 added wires. They are shown above.
This video shows my touch sensor controlling the servo and light working correctly. Turns on the servo and light when I touch and turns off the servo and light when I touch again.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4,6);
long val;
int pos;
#define led 13
#include <Servo.h>
int servoPin = 2;
Servo SensorServo;
void setup() {
Serial.begin(9600);
pinMode(led,OUTPUT);
SensorServo.attach(servoPin);
}
void loop() {
val = Sensor.capacitiveSensor(1);
Serial.println(val);
if (val >= 5000 && pos == 0)
{
digitalWrite(led, HIGH);
pos=1;
SensorServo.write(90);
delay(500);
}
else if (val >= -1.9 && pos ==1)
{
digitalWrite(led, LOW);
pos = 0;
SensorServo.write(0);
delay(20);
}
}
The goal of the 3D prototyping in the design process is to build a version of the solution or product. This will later allow to test how my product will work for my final iteration. During this phase of the design process, I used my idea development sketch to cut out cardboard pieces. I started constructing my little components of the pinball machine gameboard. Such as, my flippers, plunger and bumpers. Also electrical and mechanical were apart of my 3D prototyping like the servos and touch sensor.
This is the circuit diagram of the photoresistor. Consists of one wire an led and resistor.
This shows the photoresistor turning the led on when light is disturbed.
const int ledPin = 13; //the number of the LED pin
const int ldrPin = A0; //the number of the LDR pin
void setup() {
Serial.begin(9600);
pinMode (ledPin, OUTPUT); //initialize the LED pin as an output
pinMode (ldrPin, INPUT); //initialize the LDR pin as an input
}
void loop() {
int ldrStatus= analogRead(ldrPin); //read the status of the LDR Value
//check if the LDR status is <=300
//if it is, the LED is HIGH
if (ldrStatus <=300) {
digitalWrite(ledPin, HIGH); //turn LED on
Serial.println("LDR is DARK, LED is ON");
}
else {
digitalWrite(ledPin, LOW); //turn LED off
Serial.println("----------------");
}
}
This circuit diagram is similar to the one above. Includes, a servo, light, 5 wires, sensor and a resistor.
The LED light was not needed for this demonstration, but the ball will go over the aluminum foil causing the servo to rotate, depicting the path of which the ball will go when it reaches that side of the board.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4,6);
long val;
int pos;
#define led 13
#include <Servo.h>
int servoPin = 2;
Servo SensorServo;
void setup() {
Serial.begin(9600);
pinMode(led,OUTPUT);
SensorServo.attach(servoPin);
}
void loop() {
val = Sensor.capacitiveSensor(1);
Serial.println(val);
if (val >= 11 && pos == 0)
{
digitalWrite(led, HIGH);
pos=1;
SensorServo.write(90);
delay(500);
}
else if (val >= 1 && pos ==1)
{
digitalWrite(led, LOW);
pos = 0;
SensorServo.write(0);
delay(20);
}
}
In this video, every time the ball goes pass the flippers or over the photoresistor, you lose 3 points.
#include <LiquidCrystal.h>
int score = 0;
//set pin numbers
//const won't change
const int ledPin = 13; //the number of the LED pin
const int ldrPin = A0; //the number of the LDR pin
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
//const int rs = 3, en = 4, d4 = 5, d5 = 6, d6 = 7, d7 = 2;
LiquidCrystal lcd(3, 4, 5, 6, 7, 2);
void setup() {
Serial.begin(9600);
pinMode (ledPin, OUTPUT); //initialize the LED pin as an output
pinMode (ldrPin, INPUT); //initialize the LDR pin as an input
lcd.begin(16, 2);
lcd.print("hello, world!");
}
void loop() {
int ldrStatus= analogRead(ldrPin); //read the status of the LDR Value
Serial.println(ldrStatus);
//check if the LDR status is <=300
//if it is, the LED is HIGH
if (ldrStatus <=90) {
digitalWrite(ledPin, HIGH);
score -=1;
//turn LED on
Serial.println("LDR is DARK, LED is ON");
}
else {
digitalWrite(ledPin, LOW); //turn LED off
Serial.println("----------------");
}
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
lcd.print(score);
}
This circuit diagram includes 17 wires.
After uploading my code, the scoreboard reads out Hello World.
#include <LiquidCrystal.h>
int score = 0;
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
//const int rs = 3, en = 4, d4 = 5, d5 = 6, d6 = 7, d7 = 2;
LiquidCrystal lcd(3, 4, 5, 6, 7, 2);
void setup() {
lcd.begin(16, 2);
lcd.print("Hello Codat.");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
lcd.print(score);
}
The goal of the evaluation and testing in the design process is to find new problems, make changes, and test new solutions. This requires multiple iterations and redesigns. During this phase of the design process, I made sure all components of my product were working and that they were the best version. My neo pixels, photoresistor, and scoreboard. Each one of those were documented with their codes and circuit diagrams to make sure I can always solve the problem when they're not working.
This is my scaled final pinball machine drawing. ( 1:4 )
This is what my planned gameboard will look like. It shows the 3 different ways you can score and my elements and principles of design.
This is my final pinball machine. Everything working and reliable.
#include <LiquidCrystal.h>
int score = 0;
const int ledPin = 13; //the number of the LED pin
const int ldrPin = A3; //the number of the LDR pin
const int ldrPin2 = A0;
LiquidCrystal lcd(3, 4, 5, 6, 7, 2);
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
#define LED_PIN 9
#define LED_COUNT 5
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4,6);
long val2;
int pos;
#define led 10
#include <Servo.h>
int servoPin = 2;
Servo SensorServo;
void setup() {
Serial.begin(9600);
pinMode (ledPin, OUTPUT); //initialize the LED pin as an output
pinMode (ldrPin, INPUT); //initialize the LDR pin as an input
pinMode (ldrPin2, INPUT); //initialize the LDR pin as an input
lcd.begin(16, 2);
lcd.print("Your Score");
Serial.begin(9600);
pinMode(led,OUTPUT);
SensorServo.attach(servoPin);
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
strip.begin();
strip.show();
strip.setBrightness(100);
}
void loop() {
int ldrStatus= analogRead(ldrPin); //read the status of the LDR Value
Serial.println(ldrStatus);
int ldrStatus2= analogRead(ldrPin2); //read the status of the LDR Value
Serial.println(ldrStatus2);
//check if the LDR status is <=300
//if it is, the LED is HIGH
if (ldrStatus <=90) {
digitalWrite(ledPin, HIGH);
score +=50;
//turn LED on
Serial.println("LDR is DARK, LED is ON");
}
else {
digitalWrite(ledPin, LOW); //turn LED off
Serial.println("----------------");
}
if (ldrStatus2 <=90) {
digitalWrite(ledPin, HIGH);
score -=3;
//turn LED on
Serial.println("LDR is DARK, LED is ON");
}
else {
digitalWrite(ledPin, LOW); //turn LED off
Serial.println("----------------");
}
lcd.setCursor(0, 1);
lcd.print(score);
val2 = Sensor.capacitiveSensor(1);
Serial.println(val2);
if (val2 >= 1 && pos == 0)
{
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color( 0, 255, 0), 50); // Green
colorWipe(strip.Color( 0, 255, 255), 50); // Blue
digitalWrite(led, HIGH);
pos=1;
SensorServo.write(100);
delay(500);
}
else if (val2 >= 1 && pos ==1)
{
digitalWrite(led, LOW);
pos = 0;
SensorServo.write(0);
delay(20);}
}
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.show();
delay(wait);
}
}
The goal of the production in the design process is to complete your project. Display your board and do a final report. What worked and didn't work well. I could I better solve the problem. During this phase of the design process, I did a full video on my whole pinball machine. Every component, design, and constraint explained.
My definition of engineering is taking your ideas and skills and using them with your hands and tools to create something inspiration to maybe you or someone else. Engineers impact the world by creating innovations that might be the heart of society. New technologies, bridges, cars, and modern homes. Out of all the projects I have completed, I think my kinetic sculpture was the most challenging. It was very challenging, because of the wiring and coding complexion. I overcame these challenges by coming into class on my own time and really sitting down and taking my time to code, wire, and solder. I enjoyed the pinball machine project the most, because I completed and built everything my self. So, it was fun seeing how things would turn out and good the board will look. I liked how every new project we start, we take a look at the project brief which consists of the projects introduction and requirements. I would change how we have to go through each step of the engineering process. I think I would study mechanical engineering in college or either industrial engineering. In class, I have had a lot of experience in both fields and ready to take it to the next level!