in this project were going to learn about robotics and there contexts in the world
In the end of this project I will have a rolling robot that I created that I can control with my phone
Today we practiced wiring up a servo and Arduino using tinker cad and we also learned where to find out own starter code!
/* 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
}
}
In order to make my servo work I had to get a red and black wire , plug the red wire in 5V then plug the black one in ground for the 3rd wire I plugged it into 9D so I plugged the cord into my computer then put the code into Arduino then pressed verify then upload and it worked
I basically did the same thing I did with the first servo moving back and forth I plugged the red and black wires behind the first red and black wire and I also did the same with the 3rd wire.
In order to make it move independently you have to modify the code. I learned that 0 is the max speed the servo goes to the left and 180 is the max speed the servo goes to the right to make it stop you place a 90 in the brackets.
#include <Servo.h> // this refers to a "library" that knows how to control servos
Servo myservo; // defines a "servo" objec and names it "myservo"
Servo secondservo; // defines a "servo" object and names it "secondservo"
//int pos = 0;
void setup() {
myservo.attach(9); // attach the "servo" object named "myservo" to pin 9
secondservo.attach(10); // attach the "servo" object named "secondservo" to pin 9
}
void loop() {
myservo.write(0); //make the "servo" object named "myservo" rotate at full speed counterclockwise
secondservo.write(180); //make the "servo" object named "myservo" rotate at full speed counterclockwise
// in order to make the servo go clockwise at full speed use "180" as the number
delay(500);
myservo.write(90); //make the "servo" object named "myservo" rotate at full speed counterclockwise
secondservo.write(90); //make the "servo" object named "myservo" rotate at full speed counterclockwise
delay(500);
}
Before I started wiring the actually Arduino I had to set the wires up in tinker cad so I can get a idea of how the actual thing should look. When I finished the tinker cad I started to wire the actual Arduino placing the wires and it started to run on batteries.
So this time instead of coding we started to build the robot so I started by gathering materials such as cardboard, tape, and wood wheels. So I cut the cardboard into a small plank so I can fit my battery, servo and breadboard then I hot glued the battery, breadboard and the servo together then I plugged the battery cord in the breadboard.
I made it move forward, backwards, left and right by modifying my code in order to make it move forwards I had to put 180 , 0 in the code in order for it to move backwards I placed 0,180 in the code for left and right I put 180, 180 for left and 0, 0 for right.
void setup() {
leftservo.attach(9); // attach the "servo" object named "myservo" to pin 9
rightservo.attach(10); // attach the "servo" object named "secondservo" to pin 9
}
void loop() {
leftservo.write(0); //make the "servo" object named "myservo" rotate at full speed counterclockwise
rightservo.write(180); //make the "servo" object named "myservo" rotate at full speed counterclockwise
// in order to make the servo go clockwise at full speed use "180" as the number
delay(5000);
leftservo.write(180); //make the "servo" object named "myservo" rotate at full speed counterclockwise
rightservo.write(0); //make the "servo" object named "myservo" rotate at full speed counterclockwise
delay(5000);
leftservo.write(180); //make the "servo" object named "myservo" rotate at full speed counterclockwise
rightservo.write(180); //make the "servo" object named "myservo" rotate at full speed counterclockwise
delay(5000) ;
leftservo.write(0); //make the "servo" object named "myservo" rotate at full speed counterclockwise
rightservo.write(0); //make the "servo" object named "myservo" rotate at full speed counterclockwise
delay(5000) ;
leftservo.write(90); //make the "servo" object named "myservo" rotate at full speed counterclockwise
rightservo.write(90); //make the "servo" object named "myservo" rotate at full speed counterclockwise
delay(5000) ;
}
This was a very challenging process I had to face many trials and errors to make my robot traverse a path I had to test my robot making go back and forth to figure out how to make it go the amount of distance and time for it to move through the lines correctly.
In order to make the ultra sonic sensor work I had to modify function and ultra sonic code and merge them together then I had to follow the wiring instructions on Arduino library. When I finished wiring I went to serial monitor to make sure the sensor worked then put my hand in front of it and watched avoid my hand.
So a gear box has a parent and a child the parent drives the child and the child is being driven so the parent is attached to the servo which makes it move they're also know as driven and drive gears.
#include <Servo.h> // incude in any code that incudes servos
//sensor define
const int trigPin = 4;
const int echoPin = 3;
// defines variables
long duration;
int distance;
Servo rightservo; //define a servo object and names it "firstsrevo"
Servo leftservo; // definded a "secondservo"
// int pos = 0;
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
rightservo.attach(9); //taches servo obecect to pin 9
leftservo.attach(10);
}
void foward() {
rightservo.write(180); //servo "firstsrevo" rotates full speed couter clockwises
leftservo.write(0); //in order to make the servo go clockwise at full speed use 180 as number
}
void backwards() {
rightservo.write(0); // 180 foward 0 backwards for robot
leftservo.write(180); //0 fowrds 180 back
}
void left() {
rightservo.write(0); // 180 foward 0 backwards for robot
leftservo.write(0); //0 fowrds 180 back
}
void right() {
rightservo.write(180); // 180 foward 0 backwards for robot
leftservo.write(180); //0 fowrds 180 back
}
void loop() {
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 < 6) {
right();
delay(550);
foward();
}
// foward();
// delay(1000);
// backwards();
// delay(1000);
// left();
// delay(2000);
// right();
// delay(2000);
}
#include <Servo.h> // this refers to a "library" that knows how to control servos
Servo leftservo; // defines a "servo" objec and names it "myservo"
Servo rightservo; // defines a "servo" object and names it "secondservo"
//int pos = 0;
void setup() {
leftservo.attach(9);
rightservo.attach(10);
}
void loop() {
leftservo.write(0);
rightservo.write(180);
delay(5000);
leftservo.write(90);
rightservo.write(90);
delay(5000);
leftservo.write(180);
rightservo.write(180);
delay(5000) ;
leftservo.write(0);
rightservo.write(0);
delay(5000) ;
}
In this course we had to traverse a specific path to get through the course we had to avoid walls in order to not loose points and it was easy over all it help me get better with using my robot on dabble
so with the table saw you have to follow the rules in green and DO NOT use the rules in red
wear safety goggles don't be in front of the saw blade make sure you clean up your area so you don't trip make sure to unplugged the things when your done
across 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
it removes material from the top of he materials to preform three functions
1reduce the thickness of your materials
2 make the material a uniform thickness
3 make your material smooth nice
Do wear ear protection near 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
Don't put fingers near the opening pass any material but wood through the planer pass wiped wood nail setscrews through the planer
what it does : 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 hands 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
DO
Do wear safety glasses make sure it is set for the apporiatie 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
DONT DO
put your fingers near the blade when it is plugged in assume the blade wont come cut of the material
it uses input from a cad file to cut or carve parts / pieces this is our most expensive tool
Do , run the dust collector , vacuum after use, wear ear protection , wear safety glasses , secure your material with screws or clamps , design around your screw
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 smooth out wood surfaces
DO wear safety glasses keep your sander moving at all times be careful not place sander on your skin
Don't operate the sander without asking first the teacher touch the sand paper while the sander is operational put the sander on the surface that can be damaged by the sander
Do - wear gloves , always stain over a drop cloths, put a small amount of stain on your rag , use cotton cloth to apply stain
Don't mix stains , leave staining materials cut always put them away leave stain rags out leave them in your container
i had to cut pieces to make them smaller so I could prepare it for the miter saw it was a process of push and cut easy and simple
it was a process of push and pull all we needed to do was push the wood through the machine and it came out like this
is it possible to make in class ? this is a electronic lock that uses a keypad to put in a password. it is possible to make in class if your have to supplies. so basically there's a push button that is on each row of the columns pressing the button will connect the row to the column so the row are made up of 0 which is the output and the columns are made up of 1 and its the input so pressing the button will set the column to 0 then the rows will be scanned by a digital 1 to determine which column was pressed
does it meet the requirements? yes indeed
is it possible to make in class ? yes it is possible to make in class we have access to all the materials he used in the video he used drill he used a laser cutter to cut out the pieces that was need to make the lock and he used glue and clamping .
does it meet the requirements? yes indeed
is it possible to make in class? yes it is because we have a table saw he used wood glue as well and everything else he showed in the video we have in the class room and also it didn't take him as long as the other videos to make it quick easy and simple and also effective
does it meet the requirements? yes indeed
is it possible to make in class Intractable you will find printing notes, assembly steps, instruction on how to pick and set a combination number, how it works and some of the challenges I encountered in designing this.
All 3D printed, fully functional, changeable combination, Pad Lock.
Combination can be changed to nearly any 3 digit 0 thru 9 combination.
Fun and educational for kids (and adults), but I wouldn't trust my life savings with it.
yes it meets the requirements
wood
screws
screwdriver
glue
table saw
drill
bandsaw
clamps
he explains how to make it and also the things that should be used to make it it
i made a few parts like the bolt the case im starting on the key its almost done took alot of glue n and cutting
i manage to make the lock work i shorten the key so I make it more smooth win i put it in a bull it out i also made it thicker
So this is the lock we made in class we had glue on certain parts to get it functional we had to make sure all the routers aligned in order to unlock and you twist knob and it slides in and slides out.
So in the video I explain how the lock works and the key things I need and how the lock works
So this was the first carboard prototype it is a wooden lock it mechanical it requires a rotor a key and the pins I had to make a board for the case to stand up on so it can lock the box and keep it from opening
these was all the parts of my lock it included the case, tumbler and lock casino I put it in the glow forge and laser cut it i had to first make the design in the on shape
this is the laser cut cardboard of the case I made the design in on shape and then used the laser cutter to cut it out then i hot glued the pieces together I had to get it approved so i could move on to the wooden version
this is my key that is made out of wood it had to use on shape to create the design and the laser cutter had cut it out for me I had to make it a certain size to make sure it fit with the rotor
this is the designs I made on on shape i had to use wood in the glow forge had to cut them out at certain sizes it was a process i had to go back and forth plenty of times but I managed
this is my fully finished lock i glued it to the top of the led so it could stay i cut a hole in the box for the rotor to fit through and so the key could reach the rotor i moved it closer to the end of the led i also made a plank to catch the rotor so it could lock
This is the video of my final presentation I had to present to MS white and show how it works and she also tested it out
What is machine Learning? Artificial intelligence systems are used to perform complex tasks in a way that is similar to how humans solve problems.
my model is attempting to identify a hair p ,soda can, phone and a jacket it suppose to identify this correctly i call them the 4 items
can
phone
pick
jacket
the computer took 1000 of pictures of my items it also have 48 by 48 pixels in each image
can
phone
sweatshirt
hairpick
the first 1 line This line of code is the starting tensor you send to the first hidden layer.
second line :This line of code Dense layer is the regular deeply connected neural network layer 1024 neutrons.
third line of code This line of code is a softmax function is used as the activation function in the output layer of neural network models that predict a multinomial probability distribution.
fourth line of code This line of code are input(s) of the model: a keras.Input object or list of keras.Input objects. ; outputs: The output(s) of the model.
fifth line of code to print a useful summary of the model
All accuracy was 100