Introduction: ROADRUNNER

Roadrunner is a small automated vehicle, which has the function of transporting beverage cans to the thirsty users.


How it works? A can is placed on the top base of the vehicle, and the weight of the can triggers a small button that tells to the transport that it is ready to work. To guide himself, Roadrunner follows a path on the ground in the form of a black line, which indicates where he should go, and thanks to the use of photosensors, he is able to detect when he goes out of the way, correcting his direction, to stay in this way, always inside the track. Once the vehicle arrives to the user, it picks up the beverage can making the small transport stop in the same place. He will not reanudate his march until the user puts the can back on it, in order to return to the starting point and finishing his work.

Step 1: Tools & Materials

Step 2: Hardware Assembly

1. BODY

For the body we used an aluminium plate, which we cut and bent with the shape we wanted. We also made all the holes that will be required for the screws.

2. WHEELS

We used 2 wheels from a Mecano game that fit perfectly to our robot. The servos go under the plate jointed with the help of screws. For the front wheel we used a "free" wheel, so it can go in any direction easily.

3. PHOTOSENSORS

For the RDL photosensors we used a circuit board and we welded the circuit to it, it includes a resistance, the LDR, a positive, negative, and signal.

4. ARDUINO BOARD

We attached the Arduino board to the plate using screws. Then we just connected all the circuit to it. To supply the board we used 2 9V batteries, which we have united and plugged into the Arduino.

5. TOP PLATE

For the top plate we used a laser cut machine to cut PMMA. We designed this shape with AutoCad. It consists of a big plate, 3 circular rings, and a circular piece to fit into the rings. We gave space to the plate so we could fit a button.

Step 3: Electrical Connections

1. Connecting Servomotors:

Servomotors consist of three cables; one yellow or orange for signal, red for power (Vcc) and black or brown for ground (GND). The red and the brown one are attached to the according pins on the Arduino (5V and GND). One servo is wired to PWM pin 10 and the other one to PWM pin 11.

2. Connecting Button:

The electronic buttons work in a somewhat peculiar way; allow to pass the voltage across the pins diagonally, that is, if we have four pins, we must connect the input and the output in only two pins, 1-4 or 2-3 to work. For example, if we choose pins 1-4, we will connect the ground (GND) to pin 4, and the output will connect to the PWM 9 pin and, in turn, together with a resistance of 1kOhm, connect it to 5V (Vcc).

3. Connecting Photosensors:

To connect the photosensors, we must place one of the legs directly to the Vcc supply, and the other connect it at the same time, to an analog pin (in this case to the pins A0 and A1) and to the ground GND together with a resistance of 1kOhm.

Note:

You can solder small connectors to the wires if the wires do not fit directly into the Arduino or use a protoboard to facilitate the different connections. In this project we have used connecting strips for different joints.

Step 4: Programming Arduino

CODE

#include
Servo myservoL;

Servo myservoR;

int inPin = 7;

int buttonVal = 1;

void setup() {

//SERVOMOTORS

myservoL.attach(10);

myservoR.attach(11);

Serial.begin(9600); }

void loop() {

int LDR_L = analogRead(A2);

int LDR_R = analogRead(A1);

buttonVal = digitalRead(inPin);

//PACK LEFT

if (LDR_L > 590 && buttonVal == 0) {

myservoL.write(180);

//Serial.println(LDR_L); }

else {

myservoL.write (92);

//Serial.println(LDR_L);

}

//PACK RIGHT

if (LDR_R > 750 && buttonVal == 0) {

myservoR.write(-270);

//Serial.println(LDR_R); }

else {

myservoR.write (92);

//Serial.println(LDR_R); }

}

Step 5: Testing (Video)