Tea Dipper

by Rosux in Circuits > Robots

1176 Views, 12 Favorites, 0 Comments

Tea Dipper

20240409_022538.jpg
20240409_022142 - frame at 1m0s.jpg

Ever had your tea turn out too weak or bitter? With this project, you can create this device to dip your tea for the perfect amount of time. Simply attach a tea bag and place your cup down, and the device comes to live! Dipping your tea perfectly to your liking.


Supplies

Materials needed:

  • 4mm thick wood
  • Arduino Uno
  • Servo (I use the SG90)
  • Ultrasonic sensor
  • Cables & ribbon cables for arduino
  • Duct tape
  • Double sided tape
  • Clothespin (or some other small clamp)
  • Cup

Machines/Tools needed:

  • 3d printer
  • laser wood cutter
  • Hot glue gun

Cutout Wooden Base

Step 1-1.jpg

To build a tea-dipping machine we first need the base of machine to work on. To get this base we will need to cut out 4mm thick wood with a laser cutter.

Start by laser-cutting 4mm wood according to the provided template. Use the .svg file if your laser cutter takes svg files. I have included the original adobe illustrator file if your laser cutter needs specific export settings.

Note: In the attached image the front face does not have any holes for the ultrasonic sensor. The .svg and .ai files however, do have space for this sensor.

Assembling the Wooden Base

BendPins.jpg
Step 1 Labeled.jpg
Step 1-2.jpg
Step 1-3.jpg
Step 1-4.jpg
Step 1-5.jpg
Step 1-6 (2).jpg
Step 1-6 (1).jpg

Of course after we have cut out the wooden template we still have to assemble it.

For this step you will need the following:

  • Duct Tape
  • Double sided tape
  • The cut wood from step 1
  • Hot glue gun
  • Ultrasonic sensor

note: All the wood pieces needed are labeled in the first image.

Ultrasonic sensor

Firstly, take the "Front" side (With the 2 small holes) and insert your ultrasonic sensor "eyes" into the holes. Then use a bit of hot glue to keep the ultrasonic sensor in its place. I had to bend my 4 connecting pins since they were facing down. The pins should be facing outwards of the sensor like in the image.


Base plate

To start the assembly add a bit of double sided tape on top of the "base 1" template. Make sure your not putting any tape on where the round opening comes.

After adding the tape firmly press the "base 2" plate onto the "base 1" plate with the double sided tape in between. This should result in a ~8mm thick base plate consisting of the 2 base plates.


The box

After assembling the base plate we have to make the "Box" sitting on top of it. You can do this by first taking a "Side" piece and sliding it in the base plate, repeat this step for the other side.

Now insert the front piece with your ultrasonic sensor attached to it. You might have to lift the sides a bit to wiggle it in.

Assemble the roof by putting the "Top" piece over the sides and front.


You can secure the "box" with some duct tape or hot glue depending on your preference. I used tape to secure the sides of the box to each other.


note: After all these steps you should still have 1 wooden piece left, this piece will be used at a later point.

Printing

20240326_174741.jpg
20240326_174806.jpg
20240326_174840.jpg
hinge (2).png
hinge (3).png
hinge (4).png
hinge (5).png
hinge (6).png
hinge (1).png

Now we want to print a protection and mounting case for our arduino. Download and print the 2 arduino .stl files to get the top and bottom of the case.

Assembling the case

First lay your arduino in the bottom part of the case. You can screw it down if you got the needed screws but i just laid it in there. Then take the top cover of the case and gently place it over the bottom cover and arduino to seal the case.


For our servo we need some hinge system to allow lifting of the tea bag. To do this use the "arm", "base" and "cover" .stl files provided in the attachments.

Assembling the servo hinge

First take your servo motor and place it in the fitted slot on the base.stl. Take the cover.stl print and place it over the base as the pictures. I used double sided tape to keep it in place but you can also use nuts and bolts if you have the right ones.

After the cover is on you can attach the arm to the base. To do this remove the servo arm, place the big hole over the now empty servo arm connection part and gently rotate the arm until the other end fits into the base hole. After it clicks in place connect the original servo arm onto the servo with a screw and make sure you get the desired rotation as to not limit the rotation later.

Original Explanation Hinge Files


After these steps you should have a beautiful servo hinge ready to carry our tea bags.

Electronics

diagram.png
20240329_231404.jpg
20240329_231409.jpg
20240409_022609.jpg

Lets make it move.

For this step you will need the following:

  • Your Arduino Uno in its case
  • Ultrasonic sensor (on the Front wooden part)
  • Servo
  • Cables & ribbon cables for arduino
  • Double sided tape or a Hot glue gun


Electronics

We want to connect the arduino uno to the servo and the ultrasonic sensor. To connect these components i used the wiring scheme provided in the first image.

First you will wire the GND and VCC pins of the ultrasonic sensor to the arduino GND and 3.3V ports. The TRIG and ECHO pins should be connected to port 2 and 3 in that order.

You want to connect the servo GND and PWR pins to the arduino 5V and GND pins. The servo data should be connected to pin 4. Ideally you would connect the servo PWR only to an external power source but in my case i didn't need it.


