User:Jdassoulas/ENES-100 Group 1/arduinorobot

Arduino based Robot
Task: Build an arduino based robot with multiple behaviors

Resources

 * Build a Simple Arduino Robot


 * Step by step instructions guide on how to build an "obstacle avoiding" robot


 * Remote Control for Arduino

Week 1

 * The first week we decided on what our project would be. We chose to make an arduino robot with multiple behaviours. We thought through some ideas. One idea was to have a robot that would find the darkest area in the room, move to that area, and then light a lightbulb. Another group making an arduino robot suggested we make both our robots to battle each other. The idea we finally decided on was to make a simple obstacle avoiding robot, and if we got that behavior working, we were gonna add an LED light that would turn on whenever the robot went in an area under a certain light level.

Week 2

 * This week our group tried to gather as many parts that we would need, and then plan out a design for our robot. We had several ideas on how we will get the robot to turn. One idea was to have one motor in the back controlling two wheels, and one motor in the front to control the steering. The other idea was to have two motors on two wheels in the back to control the steering. (one wheel goes backward while the other goes forward to turn), and have a wheel that can just go any direction in the front. We decided on the second idea, and we are going to use a ping pong ball as the free-rolling front wheel. After a lot of searching we finally found two identical continuous DC motors, and we pulled two wheels off of a RC car. For the the body, we decided to use this styrofoam-like material instead of the body of an rc car because we can modify the styrofoam-like material much easier than the hard plastic rc car shell, and the styrofoam is lighter. The only problem we had was attaching the wheels to the motors, but John found a solution. The next step is to learn how to wire it to the arduino and program the motors.
 * Parts we think we need:
 * Arduino
 * Two continuous motors
 * Ping pong ball
 * Prototyping shield
 * Ultrasonic range finder
 * Body material
 * wires
 * power source: 9volt battery and a battery pack

Week 3

 * This week we learned that we do not need a prototyping shield, all we really need is a motor shield. We researched how to wire the motors to the motor shield and program it. We found one way that works to program it. Here is the website we based our wiring and programming on. to program you have to download the AF_Motor arduino library. We got both motors connected to the arduino and temporarily attached the motors to the body to test the movement of the robot. It worked sufficiently. Our next step is to figure out how to wire the Ultrasonic range finder and program it. After that, our robot will be complete.

Progress Pictures
Video of one of our trial runs on the 2nd body design
 * Test Video

Week 4

 * This week we wired everything up and we assembled all of the pieces together. The sensor was the final thing to be wired and that was done this week. Here is the image that we modeled our design after. We finished almost all of the coding for the arduino and we began testing to see if everything worked. The sensor does work but for some reason, the wheels are not moving all of the time when the robot is placed on the ground. We think that it may be a power issue. This week we also created an axil for the wheels by attaching a piece of wood that was connected to the motors. This helped with keeping the motors from bending out of the styrofoam body. Next week we plan on doing more testing and fixing the power issue.

Progress Pictures
The Arduino Code


 * 1) include 

AF_DCMotor motor1(1, MOTOR12_2KHZ);

AF_DCMotor motor2(4, MOTOR12_2KHZ); const int anPin = 0; long anVolt, mm, inches;

void setup { Serial.begin(9600); motor1.setSpeed(220); motor2.setSpeed(220); }

void turnRight { motor1.run(BACKWARD); motor2.run(FORWARD); delay(1500); Serial.print("Turning Right"); }

void read_sensor{ anVolt = analogRead(anPin); mm = anVolt * 5; inches = mm/25.4; }

void moveForward { motor1.run(FORWARD); motor2.run(FORWARD); Serial.print("Moving"); }

void loop { read_sensor; delay(100); if(inches > 6){ moveForward; } else if(inches <= 6){ turnRight; }

}

Week 5

 * This week we tried to piece the whole robot together to see if it ran. We encountered several problems. First, our wheels are not set in place very well, they are both angled strange. The problem was that we did not connect the motors to the axle very well, we just used tape and a piece of wood. Our second problem is powering the arduino and the motors. We tried just the two 9V batteries into the arduino, and used the power jumper to the motor shield. We could hear the motors operating, but they were either not strong enough to move the wheels and body of the robot or they didn't have enough power. After that we powered the arduino with two 9v batteries and the motor shield with 1 9v battery to see if that would change anything, and we had the same result. We believe that the motors are not strong enough to move the body, because they work when we lift the robot off of the ground.