Autonomous Robot Part 2 – Search

Group Members (and Roles)

Annabelle Lee

(Scribe and Designer)

Joe Mallonee

(Designer and Tutor)

Riya Savla

(Integrator and Designer)

 

Introduction

Our project centers around the idea of finding substance in a world where Coca Cola can steal ground water, use fossil fuels to ship their products around the globe, and still have a polar bear as an advertising mascot. The eye flower continuously moves, looking out at the surrounding environment and avoiding contact with the Coca-Cola advertisements.

 

Technical Notes

The advertisements are suspended by metal wire which runs into the Arduino’s ground pin. The flower is hooked up to a pull-down resistor and given five volts. When the wire wrapped around the stem touch the grounded shapes, it sends a signal to a digital input pin (pin 2). This allows us to detect movement and send the flower in the reverse direction.

Circuit Diagram

Above: Parts used are Arduino, breadboard, two servos, high resistance resistor (10k ohms), switch. Two wires (probe and ground) run out to their correct respective mechanical components.

 

Schematic

Schematic

Arduino Code

#include <Servo.h>
Servo servo_up;
Servo servo_down;

//setup servo variables and values
int val_up = 90;
int val_down = 90;
int inc_up = 1;
int inc_down = -2;
const int lowerbound_up = 5;
const int upperbound_up = 110;
const int lowerbound_down = 5;
const int upperbound_down = 180 – lowerbound_down;

const int contactPin = 2;  // the number of the pushcontact pin

long lastContactChangeTime = 0;
long noMoreChangeDelay = 3000;

void setup() {
servo_up.attach(9);
servo_down.attach(10);

pinMode(contactPin, INPUT);
}
void loop()
{
// read the state of the switch into a local variable:
int reading0 = digitalRead(contactPin);
delay(10);
int reading1 = digitalRead(contactPin);
int reading = reading0 & reading1;

Serial.println(millis() – lastContactChangeTime);
}

if ((reading == HIGH) && (((millis() – lastContactChangeTime) > noMoreChangeDelay)))
{
inc_up = -inc_up;
inc_down = -inc_down;
lastContactChangeTime = millis();
}

if((val_up <= lowerbound_up) || (upperbound_up <= val_up)) {
inc_up = -inc_up;
}

if((val_down <= lowerbound_down) || (upperbound_down <= val_down)) {
inc_down = -inc_down;
}

val_up = val_up + inc_up;
val_down = val_down + inc_down;

delay(20);
servo_up.write(val_up);
servo_down.write(val_down);
}

Structural Aspects

The flower’s movement is the result of two servos controlled by an Arduino. One of them alternatively rotates clockwise and anti-clockwise. It rotates a disk, through which a shaft sits. The second servo sits on top of this shaft and supports and controls an arm. Thus we get trace out a spherical path with the two servo arms mimicking the longitude-latitude system. The shaft and the top servo are balanced with the help of multiple acrylic disks that rest on low-friction spherical balls.

 

Images

Flower In Coca Cola World

Above: Flower In Coca Cola World

 

Top View

Above: Top View

 

Side View

Above: Side View