Autonomous Robot Part 2 – Bubble Machine Robot
Team Members: Integrator/Designer: Lauren Valley Documentation/Scribe: Maggie Burke This (2nd) Prototype: The Bubble Machine Robot is an autonomous robot that blows bubbles at five different targets arrayed in a semi-circle. The robot uses the feedback from the targets that it hits to adjust its aim toward the center target. When the robot manages to hit the center target a fan turns on and blows out the candle. If the robot doesn’t achieve its goal fast enough the candle burns to the ground and the fire spreads! Earlier (1st) Prototype: The first iteration of the bubble machine used an led and an ambient light sensor to pick up the quantity of bubbles in the air by the shadows they cast. This iteration was less successful because bubbles are mostly clear and cast almost imperceptible shadows. The Next (3rd) Prototype: In the next iteration of the Bubble Robot we will experiment with foam instead of bubbles in an effort to trigger the sensors more easily. We will also continue to improve plastic wrapping and containment methods for the soapy water. Photos:
Arduino Code: /* Sweep by BARRAGAN <http://barraganstudio.com> This example code is in the public domain. modified 8 Nov 2013 by Scott Fitzgerald http://arduino.cc/en/Tutorial/Sweep */ #include <Servo.h> Servo myservo1; Servo myservo2; int pos = 0; // variable to store the servo position int potpin1 = 0; // analog pin used to connect the potentiometer int val1; int potpin2 = 1; // analog pin used to connect the potentiometer int val2; int potpin3 = 2; // analog pin used to connect the potentiometer int val3; int potpin4 = 3; // analog pin used to connect the potentiometer int val4; int potpin5 = 4; // analog pin used to connect the potentiometer int val5; int spin = 0; void setup() { myservo2.attach(9); // attaches the servo on pin 9 to the servo object Serial.begin(9600); pinMode(8, OUTPUT); myservo1.attach(10); } void loop() { val1 = analogRead(potpin1); val2 = analogRead(potpin2); val3 = analogRead(potpin3); val4 = analogRead(potpin4); val5 = analogRead(potpin5); myservo1.write(pos); // tell servo to go to position in variable ‘pos’ myservo2.write(spin); digitalWrite(8, LOW); spin = spin + 2; if( val1 == 0) { pos = 54; } else if(val2 == 0 || val4 ==0) { pos = 90; } else if(val3 == 0) { // digitalWrite(8, HIGH); } else if(val5 == 0) { pos = 126; } else { digitalWrite(8, LOW); } Serial.print(val1); Serial.print(” | “); Serial.print(val2); Serial.print(” | “); Serial.print(val3); Serial.print(” | “); Serial.print(val4); Serial.print(” | “); Serial.println(val5); }A video of the bubble blowing mechanism:
|