Sunday, June 30, 2019

Tea Machine- Now with Robot Arm


My tea maker project is built around a basic coffee maker. I added 3 timers powered by an arduino uno. After the first 3.5 minutes, the contactor turns off the power to the coffee maker to stop dispensing hot water. After 5 minutes, a buzzer goes off. After 10 minutes, another beeper sounds.

This week, I replaced the AC adapter I was using with a power board. It has a common cathode dual diode, a capacitor and an LM7809.

The newest part I added is a servo motor attached to a bent plastic knife to take the tea bag out automatically after the first 3.5 minutes. I had started working on this 2 years ago, but now I have finally added the code needed to control the servo. The first test didn't go so well, jerking the tea bag out too quickly and splashing hot tea on the counter. To fix it, I could have changed the code to run the motor slower. Instead, I hung the tea bag closer to the end of the arm, and added a splash shield.

here is the code:
#include

Servo myservo;  // create servo object to control a servo
int pos = 0;    // variable to store the servo position
int loudPin = 12;               
int HotPin = 11;
int louderPin = 10;
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  pinMode(loudPin, OUTPUT);
  pinMode(louderPin, OUTPUT);
   pinMode(HotPin, OUTPUT);// sets the digital pin as output
}

void loop()
{ for (pos = 90; pos <= 177; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);     
  digitalWrite(HotPin, HIGH); 
  delay(210069);                 
  digitalWrite(HotPin, LOW);
  for (pos = 177; pos >= 90; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);   
  delay(90000);
  digitalWrite(loudPin, HIGH); 
  delay(3000);
  digitalWrite(loudPin, LOW);
 delay(300000);
  digitalWrite(louderPin, HIGH); 
  delay(3000);
  digitalWrite(louderPin, LOW);
  delay(3000000000000000420);
}
}
}

No comments:

Post a Comment