In this project
Today we learned how to wire a servo and how to control it.
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Today we used our code and design from our previous class to make an servo go back and forth.
Today we used our code and design from our previous class to make two servos go back and forth.
Today we used our code from a previous class and made changes to make two servos do independent movements.
Today we used our code from a previous class that was saved in the arduino and changed it's power source from a computer to batteries.
We have been working on using the arduino saved code and building upon it to make a cardboard prototype robot body.
We used arduino to formulate a code to make our prototypes go forward, back, left and right.
Forward:
Backward:
Left:
Right:
My prototype's attempt to get through the predesigned path.
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo leftservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
Servo rightservo;
int pos = 0; // variable to store the servo position
void setup() {
leftservo.attach(9); // attaches the servo on pin 9 to the servo object
rightservo.attach(6);
}
void loop() {
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(0); // tell servo to go to position in variable 'pos'
delay(4500);
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(90);
delay(1500);
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(0); // tell servo to go to position in variable 'pos'
delay(4500);
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(90);
delay(1500);
}
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo leftservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
Servo rightservo;
int pos = 0; // variable to store the servo position
void setup() {
leftservo.attach(9); // attaches the servo on pin 9 to the servo object
rightservo.attach(6);
}
void forward(){
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(0); // tell servo to go to position in variable 'pos'
}
void backward(){
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(180); // tell servo to go to position in variable 'pos'
}
void left(){
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(180);
}
void right(){
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(0);
}
void loop() {
forward(); // tell servo to go to position in variable 'pos'
delay(1000);
bckwards();
delay(1000);
left();
delay(1000); // waits 15ms for the servo to reach the position
right(); // tell servo to go to position in variable 'pos'
delay(1000); // waits 15ms for the servo to reach the position
}
Today we needed to take a chance by setting up a working UltraSonic Sensor from external websites code.
*
*/
// defines pins numbers
const int trigPin = 9;
const int echoPin = 10;
// defines variables
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}
*
*/
// defines pins numbers
const int trigPin = 9;
const int echoPin = 10;
// defines variables
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo leftservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
Servo rightservo;
int pos = 0; // variable to store the servo position
void setup() {
leftservo.attach(8);// attaches the servo on pin 9 to the servo object
rightservo.attach(6);
}
void forward(){
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(0); // tell servo to go to position in variable 'pos'
}
void backward(){
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(180); // tell servo to go to position in variable 'pos'
}
void left(){
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(180);
}
void right(){
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(0);
}
void loop() {
forward(); // tell servo to go to position in variable 'pos'
delay(3000);
right();
delay(1000);
forward();
delay(1000); // waits 15ms for the servo to reach the position
right(); // tell servo to go to position in variable 'pos'
delay(1000); // waits 15ms for the servo to reach the position
forward();
delay(1000);
left();
delay(1000);
forward();
delay(1000);
left();
delay(1000);
}
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo leftservo; // create servo object to control a servo
Servo rightservo; // twelve servo objects can be created on most boards
const int trigPin = 9;
const int echoPin = 10;
// defines variables
long duration;
int distance;
int pos = 0; // variable to store the servo position
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
leftservo.attach(8);// attaches the servo on pin 9 to the servo object
rightservo.attach(6);
}
void forward(){
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(0); // tell servo to go to position in variable 'pos'
}
void backward(){
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(180); // tell servo to go to position in variable 'pos'
}
void left(){
leftservo.write(180); // tell servo to go to position in variable 'pos'
rightservo.write(180);
}
void right(){
leftservo.write(0); // tell servo to go to position in variable 'pos'
rightservo.write(0);
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance= duration*0.034/2;
Serial.print("Distance: ");
Serial.println(distance);
if (distance < 3 ) {
right();
delay(1250);
forward();
}}
This pqage describes the requiremens for our Locbox project.
The table saw cuts wood primarily along the length of the wood (rip-cut).
Today we used the table saw to cut 2x4s into flatter pieces so that we can use them to make our
Do: Wear Safety Glasses
Remove Loose Clothing
Use Either The Rip
Don't:
Put your fingers within 6" of the blade when it is moving.
Cross cut with rip fence.
Stand right in front of the blade.
Operate with gloves on.
Leave it plugged in.
Operate with tripping Hazards in the area.
Don't leave without vacuuming.
The planer
Today we used the planer to flatten our wood pieces.
Do:
Wear eye protection. wear safety glasses.
Adjust the cutting thickness to within 1/16" of the material thickness prior to cutting.
Unplug when finished.
Attach the vacuum before use.
Wear safety goggles.
Don't:
Put fingers near the opening.
Pass any material but wood through the planer.
Pass wood with nails/screws through the planer.
It cuts across the length of the wood. This type of cut is called a cross cut!
1.) It can also cut at angles (Used to make frames for example).
Do:
Wear Safety Glasses.
Firmly secure the material with your hand outside of the hand placement line and up against the fence.
Vacuum after use.
Unplug the saw (In the classroom) after use.
Reduce exposure to blade.
Don't:
Touch or manually move the blade guard.
Cut material that requires your hand to be inside of the hand placement line (material is too short for this application).
Plug in the saw with the cord across the body.
Measure while material is on the saw.
Cuts "biscuit shaped" holes on your material so that you can assemble your parts to be both:
1.)Perfectly aligned
2.)Sturdy
Once you biscuit , you glue your pparts together creating what is called a "glue up".
Do:
Wear safety Goggles.
Make sure it is set for the appropriate size of biscuit.
Make sure you set the height in the middle of the material.
Mark both sides of the material.
Clamp a block in front of material each time.
Don't:
Put your fingers near the blade when it is plugged in.
Assume the blade won't come out of the material.
VCARVE PRO is used to develop simple designs for cutting/engraving.
Onshape files are used for more complex designs.
Shopbot software actually controls the machine and runs the CAD files.
Do:
Run the dust collector.
Vacuum after use.
Wear ear protection.
Wear safety glasses.
Secure your material (with screws or clamps).
Design around your screws
Don't:
Leave the CNC while it is running.
Don't go near the gantry while it is running.
Use/Function: Smoothes out flaws, and prepares wood for staining (smooths out wood surfaces). It can even resolve edges that didn't perfectly match up! YAY!
Do:
Wear Safety Glasses.
Keep your sander moving at all times.
Be careful not to place sander on skin.
Don't:
Operate the sander without first asking the teacher.
Touch the sand paper while the sander is operational.
This password Lock is battery powered and uses an arduino as well as a servo. The arduino will be wired to itself or a breadboard from a protective pad under the lock that was applied using what I assume to be a heat resistant/thermal glue/adhesive, The servo will be used to move the Lock and the two will be attached to make that possible using a Lever. Once the pysical components are set up I will need to code the correct code into the arduino. Once that's done it will open only to that code.
Yes because everything needed can be obtained on class.
In the video he uses a metal sliding lock. metal holder and a paper clip. When I do it I could replace those with a 3D printed slider, holder and lever. These changes will allow me to make the constraints that say I need 3 digitally designed components. I will be using TinkerCAD to get a clear visual of what am making. Since I'll be using the 3D printed counterparts instead of the metal items I believe it should help make it ore durable rather than having metal wear down over time with every use.
It acts as a Keypad Lock. After wiring up RFID to the breadboard and you need to setup the RFID tags. In order to assure that the RFID tags are setup correctly you should use two LEDS. Along with the held Lock components I will have to drill a lever that can be held by the servo that will be coded to move when the correct tag is over the sensor.
Most of the materials used are obtainable in class except for the RFID tags and the "RFID plate" in which if I decide to go down this route I could buy my own. I don't know if we have any resistors at school but I believe that we do.
Does it meet the constraints for this project and why? The sliding piece of the Lock and the 3D printed holder as well as the lever that will be attached to the servo. It will be designed on TinkerCAD.
To make it reliable and fully functional I will need to make a base for the arduino to sit in. I will be aided in this because I made my box a cube and double on all sides so I have a bit more space to work with.
There is a cut wood piece that is on the lock made to accept another input piece that was made to allow you to move it to the side and up to lock it. It's attached with nails.
This is feasible to make in class because we have the ability to woodwork in class. The nails can be
It acts as a Keypad Lock. After wiring up RFID to the breadboard and you need to setup the RFID tags. In order to assure that the RFID tags are setup correctly you should use two LEDS. Along with the held Lock components I will have to drill a lever that can be held by the servo that will be coded to move when the correct tag is over the sensor.
Most of the materials used are obtainable in class except for the RFID tags and the "RFID plate" in which if I decide to go down this route I could buy my own. I don't know if we have any resistors at school but I believe that we do.
Does it meet the constraints for this project and why? The sliding piece of the Lock and the 3D printed holder as well as the lever that will be attached to the servo. It will be designed on TinkerCAD.
To make it reliable and fully functional I will need to make a base for the arduino to sit in. I will be aided in this because I made my box a cube and double on all sides so I have a bit more space to work with.
Arduino
Servo
Resistors
Breadboard
Leds
Wire
RFID sensor
RFID Tags
RC 5 GT
3D printed pieces:
3D printed slider
3D printed servo holder
3D movement knob
Today we began prototyping the lock of our choice. I began by breaking down my robot in order to use some of my wires. I grabbed some extra breadboards in order to accurately wire up my lock. I did not finish but I have wired my LEDs, my resistors, my RFID RC522 and my arduino. I also began wiring my servos.
Do
Wear gloves.
Always stain over a drop cloth.
Put a small amount of stain on your rag.
Use cotton cloth to apply stain.
Don't
Mix stains.
Leaving staining materials out always put them away.
Leave stain rags out (Leave them in your container).
Waste gloves (place them inside out inside of your ziploc bag to reuse for the remainder of the project).
I created this Actuator design on Onshape by using the line and arc tools. I specifically used the center point arc to assure that it was even. I placed circles on the design in order to make holes. I used the dimension tool in order to make sure that it was accurate. This piece was then laser cut out of wood.
I created this Lock front design on Onshape by drawing a rectangle and placing an Arc. This was done by using the line and Arc tools. I added circles of different shapes to my Lock front in order to create holes on my design. I used the measurement tool to add dimensions to my document. This piece was then laser cut out of wood.
I created this Rotor design on Onshape by drawing a circle around the center point. I drew lines on the right side of my rotor with a center point arc in order to create the space for the Actuator to complete it's turn. I added a circle to the middle of my design in order to create a hole in my design for the dowel to go through. I also drew lines on the top left side of my design in order to create a space for the "notches" on my Lock. This piece was then laser cut out of wood.
To the left is a video describing the parts of my Functional Lock.
1.) Create your file in Onshape.
2.) Right click on the file (or sketch) and click export to DXF.
3.) Login to GlowForge (create your account if needed).
4.) Click create new.
5.) Click upload.
6.) Select your file.
7.) For Cardboard select 1/4" corrugated cardboard.
Today I finished wring my prototype RFID lock. I began coding my prototype on arduino but I got stuck on a issue with the libraries.
The Goal of my machine learning model is to detect what the item in an image is and to get it to be as accurate as possible. In my case it needs to accurately depict Bluetooth headphones, Earmuff Headphones, a Mouse and a Battery Pack.
The images on the left are my images collected on the computer that will be used in my code. I spun the object around as well as moved it back and forth in front of the camera. The process created 50 images for each item. The pixels in my images are 48x48.
Below I have my model accurately predicting 3 of my items. This was able to do this because I used my item data to train my model to get it as accurate as possible.
I am not able to provide this section because of how easy and varied the code/pictures were. After training it my predictions were 100% accurate. So, while I'm not able to provide these criteria this is the best outcome for my model.