Code

#include <Servo.h>

// pins
const int trigPin = 2; // trig pin for ultrasonic sensor
const int echoPin = 3; // echo pin for ultrasonic sensor
const int servoPin = 4; // pin for writing to servo

// distance
float minCheckDistance = 2.0; // min check distance in CM
float maxCheckDistance = 8.0; // max check distance in CM
float echoDuration, distance;
float averageDistance[10] = {0};

// servo
Servo serv;
const int minPos = 75; // servo maximum position while dipping
const int maxPos = 100; // servo minimum position while dipping
const int restingPos = 130; // servo resting position when not dipping
int targetPos = restingPos;
int pos = restingPos;

// time
unsigned long time = millis();
unsigned long startTime = time;
unsigned long dipDuration = 60000; // duration of comenced dipping in miliseconds
bool dipping = false;
bool reset = false;

void setup() {
  // enbable pins
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  serv.attach(servoPin);
  serv.write(pos);
  delay(300);
}

void loop() {
  time = millis();

  // insert a distance into the array
  distance = checkDistance();
  for(int i=0; i < 9; i++){
    averageDistance[i] = averageDistance[i+1];
  }
  averageDistance[9] = distance;

  // handle the setting down cup and removing it again
  if(checkAverageDistance()){
    if(time >= startTime+dipDuration && dipping){
      dipping = false;
      reset = true;
    }else if(!dipping && !reset){
      startTime = time;
      dipping = true;
    }
  }else if(!checkAverageDistance()){
    dipping = false;
    reset = false;
  }

  // handle servo
  if(!dipping){
    targetPos = restingPos;
  }else{
    if (pos >= maxPos){
      targetPos = minPos;
    }else if(pos <= minPos){
      targetPos = maxPos;
    }
  }

  moveServo();

  delay(50);
}

void moveServo(){
    if (pos < targetPos){
      pos += 1;
      serv.write(pos);
    }else if (pos > targetPos){
      pos -= 1;
      serv.write(pos);
    }
}

float checkAverageDistance(){
  // check if the average distance in the last 10 echoes is still around our target (3 echoes or more)
  int avg = 0;
  for (byte i=0; i < 10; i++){
    if (averageDistance[i] <= maxCheckDistance && averageDistance[i] >= minCheckDistance){
      avg++;
    }
  }
  return avg >= 3;
}

float checkDistance(){
  // pulse the signal so we get echoes
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  echoDuration = pulseIn(echoPin, HIGH);
  return (echoDuration * 0.0343) / 2;
}

This code powers our tea dipping device, by using the ultrasonic sensor to read the distance of the object (tea cup) in front of it we can choose to start moving the servo. If a teacup is placed in front of the sensor the servo will start to oscillate back and forth between 2 positions (minPos and maxPos) for a chosen amount of time (dipDuration). If the cup is removed the servo will be told to move back to the resting position (restingPos). By changing these 4 values (minPos, maxPos, dipDuration, restingPos) you can tell the servo how high to dip, how low to dip, how long to dip and where to go when not dipping.

Change the code to your preferred settings and upload it to your arduino uno.


Assembly

Now test if the servo moves when your hand is close to the sensor. If it doesn't move the servo try to trace back the wires and make sure they're connected properly and make sure the code is uploaded and doesn't cause any errors.

If your servo moves take some double sided tape and tape it to the bottom of your arduino uno case, Then gently place the case with the power connector facing outwards onto the wooden base inside the "box" (like the last image).

If there are any wires in the way you could use some tape to secure them in more convenient spots.

After your arduino is in place take the servo and put it on top of the box. I used double sided tape on the bottom of the servo stand to hold it in place. I recommend you use screws if you got the right size or hot glue to make it more secure.


note: Remember to test the servo and sensor before securing them in place.

Downloads

The Arm

20240409_022545.jpg

For the last part of the device we need something to hold the tea bag.

For this step you will need the following:

  • The last wood part from step 1
  • Double sided tape
  • Duct tape
  • Hot glue gun
  • Clothespin or other small clamp

First take the clothespin and use double sided tape or hot glue to secure it to the end of the arm. Make sure the opening of the clothespin is towards the smaller side.

After you connected the clothespin to the arm you have to connect the arm to the servo. To do this you could use some screws, hot glue, or double sided tape and some strong duct tape. I used double sided tape and a small strip of duct tape. Cut a small strip of double sided tape and stick it on top of the servo, then take your arm and place it on top. I used a small piece of duct tape too that i secured around the servo arm and onto the wooden arm. I recommend using screws or hot glue since its more secure.


Once you have done this the Tea Dipper device should be ready for its first test

Final Product

FOF03B1LUV91LQ0.jpg

It is time to test your tea dipper

First connect the arduino to a power source.

Then pick your favourite tea and boil some water and pour it in a cup.

Connect the tea bag to the arm of the dip dip machine by using the clothespin to hold it. And then the magic comes.

Place your cup on the cutout circle and let it dip the tea bag into the cup.


Attached is a video of my first time trying it out. You might have to play around with the angles and duration of the dipping to get your perfect tea.


Thank's for reading and have some perfect happy tea times!