These are some of the materials that we will be using in our project. These will all be necessary for making our robotic arm work and to be able to function correctly. The breadboard and the servos will be essential parts in controlling how the robotic arm moves. While some of the other tool such as screws and nuts will hold the project together.
When we are doing the project brief we try o get an understanding of the project that we are about to do. This is the start of all of the steps in this process.
For this we looked an a project plan and talked about automation. We also looked at circuit pictures and circuit diagrams.
Our project is about automation.
This is our plan for our project and the order in which we will be attempting to do it. These are the steps we will have to follow. We will use these skills to complete our next project.
This is a diagram that is a layout that shows us where the wires go on our arduino nano. This can help us remeber how it is set up incase we forget. The wires all have a certain place they must go or the project will not work.
This is a circut picture. It shows us where the wires go with a more vivid picture. This can also help us remeber where the wires go .
This is the phase where we use the internet and look up things we need to know for our project. This is where we found a project plan. I found two that I liked and then chose from to start working on my prototype.
I found two that I liked and then chose from to start working on my prototype. I chose these because I liked the look of both of them.
This is a simple draw bot. It is mounted to a custom PCB that is used to control the device. It is also using a breadboard. The servo is moving the marker so that it can make it easier to write.
This draw bot uses an Arduino or a breadboard compatible clone. It has a servo doing a lot of moving along with a battery powered supply. he uses processing as his software as it works well with Arduino.
These are my two black servos. This also shows the circut and that they work.
The idea development is exactly what it sounds like we use the research and create an idea. You would then use that idea and create a 3D prototype.
I used one of the things I found in my research to make an idea. I liked the hanging pen holder better so I used that.
I have decided to use this plan because i like the way it looks. I feel like with the parts in this bag I can replace them with certain things to make this project work. It looks different than a lot of the other projects people have done.
This is the code that I am using to make my two servos work.
This is the circuit picture for my two servos. This shows exactly where they go.
This is the circuit picture for my two servos. This is a more vivid picture.
This is where we make a prototype and then later start to test it. We make these out of cardboard to make our project perfect when we make the final product.
Below is a prototypes for my hanging drawing machine. I used different materials like cardboard to make it.
This is my project of a hanging drawing machine. I am using cardboard, yarn,servos,wood, a pen to do this. My servos are supposed to make then pen moves as it hangs. I was unfortunately not able to make it move next time I will use something other than yarn. I understood how to do the patterns and know how to do it for a regular drawing machine.
#include <Servo.h>
// Declare the Servo pin
int servoPin = 3;
int servoPin2 = 4;
// Create a servo object
Servo Shoulder;
Servo Elbow;
void setup() {
// We need to attach the servo to the used pin number
Shoulder.attach(servoPin);
Elbow.attach(servoPin2);
}
void loop(){
// Make servo go to 0 degrees
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
delay(1000);
Shoulder.write(30);
delay(3000);
// Make servo go to 90 degrees
Shoulder.write(60);
This is where we would test out our prototype or if we were further in the project we would test out our final products. Above is me testing it out. This isn't above the actual testing since the prototyping and testing can be so similar.
When I did my testing I had trouble making the pen holder move.
The servo left is responsible for left movement. The servo right is responsible for right movement. The pen holder keeps the pen in place. The strings hold it tighter and allow the pen to move. The weight holds it down making it easier for the holder to move and we upload all of the code to the Arduino Nano.
This is where we would evaluate our product and the modify it.
If we were further in our project I would be doing this for the final product but since we are just doing this for our prototype I would say that maybe I need to make the strings tighter.
This is how the circuit for this one would look since the website its self did not have one for this example. All of the wires have specific places that they go to make the robot work. If they were misplaced it would not do its job correctly.
This is the Circuit Diagram for robotic arm number two. I chose this one because it is more clearly labeled.
This is the circuit diagram for robotic arm number three. I will be using this circuit diagram for the servos but I will be including different device.
These are some of the main parts of our robotic arm. These will be needed to make our project work. I am missing a metal rod I have all other materials.
This is the base for our robotic arm. This will help it balance and move better. We also put servos in here.
This is a video of my servos moving back and forth as the code tells them to. We had to change the degrees to 90 to make them not touch the base. Then we had to put them on at the right time to also make them not touch the base.
void setup() {
left.attach(7);
right.attach(4);
}
void loop() {
for (leftpos= 0; leftpos<= 90; leftpos+= 1) {
left.write(leftpos);
delay(15);
}
delay(3000);
for (leftpos= 90; leftpos>= 0; leftpos-= 1) {
left.write(leftpos);
delay(15);
}
delay(5000);
for (rightpos = 0; rightpos <= 90; rightpos += 1) {
right.write(rightpos);
delay(15);
}
delay(3000);
//this is back
for (rightpos = 90; rightpos >= 0; rightpos -= 1) {
right.write(rightpos);
delay(15);
}
delay(5000);
}
This is the point that I made it to when we were building our robots in class today.
This is my servo going left, right, down, and up. It has certain limits to make sure it doesn't hit the base itself.
#include <Servo.h>
Servo left;
Servo right;
Servo base;
int leftpos= 0;
int rightpos = 0;
int basepos = 90;
void setup() {
left.attach(7);
right.attach(4);
base.attach(11);
}
void loop() {
for (leftpos= 10; leftpos<= 90; leftpos+= 1) {
left.write(leftpos);
delay(15);
}
delay(5000);
for (rightpos = 80; rightpos <= 110; rightpos += 1) {
right.write(rightpos);
delay(15);
}
delay(3000);
for (leftpos= 65; leftpos>= 0; leftpos-= 1) {
left.write(leftpos);
delay(15);
}
delay(1000);
for (rightpos = 110; rightpos >= 80; rightpos -= 1) {
right.write(rightpos);
delay(15);
}
delay(5000);
for (basepos= 0; basepos<= 180; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 180; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
}
This my robot and I got it to go forwards ,backwards,left and right. This is a video showing everything that it can do as I finished all of the parts before I turned this assignment in.
#include <Servo.h>
Servo left;
Servo right;
Servo base;
Servo claw;
int leftpos= 0;
int rightpos = 0;
int basepos = 90;
int clawpos = 0;
void setup() {
left.attach(7);
right.attach(4);
base.attach(11);
claw.attach(9);
}
void loop() {
for (leftpos= 0; leftpos<= 90; leftpos+= 1) {
left.write(leftpos);
delay(15);
}
delay(5000);
for (rightpos = 10; rightpos <= 100; rightpos += 1) {
right.write(rightpos);
delay(15);
}
delay(1000);
for (leftpos= 90; leftpos>= 0; leftpos-= 1) {
left.write(leftpos);
delay(15);
}
delay(1000);
for (rightpos = 100; rightpos >= 10; rightpos -= 1) {
right.write(rightpos);
delay(15);
}
delay(5000);
for (basepos= 0; basepos<= 180; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 180; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
for (basepos= 0; basepos<= 90; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 90; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
for (clawpos= 90; clawpos>= 0; clawpos-= 1) {
claw.write(clawpos);
delay(15);
}
delay(3000);
for (clawpos = 0; clawpos <= 90; clawpos += 1) {
claw.write(clawpos);
delay(15);
}
delay(3000);
}
This is a picture of the claw we build this week mine is attached to my project because I did that before turning this in.
This is a video of my claw opening and closing as we worked on in class. We had to calibrate this before putting the claw hands on . I submitted mine after I attached it to the arm.
This is my fully functional robot that goes left,right,forwards,backwards, opens, and closes.
This is my real life example and me creating function coding for my robot. A function is a set of steps that we do to finish a task.
#include <Servo.h>
Servo left;
Servo right;
Servo base;
Servo claw;
int leftpos= 0;
int rightpos = 0;
int basepos = 90;
int clawpos = 0;
void setup() {
left.attach(7);
right.attach(4);
base.attach(11);
claw.attach(9);
}
void Up () {
for (leftpos= 0; leftpos<= 90; leftpos+= 1) {
left.write(leftpos);
delay(15);
}
delay(5000);
}
void Forwards () {
for (rightpos = 10; rightpos <= 100; rightpos += 1) {
right.write(rightpos);
delay(15);
}
delay(1000);
}
void Down () {
for (leftpos= 90; leftpos>= 0; leftpos-= 1) {
left.write(leftpos);
delay(15);
}
delay(1000);
}
void Backwards () {
for (rightpos = 100; rightpos >= 10; rightpos -= 1) {
right.write(rightpos);
delay(15);
}
delay(5000);
}
void BaseTurn1 () {
for (basepos= 0; basepos<= 180; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 180; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
}
void BaseTurn2 () {
for (basepos= 0; basepos<= 90; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 90; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
}
void Clawopen () {
for (clawpos= 90; clawpos>= 0; clawpos-= 1) {
claw.write(clawpos);
delay(15);
}
delay(3000);
}
void Clawclose () {
for (clawpos = 0; clawpos <= 90; clawpos += 1) {
claw.write(clawpos);
delay(15);
}
delay(3000);
}
void loop() {
Up();
delay(1000);
Forwards();
delay(1000);
Down();
delay(1000);
Backwards();
delay(1000);
BaseTurn1();
delay(1000);
BaseTurn2();
delay(1000);
Clawopen();
delay(1000);
Clawclose();
delay(1000);
}
This is a video of my project picking up an object and moving it. This helped me understand the code even further and it made be able to command my robot to do certain things. Below is the video
is a video of me explaining this.
The base is the bottom of the box which the wall go into this keeps it on the ground. The lower arm of the project allows the project to go up or down while the upper arm helps it go fowards or backwards. The claw is what allows us to grab and move objects.
#include <Servo.h>
Servo left;
Servo right;
Servo base;
Servo claw;
int leftpos= 0;
int rightpos = 0;
int basepos = 90;
int clawpos = 0;
void setup() {
left.attach(7);
right.attach(4);
base.attach(11);
claw.attach(9);
}
void Up () {
for (leftpos= 10; leftpos<= 100; leftpos+= 1) {
left.write(leftpos);
delay(15);
}
delay(5000);
}
void Forwards () {
for (rightpos = 10; rightpos <= 100; rightpos += 1) {
right.write(rightpos);
delay(15);
}
delay(1000);
}
///void Down () {
///for (leftpos= 90; leftpos>= 0; leftpos-= 1) {
///left.write(leftpos);
///delay(15);
///}
///delay(1000);
///}
void Backwards () {
for (rightpos = 100; rightpos >= 10; rightpos -= 1) {
right.write(rightpos);
delay(15);
}
delay(5000);
}
void BaseTurn1 () {
for (basepos= 0; basepos<= 180; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 180; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
}
void BaseTurn2 () {
for (basepos= 0; basepos<= 90; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
for (basepos = 90; basepos <= 0; basepos += 1) {
base.write(basepos);
delay(15);
}
delay(3000);
}
void Clawopen () {
for (clawpos= 90; clawpos>= 0; clawpos-= 1) {
claw.write(clawpos);
delay(15);
}
delay(3000);
}
void Clawclose () {
for (clawpos = 0; clawpos <= 90; clawpos += 1) {
claw.write(clawpos);
delay(15);
}
delay(3000);
}
void loop() {
BaseTurn1();
delay(1000);
Backwards();
delay(1000);
Clawopen();
delay(1000);
Clawclose();
delay(1000);
Forwards();
delay(1000);
BaseTurn2();
delay(1000);
Backwards();
delay(1000);
Clawopen();
delay(1000);
Forwards();
delay(1000);
///Up();
///delay(1000);
///Down();
///delay(1000);
BaseTurn2();
delay(1000);
}
This is my final circuit diagram that I used and created. This is my wiring. My servos all go to 5v and gnd while they have different D inputs.
This is a circuit picture which better shows you what the project looks like. It also shows the wiring. I created this in tinkercad.
As a class we decided that we would make our orobo do a song. That song was jingle bells. We had to match the rythm of the songs with teh robots movements. We did this to practice our coding. I finsihed this in week 18 so it is the whole video.
For this we had to extend the song from last week making it do more moves. Here are part 1 and part 2. We had to time all of these moves. The video is below
This is my robot dancing to the song doing the movements we agreed on as a class. The video is below
The video below is my final video of my robot for the semester. We put our coding skills to the test and made our robot dance to a song. The song that my class chose was jingle bells.
#include <Servo.h>
Servo left;
Servo right;
Servo base;
Servo claw;
int leftpos= 0;
int rightpos = 0;
int basepos = 90;
int clawpos = 0;
void setup() {
left.attach(7);
right.attach(4);
base.attach(11);
claw.attach(9);
for (leftpos= 50; leftpos<= 60; leftpos+= 1) {
left.write(leftpos);
delay(10);
}
delay(4000);
}
void Up () {
for (leftpos= 10; leftpos<= 130; leftpos+= 1) {
left.write(leftpos);
delay(10);
}
}
void Forwards () {
for (rightpos = 55; rightpos <= 100; rightpos += 1) {
right.write(rightpos);
delay(11);
}
}
void Forwards2 () {
for (rightpos = 55; rightpos <= 100; rightpos += 1) {
right.write(rightpos);
delay(14);
}
}
void Down () {
for (leftpos= 90; leftpos>= 0; leftpos-= 1) {
left.write(leftpos);
delay(11);
}
}
void Vert () {
for (leftpos= 60; leftpos>= 50; leftpos-= 1) {
left.write(leftpos);
delay(12);
}
}
void Backwards () {
for (rightpos = 100; rightpos >= 55; rightpos -= 1) {
right.write(rightpos);
delay(10);
}
}
void Backwards2 () {
for (rightpos = 100; rightpos >= 55; rightpos -= 1) {
right.write(rightpos);
delay(13);
}
}
void BaseTurn1 () {
for (basepos= 85; basepos<= 90; basepos+= 1) {
base.write(basepos);
delay(15);
}
delay(5000);
}
void BaseTurn2 () {
for (basepos= 60; basepos<= 80; basepos+= 1) {
base.write(basepos);
delay(10);
}
for (basepos = 80; basepos >= 60; basepos -= 1) {
base.write(basepos);
delay(10);
}
}
void Right45 () {
for (basepos= 90; basepos<= 135; basepos+= 1) {
base.write(basepos);
delay(7);
}
for (basepos = 135; basepos >= 45; basepos -= 1) {
base.write(basepos);
delay(7);
}
for (basepos= 45; basepos<= 135; basepos+= 1) {
base.write(basepos);
delay(7);
}
for (basepos = 135; basepos >= 45; basepos -= 1) {
base.write(basepos);
delay(7);
}
for (basepos= 45; basepos<= 135; basepos+= 1) {
base.write(basepos);
delay(7);
}
for (basepos = 135; basepos >= 45; basepos -= 1) {
base.write(basepos);
delay(7);
}
for (basepos= 45; basepos<= 135; basepos+= 1) {
base.write(basepos);
delay(7);
}
for (basepos = 135; basepos >= 45; basepos -= 1) {
base.write(basepos);
delay(7);
}
for (basepos= 45; basepos<= 135; basepos+= 1) {
base.write(basepos);
delay(7);
}
for (basepos = 135; basepos >= 45; basepos -= 1) {
base.write(basepos);
delay(7);
}
for (basepos= 45; basepos<= 135; basepos+= 1) {
base.write(basepos);
delay(7);
}
for (basepos = 135; basepos >= 45; basepos -= 1) {
base.write(basepos);
delay(7);
}
}
void Right30 () {
for (basepos= 90; basepos<= 120; basepos+= 1) {
base.write(basepos);
delay(10);
}
for (basepos = 120; basepos >= 60; basepos -= 1) {
base.write(basepos);
delay(10);
}
for (basepos= 60; basepos<= 120; basepos+= 1) {
base.write(basepos);
delay(10);
}
for (basepos = 120; basepos >= 90; basepos -= 1) {
base.write(basepos);
delay(10);
}
}
void Clawopen () {
for (clawpos= 90; clawpos>= 0; clawpos-= 1) {
claw.write(clawpos);
delay(7);
}
}
void Clawclose () {
for (clawpos = 0; clawpos <= 90; clawpos += 1) {
claw.write(clawpos);
delay(7);
}
}
void Clawopen2 () {
for (clawpos= 90; clawpos>= 0; clawpos-= 1) {
claw.write(clawpos);
delay(10);
}
}
void Clawclose2 () {
for (clawpos = 0; clawpos <= 90; clawpos += 1) {
claw.write(clawpos);
delay(10);
}
}
void loop() {
BaseTurn2();
delay(40);
BaseTurn2();
delay(40);
BaseTurn2();
delay(40);
BaseTurn2();
delay(40);
BaseTurn2();
delay(40);
BaseTurn2();
delay(40);
BaseTurn2();
delay(15);
BaseTurn2();
delay(15);
BaseTurn2();
delay(40);
BaseTurn2();
delay(40);
Clawopen();
delay(15);
Clawclose();
delay(15);
Clawopen();
delay(15);
Clawclose();
delay(15);
Clawopen();
delay(15);
Clawclose();
delay(15);
Clawopen();
delay(15);
Clawclose();
delay(15);
Clawopen();
delay(15);
Clawclose();
delay(15);
Clawopen();
delay(15);
Backwards();
delay(10);
Up();
delay(10);
Clawclose2();
delay(10);
Down();
delay(10);
Vert();
delay(10);
Right30();
delay(1000);
Clawopen2();
delay(10);
Clawclose2();
delay(10);
Clawopen2();
delay(10);
Clawclose2();
delay(10);
Clawopen2();
delay(10);
Clawclose2();
delay(10);
Clawopen2();
delay(10);
Clawclose2();
delay(10);
Clawopen2();
delay(10);
Clawclose2();
delay(10);
Clawopen2();
delay(10);
Right45();
delay(1000);
Backwards2();
delay(100);
Forwards2();
delay(100);
Backwards2();
delay(100);
Forwards2();
delay(100);
Backwards2();
delay(100);
Forwards2();
delay(100);
Backwards2();
delay(100);
Forwards2();
delay(100);
}
This is a picture of our new project, We are making a pinball machine.
Before we make a final product we will have to make a prototype that meets these requirements.
These are the requirements and rules we will have to follow when making the final pinball machine. We will need different components, a good design and good craftsmanship.
When we are doing this project we want to demonstrate mastery of the design process and use S.T.E.A.M to helps us create a functionally pinball machine.
This is a cardboard pinball machine. I chose this one because of the triangles they had and how they actually had the ramp that I didn't see in other designs.
This is another machine made out of cardboard. I chose this one because of what they used as bumpers and how the things that you move to keep the ball in were made simply.
This is a cardboard pinball machine that was homemade. I choose this one because it was different from the other I picked and they are pushing in the things.
The is the sketch of my pinball machine. I want to make it big enough to where I can use it in my room so the length is thixrty six inches, the width is twenty four inches , The back is six inches, the top of the back is one inch the height of the perimeter is two inches, the bottom front is one inch. The height off the ground is five inches and the slope of the machine will be eight inches/
The is a picture that I took from the front of my prototype. The front is two inches tall.
The is a picture from the left showing the arch I added in. It starts at six inches and then goes down to two.
This is a picture from the back of my project. The back is six inches tall.
This is the arch from the right side it also goes from six inches to two.
This is a picture from the back of my box I had to tape some spots to make sure they will full and it is thirty six inches in length and is twenty four inches in width.
This is a picture from the top of my project.
This is my project drawn out on my board.
Below is my working flipper it has a dowel that pushes through and makes the flipper move. There is a rubber ban attached toa thumbtack to keep it in place. It goes through a lane that is held up by cardboard pushes the flipper and then the flipper goes back to normal.
This is a picture of the V that makes the ball go to the flippers.
Below is a video showing how my flippers function. They both work but as I was recording this the right rubberband broke again.
This shows the back of my pinball machine and how the flippers function. For each side a dowel goes through a channel that pushes the cardboard attached to the flipper and the rubber band makes it comeback. The one on the rights rubberband broke.
This one uses a dowel that has a rubber band on it so that when they push it it will go back.
This one has a stick that pushes the ball and two rubber band to make it come back.
This one uses a dowel and a sping which one pushes the ball and the other makes it come back.
This one is made out of a metal rod and a spring. You push the metal mod to move the ball and the spring puts it back in place.
This is my completed pinball launcher. It launches the ball up to the back of the board. It has two lines of cardboard helping it stay where it is. It has two rubberbands and dowels that push it.
I like how these had big circlue bumpers and circles leading up to it.
I picked this one because of the wedges they have in the top left.
I like how they have differnt things as the V and how the top has a ramp.
I picked this one bcause of the design of it I like how the had a big random thing in teh middle of it with the circles.
I like how their top left and top right arent the same things so maybe I'll change that.
I like how this one had the board open and it was basic. I could use this if I was trying to make it easier.
I like how they have things in the back that the ball can hit ,go through or over.
I like how this one has an arrow popping out of the thing.
This is my board layout drawn on my board with pencil. There is a ramp, bumpers and triangles.
We only need three wires to get the neo pixal to work. It is shown above.
This is a video of my funtioning neopixel.
// 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 is the circuit diagram for the working touch sensor I uploaded mine after I added the servo.
This is a video of my functioning Touch Sensor. I finished it after I plugged in my servo.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4, 6);
CapacitiveSensor Sensor2 = CapacitiveSensor(4, 5);
long val;
int pos;
#define led 13
void setup(){
Serial.begin(9400);
pinMode(led, OUTPUT);
}
void loop(){
val = Sensor.capacitiveSensor(30);
Serial.println(val);
if (val >= 1000 && pos == 0)
{
digitalWrite(led, HIGH);
pos = 1;
delay(500);
}
else if (val >= 1000 && pos == 1)
{
digitalWrite(led, LOW);
pos = 0;
delay(500);
}
delay(500);
}
This is the circuit diagram with now the servo added.
This is my touch sensor controlling my servo.
//set pin numbers
//const won't change
const int ledPin = 13;
const int ldrPin = A0;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
int ldrStatus = analogRead(ldrPin);
if (ldrStatus <=300) {
digitalWrite(ledPin, HIGH);
Serial.println("LDR is DARK, LED is ON");
}
else {
digitalWrite(ledPin, LOW);
Serial.println("---------------");
}
}
This is the circuit diagram.
This is my photo resistor controlling a LED.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4, 6);
long val;
int pos;
#define led 13
#include<Servo.h>
int servoPin = 2;
Servo SensorServo;
const int ledPin = 13;
const int ldrPin = A0;
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
SensorServo.attach(servoPin);
pinMode(ledPin,OUTPUT);
pinMode(ledPin,INPUT);
}
void loop()
{
int ldrStatus = analogRead(ldrPin);
val = Sensor.capacitiveSensor(30);
Serial.println(val);
if (ldrStatus <=300) {
digitalWrite(ledPin,HIGH);
Serial.println( "LDR is DARK, LED is ON");
}
else{
digitalWrite(ledPin,LOW);
Serial.println("---------------");
}
if (val >= 1 && 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(500);
}
delay(20);
}
This is the circuit diagram of the photoresistor
// 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 is my circuit diagram for the neopixel.
This is my neopixel in my board.
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
modified 7 Nov 2016
by Arturo Guadalupi
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/LiquidCrystalHelloWorld
//https://ictronic.wordpress.com/2016/07/02/interfacing-16x2-lcd-with-arduino-without-potentiometer/ but use 4 and 5 instead of 0 and 1
*/
// include the library code:
#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, world!");
}
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);
}
This is teh circuit diagram for the score board.
This is my working scoreboard.
This is my scoreboard that counts when something is tripped on my pinball machine.
This is the drawing for my prototype.
This is my fully documented prototype. It has working flippers at the bottom that move as you push them. It has a ball launcher that works when it is pulled back. It has a photoresitor in the board that it used to count up the score. It has a neopixel in there just for design. The game box is stable and the edges keep the ball on.
The brief is for identifying what you want to do. This is the first step of every project. The flippers hit the ball back onto the board. I want to make flippers that move when they are pushed but also go back into place. This is one of the main functions of the machine.
The research part is for learning about what the flippers do and how it functions. This is the second step. I had to learn what system would I use that would make them fall back into place when I pushed them. I looked up youtube videos and pictures. They showed many different ways to do it using rubber bands. With how big my project was I had to come up with an idea to put it together.
The idea development part of the project is where you come up with ideas of how you are going to do it and put it together. This is the third step I came up with the idea to put rubber bands of pins attached to the bottom of my board. Since the back parts of the flippers were attached to rubber bands it would go back into place. I also thought about building stuff around it so the ball would not get loose.
The 3D prototyping is where you start to build using the ideas that you had. This is the fourth step. You use free or cheap materials. It is like a rough draft of the final project. I put the pins into my board and attached the ends of a rubber band to the pin and to the back of the flippers. I also build a V shape around it so the ball would not go out of place which worked well but had a lot of glue. We stacked four flippers together to make it work better. It is kind of different because we had the main material first. We just had to figure out how to make it work.
This is the part where you make it and test it to see if it works. This is the fifth step. You see where you are at compared to where you want to be. Then you try to get closer to that. When I pushed the flippers with the wooden sticks in went back into place like I thought it would. I did have some issues because of the way that I made the channels that they went through.
This is where you evaluate your final product and make modifications. This is the last and sixth step. The overall function worked well but because of the size of the channels, it did not work every time. To fix this I put paper in the holes. The rubber bands also constantly broke so I had to replace them. We normally would change the materials but since we were already using them it was also different.
My definition of engineering is creating. It's all about creating ideas to fix problems. There are also times where you can create just to create. I have learned a lot about coding things and building projects.
Engineers impact the world by making it a better place with their inventions. They could make something simple like a place to put things like a box. They could also make something fun or cool to look at like a corn hole board. They make the world different and help advance the world.
The project I found the most challenging was the Moirae board. There was a lot of printing out and coding. I would constantly have to reprint because of the design I chose. I had to change the way it was made and how the stars were. I also had to come after class to get extra help.
The project I enjoyed the most was the cornhole board. I think I enjoyed it the most because I sold it. It was fun to see how that would work and competing with other teams to convince someone to buy my board. It also explained how you would get a profit based on how you got the materials.
I liked how the class almost always had a way for you to get in more hours on your projects. I also liked how a lot of stuff was online so I could not lose it. I liked how it wasn't a loose presentation and you helped us present our projects.
I would change some of the projects to slightly easier ones just based on how hard it was adjusting to coming into this class. I was at a disadvantage for the building parts because some of the materials we got for our box were broken. It was easier for me to understand some of the code because my dad knew it and I took classes for it but just coming in if I did not take those classes It would be even harder.
In college, I am thinking about studying music or computer science. I had engineering as a top thing when I began high school but over time the interest changed and I wanted to do other things. This class showed me how an engineer could help the world but it also showed me how hard it was if you weren't a pro at it. Overall this class taught me a lot.