Assignment 6: Frownobot

Frownobot’s body is made up of a steam strainer (kind of a collapsible metal thing) and a light-up face. When the IR sensor detects a source (most likely from a TV remote), it runs a servo which turns the strainer until the remote control’s signal stops. If the servo turns too far and could twist the wires, Frownobot lights up his frowny face (to let the user know why it isn’t responding) and reverses direction.
Arduino board
A cardboard disk connects the little feet on the steam strainer to the servo shaft
Schematic
Funny story about the strainer – when I was little, I would play with our strainer because the circular folding mechanism was just fascinating. My mom would always say, “you can’t play with that, it’s for the kitchen.” It was like Christmas morning when I found one for this project.
SteamerBasket
I originally wanted the strainer to be opened and closed by the motor, but I couldn’t find the right mechanism. Instead I added a bend sensor to the basket to detect whether a person has left it open or closed.
Dish and Remote
It looks like a jellyfish.
jellyfish
Code in comments. Servo, sensors, and LED are all wired directly to Arduino ports so the circuit diagram isn’t particularly interesting.

Advertisements

One Response to “Assignment 6: Frownobot”

  1. /* CODE */

    int motorVal = 300;
    int motorCount = 0;

    int frownLED = 3;
    int spinServo = 9;
    int dishOpen = 3;

    void setup()
    {
    // set frown LED pin
    pinMode(frownLED,OUTPUT);
    }

    void loop()
    {
    // check IR sensor for remote control
    int sensorVal = analogRead(2);
    if(sensorVal < 1015){
    // receiving signal
    motorCount++;
    if(motorCount < 50){
    // move up to half a second in this direction
    analogWrite(spinServo,motorVal);
    }
    else{
    // frown for two seconds and reverse servo direction
    analogWrite(spinServo,1024);
    digitalWrite(frownLED,HIGH);
    motorVal = 1024 – motorVal;
    motorCount = 0;
    delay(2000);
    }
    }
    else{
    //not receiving signal, don't move servo
    digitalWrite(frownLED,LOW);
    analogWrite(spinServo,1024);
    }
    //check for signal every 0.01 seconds
    delay(10);
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: