Robots Robots and more Robots!
This project you will be building a robotic arm that you can control with 5 (DPDT) momentary switches. Instructions for how to assemble the switches can be found on the science page under instructions. You will also need to know how to assemble the 2" extend linear actuators. Which can be found on the mechanical page under instructions.
To get started look at the photo steps, you will need to buy some hardware to build the actuators, switches and the arm. You will need a total of 5 geared motors of your choice of rpm that are used with the linear actuators. You will need one 3/4" Square Aluminium tube that has to be cut down into 3 sections ( 9", 5" and 2 "). You will also need three 1/2" Aluminum rods cut down to 2" as well as lots of screws and bolts to hold everything together look at Step 1 in the photo steps to see all the hardware you need, however there is one thing missing on that picture and that is BBs. You will need about 160 BBs for this project.
Most the steps are easy to follow and should not be to hard if you go in the order that has been set out for you.
However Assembly of the controller might be a bit tricky. So lets talk about it. You will need to cut 5 sections of two conductor wire. I used lamp wire that you can get a most hardware stores. At a cost of about 8 US dollars. It is a good idea to have a 6 volt flashlight cell around when putting the switches in the controller, testing each motor as you go can save you a lot of trouble later on. You will need to solder everything together. If you look at step 52 it shows you how the switches should be set up. You can connect all the positive and all the negative together on all 5 switches and then connect it to a battery or a barrow connector of your choice to a power supply. I use a 2 mm barrow connector and a DC power supply I had on hand. After you get all the switches working you can then use 3/8 " flex tubing and make your wires look nice and out of the way. Then just put some juice to it and have fun! All in all I hope you find this project challenging!
Side Angle View
01/13
For this project you will need to have some knowledge of soldering, computer programming, and electronics. If you don't have any of these skill well, there is no better time to get started then today!. So you have the parts printed and ready to go. The first place you should start is connecting all the wires to the Arduino Nano. When looking at a servo you will see there are three wires coming out (Orange, Red, Brown) The orange is what needs to be connected to the arduino nano digital pin, I picked 7 and 9 to dive the servos. The red pin of the servo goes to positive and the brown pin goes to negative. Just a heads up if you connect the servos to the 5v and ground coming off the arduino it will not work. The problem is the servos push back EMF into the arduino nano causing it to reset...Yikes. This is why we have the two 1 amp diodes. Please review the circuit schematic for how things need to be wired. I took the long servo connectors and cut them down. And soldered the cut servo ends to the arduino directly with the diodes. This was so I could use the ends to connect to the sensors. This way you don't have to make any connectors, you just use the ones that came with the servos.
So you got her all wired up! Now what? Lets get some more parts you will need 4 small nails around 2 mm in diameter and two larger nails around 4 mm in diameter. Four 1 inch 4-40 screws, two 1/2 inch 4-40 screws and six plastic screws. For a list of tools please look at the hardware picture gallery.
Next you should tap the 6 holes on Part D and Part C. The other holes should be large enough that you can use the plastic screws that came with the servos in order to hold the sensors and servos on. Now simple look at the photo steps and put this little robot together.
For the last step you will need to program the arduino. There is a sample code below that can be used for this project. ( Hint you will need to calibrate the sensors in-order for this to robot to work!)
That's all there is to it! Hope you had fun with this project!
Electronic hardware you need.
01/12
#include <Servo.h>
Servo leftservo; // create servo object to control a servo
Servo rightservo; // create servo object to control a servo
int leftCenter = 90;
int rightCenter = 90;
void setup() {
leftservo.attach(9); // attaches the servo on pin 9
rightservo.attach(7); // attaches the servo on pin 7
pinMode(5, INPUT); // right LINE SENSOR ONE
pinMode(3, INPUT); // left LINE SENSOR TWO
Serial.begin(9600);
}
int leftcount = 0; // Increases the turning speed until it does max turn.
int rightcount = 0; // Increases the turning speed until it does max turn.
void loop() {
if(rightLineS() == 1 && leftLineS() == 1) { forward(45);
} // checks and sees if there is no white line then go forward.
//////////////////////////////////////////////////////////////////////////////////////////////
else if( rightLineS() == 1 && leftLineS() == 0 ) // checks and sees if it needs to turn left
{
leftcount = 0;
rightcount = rightcount + 50;
rightTurn(45,35);
delay(rightcount);
}
else if( rightLineS() == 0 && leftLineS() == 1 ) { // checks and sees if it needs to turn right.
rightcount = 0;
leftcount = leftcount + 50;
leftTurn(45,30);
delay(leftcount);
}
else if( rightLineS() == 0 && leftLineS() == 0) { forward(20); }
}// End of Void loop
void forward(int servoSpeed ) {
rightservo.write(rightCenter - (servoSpeed )-10); // WAS adjusted by 10 for the right servo, it ran slower then the other one. Remove and add for your own.
leftservo.write(leftCenter - (servoSpeed ));
}
void backward(int servoSpeed ) {
rightservo.write(rightCenter + (servoSpeed ));
leftservo.write(leftCenter + (servoSpeed ));
}
void rightTurn(int servoSpeed, int turnSpeed) {
rightservo.write(rightCenter - (servoSpeed ) );
leftservo.write(leftCenter - (servoSpeed - turnSpeed) );
}
void leftTurn(int servoSpeed, int turnSpeed) {
rightservo.write(rightCenter - (servoSpeed - turnSpeed ) );
leftservo.write(leftCenter - (servoSpeed ) );
}
int rightLineS () {
int val2;
val2 = digitalRead(5);
Serial.println(val2);
return val2;
}
int leftLineS () {
int val;
val = digitalRead(3);
Serial.println(val); // Reads a low over white
return val;
}
Need some help learning how to program well check out the Arduino website below, it has lots of helpful code and examples!
For this project you will need to know how to use a IR sensor and remote with an arduino. You can look at the sample code below to get you started. You will also need some hardware such as ten 1/2" 4-40 screws, four 1 inch 4-40 screws , 4-40 Tap Set, two 12-D nails, two LEDs, two 330 Ohm resistors, two 360 degree Servos with servo arms. small needles, wiring, batteries with case and tools.
You can use small rubber bands on the tracks to give the tracks more traction on smooth surfaces like wood floors.
By Downloading this File you agree to the "Terms of Use".
IR_Tank_Code_Sample (zip)
DownloadCopyright © 2018 -2021 3D-PFT LLC- All Rights Reserved