Group Assignment
* Design a machine that includes mechanism + actuation + automation.
* Build the mechanical parts and operate it manually.
* Document the group project.
* Actuate and automate your machine.
* Document the group project
Individual assignment
* Document your individual contribution.
My Idea:
In this assignment I decided to make a robotic arm due to my need in teaching Robotics in the college.
I designed the arm using CorelDRAW and Inkscape softwares.
After that I cut the design using Laser cutter machine.
Assembling it using servo motors:
Finally, using an Arduino UNO to control the arm by sending commands via serial monitor:
First Code:
#include <Servo.h>
Servo myservo;
Servo myservo1;
int pos = 90;
void setup() {
myservo.attach(9);
myservo1.attach(6);
Serial.begin(9600);
myservo1.write(90);
myservo.write(90);
}
void loop() {
while (Serial.available() > 0) {
if (Serial.read() == 's') {
myservo.write(180);
}
if (Serial.read() == 'a') {
myservo.write(120);
}
if (Serial.read() == 'q') {
myservo1.write(180);
}
if (Serial.read() == 'w') {
myservo1.write(0);
}
}}
Test 1:
In this test I found a problem in the code, the Arduino doesn't response to the commands expect first one.
After reviewing the code I detect the error in reading from serial.
Final Code:
#include <Servo.h>
Servo myservo;
Servo myservo1;
char Val;
int pos = 0;
void setup() {
myservo.attach(9);
myservo1.attach(6);
Serial.begin(9600);
myservo1.write(90);
myservo.write(90);
}
void loop() {
while (Serial.available() > 0) {
Val= Serial.read()
if (Val== 's') {
myservo.write(180);
}
if (Val == 'a') {
myservo.write(120);
}
if (Val == 'q') {
myservo1.write(180);
}
if (Val == 'w') {
myservo1.write(0);
}
}}
Final Test:
After modifing the code it works good:
Download Links
Arm Design:
Arduino Code: