This is the kit that we recieved at the start of the school year to complete projects at home due to the coronavirus. The part list is below.
Laser Cut Parts
A-B Cable
Arduino Nano
(2) Metal Gear Servos
(2) Plastic Gear Servos
White Servo Horns (for Plastic Gear Servo)
Black Servo Horns (for Metal Gear Servos)
Laser Cut Parts
(6) 2mmx50 mm metal rods.
(3) 2.5mmx12 mm screws
(3) 2.5 mm nuts
Jumper Wires
Breadboard
The project brief allows us to understand the project or the problem that we are trying to solve. Here it describes the automation of a drawbot which is our first project of the year.
This document decribes our first project of Engineering Concept. We will be building an automatic drawbot for this project.
These are the steps that we have to complete as we go through the project.
This is a circuit diagram. The purpose of creating circuit diagrams is to have an image that will work universally.
This is a circuit picture. The purpose of creating a circuit picture is to depict the layout of the component and wiring. It can also be used for the maintainance of electrical and electronic components.
The research phase allows us to understand the needs of the client and other competitive products. In this case, it would be other drawbots made with arduino that runs off of code.
This drawbot uses two servo motors and it draws using sound sensor to move the servo motors in order to draw. It can turn any sound into art. There are also a way for you to convert your art/photo into an audio file that you can use. It includes a battery pack, screws, plastic servo horns and an audio cable.
This is a circuit picture with two servos. The purpose of this image is to create a simple layout of the actual circuit with two servos. It includes two servos, a bread board and an arduino.
This drawbot is called the Polar Drawbot. It is made of various 3D printed parts to created a robotic arm that you hang from a chain for it to move freely. It has one servo motor and uses a coordinate system combined with coding to create any art piece.
This phase is where we would come up with a plan to complete the project. In this case, we selected a similar project plan and built our drawbot based off of it. The project plan that we selected had to fit the requirements of the project which was including motors and arduinos.
I am proceeding with this research idea because it fits the requirement of the project. It is a drawbot with 2 motors that are only required to spin 180 degrees. It can be hooked up to an arduino and the design is made out of parts that we have received.
During this phase, we would build our final product with cheap and easily replaceable materials. We didn't do this process for this project as we didn't have access to the 3D printer but we did complete prototype designs on thinkercad. The image is listed below in circuit picture.
During this phase, we tested our products and made changes that were needed. We did the testing portion for this project which was the coding portion for me. The code and evaluation video of the prototype moving is listed below.
During this phase, we created our final product and presented our final products. For this portion, we recorded videos of our product working and explained the parts and coding behind the project. The video is listed below in final drawbot presentation video.
Circuit Diagram
This is my circuit diagram that contains two servos. Each servo are connected to 5v, ground and individual pins.
Circuit Picture
This is my circuit picture with two servos. The purpose of this image is to create a simple layout of the actual circuit with two servos. It includes two servos, a bread board and an arduino.
Two servos functioning video
This video shows my test code which allows for both of the servos to move individually. This also shows the test drawing made by the code.
Code
This is my testing code for the two servos. It move the two servos independently.
#include <Servo.h>
Servo servoLeft; // Define left servo
Servo servoRight; // Define right servo
void setup() {
servoLeft.attach(9); // Set left servo to digital pin 10
servoRight.attach(10); // Set right servo to digital pin 9
}
void loop() { // Loop through motion tests
a(); // Example: move forward
delay(2000); // Wait 2000 milliseconds (2 seconds)
b();
delay(2000);
c();
delay(2000);
d();
delay(2000);
}
// Motion routines for forward, reverse, turns, and stop
void a() {
servoLeft.write(10);
servoRight.write(70);
}
void b() {
servoLeft.write(10);
servoRight.write(30);
}
void c() {
servoLeft.write(50);
servoRight.write(30);
}
void d() {
servoLeft.write(10);
servoRight.write(30);
}
Elbow servo and upper arm servo- These servos moves the pen holder and are controlled by the arduino.
Arduino- The motherboard of the drawbot, is controlled by code and powered by the AB cable.
Breadboard- The connector board for electric circuits. For this project, the breadboard is allowing power and ground to be shared between two servos since we are using a smaller version of the Arduino motherboard.
AB Cable- Provides power to the Arduino and also allows for code to be transfer from the Arduino IDE software to the Arduino motherboard.
Pen Holder- Holds a pen or a marker to keep it stable. It is connected to the upper arm servo which allows for it to move.
The research phase allows us to understand the needs of the client and other competitive products. In this case, it would be other robot arms made with arduino that runs off of code.
This is a robot arm with 4 servos. It looks like a design that we could do with the parts in our engineering kit. This is also controlled by an Arduino.
This is another robot arm with 4 servos. I believe that this could be a more advanced design that we could attempt if we brought joystick and focused on coding more so that we can control the robot through joysticks rather than normal commands through coding. This design is also controlled by an Arduino.
This design is closer to a prototype of the actual robot arm as it is made out of less costly materials. We could also use this design as it is controlled by an Arduino. It has the advantage of being a simpler design as well.
This is a circuit diagram that we could base our robot arm on. It is going to be a little more challenging as we don't have a battery pack which means that we will just have to wire our 5v and ground to four seperate servos instead of powering them with a battery pack.
This is the base of the robotic arm. It is made out of wooden pieces and two servos.
This is what we worked on today for our robot arm. We constructed the base and added a few arm pieces.
This is a video of the calibration of both arm servos. It is used to find the full range of motion that can be done with the servos. This also includes a code to make the arms move at an increment to protect it from breaking.
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos= 80;
int rightpos= 60;
int basepos= 90;
int clawpos= 90;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void Down(){
for (rightpos= 90; rightpos<= 160; rightpos+= 1)
Right.write(rightpos);
delay(15);
}
void Up(){
for (rightpos= 110; rightpos<= 160; rightpos+= 1)
Right.write(rightpos);
delay(15);
}
void Forward(){
for (leftpos= 110; leftpos<= 160; leftpos+= 1)
Left.write(leftpos);
delay(15);
}
void Back(){
for (leftpos= 90; leftpos<= 160; leftpos+= 1)
Left.write(leftpos);
delay(15);
void loop(){
Down();
delay(1000);
Up();
delay(1000);
Forward();
delay(1000);
Back();
delay(1000);
}
This is a video of the robot completing the motions up, down, forward and back.
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos ;
int rightpos;
int basepos;
int clawpos;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void loop() {
Right.write(110);//forward
delay(1000);
Right.write(70);//back
delay(1000);
Left.write(90); //down
delay(1000);
Left.write(130); //up
delay(1000);
Base.write(90); // left
delay(1000);
Base.write(10); // right
delay(1000);
//Claw.write(45); //open
//delay(1000);
// Claw.write(75); //close
// delay(1000);
}
This is a video of the robot completing the motions up, down, left, right, forward, and back.
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos ;
int rightpos;
int basepos;
int clawpos;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void loop() {
Right.write(110);//forward
delay(1000);
Right.write(70);//back
delay(1000);
Left.write(90); //down
delay(1000);
Left.write(130); //up
delay(1000);
Base.write(90); // left
delay(1000);
Base.write(10); // right
delay(1000);
//Claw.write(45); //open
//delay(1000);
// Claw.write(75); //close
// delay(1000);
}
This is a video of the claw opening and closing. The claw is attached to the arm and is controlled by a servo connected to a set of gears.
This is a video of the robot completing the following motions: forward, back, up, down, left, right, open and close.
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos ;
int rightpos;
int basepos;
int clawpos;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void loop() {
Right.write(110);//forward
delay(1000);
Right.write(70);//back
delay(1000);
Left.write(90); //down
delay(1000);
Left.write(130); //up
delay(1000);
Base.write(90); // left
delay(1000);
Base.write(10); // right
delay(1000);
Claw.write(45); //open
delay(1000);
Claw.write(75); //close
delay(1000);
}
This is a video of the robot reaching all the way (full extension) to the left, grapping an object (without help) and then retracting and swinging to the right and placing the object in a fully extended location to the right.
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos ;
int rightpos;
int basepos;
int clawpos;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void loop() {
Claw.write(45);
delay(1000);
Base.write(180); // left
delay(1000);
Right.write(110);//forward
delay(1000);
Left.write(90); //down
delay(1000);
Claw.write(45); //open
delay(1000);
Claw.write(75); //close
delay(1000);
Left.write(130); //up
delay(1000);
Right.write(70);//back
delay(1000);
Base.write(60); // right
delay(1000);
Right.write(110);//forward
delay(1000);
Left.write(110); //down
delay(1000);
Claw.write(45);
delay(1000);
}
This is a circuit picture with four servos. The purpose of this image is to create a simple layout of the actual circuit with two servos. It includes four servos, a bread board and an arduino.
This is the final circuit diagram of my robotic arm. The purpose of creating circuit diagrams is to have an image that will work universally.
Pseudo code is code for computer written in human words rather than computer words.
A real life example of this would be: Take in groceries from car.
Function Definition:
1. Unlock & open car trunk
2. Pick up groceries
3. Close car trunk
4. Lock car trunk
5. Move towards house
6. Open house door
7. Drop groceries
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos ;
int rightpos;
int basepos;
int clawpos;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void Extend () {
Right.write(110);//forward
delay(1000);
Left.write(90); //down
delay(1000);
}
void Pickup () {
Claw.write(45); //open
delay(1000);
Claw.write(75); //close
delay(1000);
}
void loop() {
Claw.write(45);
delay(1000);
Base.write(180); // left
delay(1000);
Extend();
delay(1000);
Pickup();
delay(1000);
Left.write(130); //up
delay(1000);
Right.write(70);//back
delay(1000);
Base.write(60); // right
delay(1000);
Extend();
delay(1000);
Claw.write(45);
delay(1000);
}
This video shows the first two parts of coding done on the robot following the jingle bells song.
This video shows the robotic arm dancing to Jingle Bells Rock with coding that is designed to make the robot move in sync with the music.
#include <Servo.h>
Servo Left;
Servo Right;
Servo Base;
Servo Claw;
int leftpos = 90;
int rightpos = 90;
int basepos = 90;
int clawpos = 75;
void setup() {
Left.attach(10);
Right.attach(9);
Base.attach(11);
Claw.attach(8);
}
void loop() {
Claw.write(75);
delay(1000);
for (rightpos = 90; rightpos >= 70; rightpos -= 1) { //
Right.write(rightpos);
delay(15);
}
delay(1000);
for (leftpos = 90; leftpos <= 130; leftpos += 1) {
Left.write(leftpos);
delay(15);
}
delay(1000);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(100);//left
delay(100);
Base.write(80);//right
delay(100);
Base.write(90);//center
delay(100);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
for (rightpos = 70; rightpos <= 115; rightpos += 1) {
Right.write(rightpos);
delay(25);
}
delay(1000);
for (leftpos = 130; leftpos >= 70; leftpos -= 1) {
Left.write(leftpos);
delay(15);
}
delay(1000);
Claw.write(75);
delay(1000);
for (leftpos = 70; leftpos <= 130; leftpos += 1) {
Left.write(leftpos);
delay(15);
}
delay(1000);
for (rightpos = 115; rightpos >= 70; rightpos -= 1) {
Right.write(rightpos);
delay(25);
}
Base.write(60);
delay(1000);
Base.write(120);
delay(1000);
Base.write(60);
delay(1000);
Base.write(90);//center
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Claw.write(75);
delay(1000);
Claw.write(45);
delay(1000);
Base.write(55);
delay(1000);
Base.write(125);
delay(1000);
Base.write(55);
delay(1000);
Base.write(125);
delay(1000);
Base.write(55);
delay(1000);
Base.write(125);
delay(1000);
Base.write(55);
delay(1000);
Base.write(125);
delay(1000);
Base.write(55);
delay(1000);
Base.write(125);
delay(1000);
Base.write(55);
delay(1000);
Base.write(90);
delay(1000);
for (rightpos = 70; rightpos <= 115; rightpos += 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 115; rightpos >= 70; rightpos -= 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 70; rightpos <= 115; rightpos += 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 115; rightpos >= 70; rightpos -= 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 70; rightpos <= 115; rightpos += 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 115; rightpos >= 70; rightpos -= 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 70; rightpos <= 115; rightpos += 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
for (rightpos = 115; rightpos >= 70; rightpos -= 1) {
Right.write(rightpos);
delay(15);
}
delay(1000);
}
In this step of the design process, we are preparing for the project by about the project and its requirements. For this step, I learned about the size of the pinball machine body and its constrincts. The pinball body has to be 18"by24" and the gameboard had to be sturdy. It also had to include a backboard that was listed 4" above the gameboard.
This is an example of what our pinball machine will look like.
These are the requirements for the pinball machine.
The final pinball machine will have these elements.
These are the mastery skills that we have to demonstrate.
This is the step in the design process where we collect and analyze data related to the project itself. In this process, we looked at many different types of gameboards and those gameboards were divided into different levels of difficulty. I was able to research several different design that I took inspiration from that was built in both wood and cardboard. I was also able to see what out final goal would probably look like from the professional boards.
Professional Arcade Grade Pinball Machines
This is a fully functional machine with multiple complex designs.
This is another complex machine that could be used at an arcade. The size of this machine is 58 x 29 x 76 in.
This pinball machine features LED and other tunnels to create a fun pinball game.
Homemade Wooden Pinball Machines
The machine uses two handles on the side to control the flippers.
This is a different pinball design without flippers.
This machine features levers attached to strings to control the flippers and collects the ball at the bottom.
Homemade Prototype Cardboard Pinball Machines
This is the most basic pinball machine with manual flippers.
The flippers are attached to the sides and there is a spring to launch the ball.
The machine includes a hole at the bottom to collect the ball.
In this step of the design process, we began to create our own idea. In this step, I drew a sketch of the pinball machine and made it proportional by size. The sketch also included dimensions in order to fit the criterias of the pinball machine. This was essentially the blueprint of my pinball machines.
This is the sketch of my design plan. The gameboard would be 24" by 18". The height would be elevated by 4 inches from the front to the back to create a slope for the ball. There would also be an one inch lip to contain the ball. The backboard is going to be 6".
This is the step in the in the design process where we build our gameboard based on our idea. In this step, I was able to cut out cardboard pieces that fit the size of the project constrincts. The was the first prototype of my pinball machine that was also scaled to the drawing of my pinball machine.
This is the prototype of my pinball machine with an image from each side of the prototype.
These are my working flippers. They are controlled by buttons on the side of the machine which are connected to a mechanism on the bottom. The mechanism is then connected to the flippers causing them to turn when the button is pushed. The mechanism can also reposition itself back to the original position using rubberbands.
This is my pinball launcher. It is a simple "spring" mechanism on a dowel attached to cardboard to create more surface area to hit the ball.
These are 4 videos that explains the fundamentals of pinball launchers.
This video explains why the plunger works and the 4 parts of the plunger: rubber, springs, a resistance in the center and a puller at the end. When you pull on the plunger, it will create a force in the center that eventually bounces off from the springs to the pinball itself.
This video shows you how to make a homemade pinball machine with basic parts. I can replaces springs with rubberbands and create the other parts out of cardboard.
This video shows where to place the plunger and how to replace/repair it. It is a design that was featured in the previous videos.
This is a more complex design for a plunger as it has a holder for the additional balls along with a stopper to prevent them from entering the plunger tube.
In this step of the design process, we are testing and getting peer feedback. In this step, we looked at everyone's pinball and was able to compare in order to make our final product better or more usable. In this step, we were also able to look at flippers and pinball launchers and were able to improve on these parts.
This is the circuit diagram for the Neopixel which is connected to the Arduino board with 3 wires.
Video of functioning Neopixel
#include <Adafruit_NeoPixel.h>
// 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 9
// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 60
// 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 capacitive sensor with a resistor wired up to a piece of metal attached to an Arduino board used to controll the LED.
Video of functioning capacitive sensor used to controll a LED.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4, 6);
CapacitiveSensor Sensor2 = CapacitiveSensor(4, 5);
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 >= 100 && pos == 0)
{
digitalWrite(led, HIGH);
pos = 1;
delay(500);
}
else if (val >= 1000 && pos == 1);
{
digitalWrite(led, LOW);
pos = 0;
delay(500);
}
delay(10);
}
This is the circuit diagram for the capacitive sensor with a resistor wired up to a piece of metal attached to an Arduino board used to controll the servo motor.
Video of using a capacitive sensor to controll a servo motor.
#include <CapacitiveSensor.h>
CapacitiveSensor Sensor = CapacitiveSensor(4, 6);
long val;
int pos;
#define led 13
#include <Servo.h>
int servoPin = 9;
Servo SensorServo;
void setup() {
Serial.begin(9600);
pinMode(led,OUTPUT);
SensorServo.attach(servoPin);
}
void loop() {
val = Sensor.capacitiveSensor(30);
Serial.println(val);
if (val >=20 && pos == 0)
{
digitalWrite(led, HIGH);
pos=1;
SensorServo.write(90);
delay(500);
}
else if (val >= 20 && pos ==1)
{
digitalWrite(led, LOW);
pos = 0;
SensorServo.write(0);
delay(500);
}
delay(10);
}
This is the circuit diagram for the photoresistor used to controll the LED. It also includes two resistors connected to each part of the circuit.
Video of a functioning photoresistor used to controll a led.
const int ledPin = 12;
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 for the LCD wired up to an Arduino.
Picture of a functioning scoreboard wired up to an Arduino.
/*
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 the final step of the design process where we create the final product. In this step, we usually add on more creative elements to the final project to create a quality project. In this process, I was able to paint the finishings of my pinball machine and add the final components to the pinball machine.
Deep Dive of the Design Process
In this step of the design process, we are preparing for the project by about the project and its requirements. For this step, I learned about the size of the pinball machine body and its constrincts. The pinball body has to be 18"by24" and the gameboard had to be sturdy. It also had to include a backboard that was listed 4" above the gameboard.
This is the step in the design process where we collect and analyze data related to the project itself. In this process, we looked at many different types of gameboards and those gameboards were divided into different levels of difficulty. I was able to research several different design that I took inspiration from that was built in both wood and cardboard. I was also able to see what out final goal would probably look like from the professional boards.
In this step of the design process, we began to create our own idea. In this step, I drew a sketch of the pinball machine and made it proportional by size. The sketch also included dimensions in order to fit the criterias of the pinball machine. This was essentially the blueprint of my pinball machines.
This is the step in the in the design process where we build our gameboard based on our idea. In this step, I was able to cut out cardboard pieces that fit the size of the project constrincts. The was the first prototype of my pinball machine that was also scaled to the drawing of my pinball machine.
In this step of the design process, we are testing and getting peer feedback. In this step, we looked at everyone's pinball and was able to compare in order to make our final product better or more usable. In this step, we were also able to look at flippers and pinball launchers and were able to improve on these parts.
This is the final step of the design process where we create the final product. In this step, we usually add on more creative elements to the final project to create a quality project. In this process, I was able to paint the finishings of my pinball machine and add the final components to the pinball machine.
(All documentation is listed above)
Final Reflections
1) What is YOUR definition of engineering after having taken the engineering pathway (do not look it up, this is not about looking it up, this is about what you are leaving here with in terms of perspective/understanding?
2) How do engineers impact the world?
3) Which project did you find the most challenging and can you describe why, and also how you were able to overcome the challenge (really try to think back through the years).
4) Which project did you enjoy the most in your engineering pathway, and can you describe why?
5) What did you like about how the class was setup/planned/delivered?
6) What would you change (it is ok, be honest). :)
7) What do you think you might study in college and has your experience in engineering class had an impact on that? Be honest!
My definition of engineering is to find a problem that needs to be solve and solve it by using information and tools that we know to create the solution to the problem. Engineers impact the world by improving it through solving problems in new and innovative ways. I think the project that I found to be the most challenging was the kinetic sculpture because it had to be made perfectly or else parts of it would just work poorly, I think everyone overcame it by having their own small modification to the project. I enjoyed the robotic arm the most because it was the most practical project out of all of the projects that we've worked on. Back when we had school in person, I loved how everything in the classroom was document or checked by students before the class and after the class. For this year, I would change the how projects were documented, I believed that we documented too much and some of the documentation were just not necessary. I'm not sure what I might study in college, but the problem solving skills that I've acquired from engineering class will always be used regardless of the class I'm taking.