Friday, August 10, 2018

Teatimer

For an index to all of my stories click here

At my work I drink lots of  tea. I start with 2 cups when I arrive, and then during the day I drink at least 8 cups. That is more then 10 cups of tea a day. The problem is that I often put the tea bag in the hot water and forget about it. The result then often is a cup that is too strong or even bitter.

The tea bags tell me the tea has to soak 2 to 3 minutes. Now how am I going to keep track of the time when I am busy at work. I could set a timer on my computer screen but that is too much hassle and not sexy at all. More sexy would be a timer with several leds that faded in or out. But what if the time ran out and I am not at my desk.

So I decided to build a tea timer.







The picture is taken in my hobby room, not at my work. And yes I need to reorganise as I have many projects cluttering up my desk.
 

My tea timer is a part electronics and part mechanical solution.
A microcontroller is attached to a servo. The servo drops the tea-bag into the cup and gets it out after a set time. This has been done a few times by using an Attiny85 with a servo and a pot-meter to set the time. That is a perfect acceptable solution. However I decided to do things different.

A tea-timer with a website

We are living in the IOT era so let's give the tea-timer a website. The idea is to take a NodeMcu (or Wemos d1 mini) attach a servo to it and do the rest in software. This is a bit more expensive as using an Attiny85 with a potmeter but has the advantage that it has power management on board. So I can feed it direct from an USB power source like a phone charger or power bank. Next to that I can control it from my phone or computer which is cool !!

The hardware

The hardware is straight-forward.



This could be done with an ESP-01 but I used a NodeMCU as it can be powered through USB which gives me an opportunity to use a powerbank as a powersupply when no computer is near. Next to that it supplies 5 volts to power the servo. The servo is attached to d7.

The software

Again I did this project in my favorite rapid devellopment environment: ESPBASIC. Well the software is so easy it speaks for itself.



The slider is used to set the number of minutes the teabag needs to soak. And there are 4 buttons. When the time is set with the slider and Start button is pressed the teabag will slowly be lowered into the tea. I lower it slowly on purpose as you do not want to be splashed by hot water. After the set time the teabag is lifted out of the cup slowly again.

The Up and Down buttons will rise and lower the teabag manually. This function is disabled when the start button is pushed.

The Off button also rises the teabag out of the cup but then ends the program.


timer 500,[set]

wprint |<body style="background-color:SaddleBrown ;">|
wprint |<span style="color: SpringGreen;">|
wprint |<h1 style="text-align:center;">Luc Volders</br>Tea Timer</br>|
wprint "<br/>"
wprint |<span style="color: White;">|

for i=1 to 45
servoval =i
io(servo,d7,servoval)
delay 20
next i

slider minutes, 0, 8
wprint "<br>"
wprint "Minutes :  "
minut2 = minutes / 2
textbox minut2
wprint "<br/><br/>"
button "<h2>Start<h2>", [Start]
wprint "<br><br>"
button "<h2>UP<h2>", [Up]
button "<h2>Down<h2>",[Down]
wprint "<br><br>"
button "<h2>Off</h2>", [Off]
wprint "<br/>"
wait

[set]
minut2 = minutes / 2
wait

[Up]
if servoval <> 45 then
for i=0 to 45
servoval =i
io(servo,d7,servoval)
delay 20
next i
endif
servoval=45
wait

[Down]
if servoval <>0 then
for i=45 to 0 step -1
io(servo,d7,i)
delay 20
next i
endif
servoval = 0
wait

[Start]
for i=45 to 0 step -1
io(servo,d7,i)
delay 20
next i
delay minut2 * 60 * 1000
for i=1 to 45
servoval =i
io(servo,d7,servoval)
delay 20
next i
servoval = 45
wait

[Off]
if servoval <> 45 then
for i=0 to 45
servoval =i
io(servo,d7,servoval)
delay 20
next i
endif
end

Some remarks concerning the program.

- The chosen time is tracked by the servoval variable.
- The SET function stes the minutes by 30 seconds
- The delay in the for loop determines how fast the bag will rise or be lowered
- The servo value 0 is down and 45 is up.
- Adjust the number 45 to your own needs, just keep the Pythagorean theorem in mind
- The delay in the Start function: delay minut2 * 60 * 1000 soaks the teabag for the choosen time.

To use this program start with installing ESP-Basic on the Nodemcu board. Open a new file and paste the above code in. Run the code and you are set to go. If you want to know how to do this look at my ESP-Basic introduction page which can be found here:
http://lucstechblog.blogspot.nl/2017/03/back-to-basic-basic-language-on-esp8266.html

The frame

The frame is made by experimenting. I made mine 24 cm high and 18 cm wide. First set the servo in the down position ( 0 degrees) and attach the arm so it rests horizontal. Attach a teabag and hold the servo at such a height that the teabag is on the bottom of a cup

 
Next position the arm so it is sticking as wide as possible out of the frame. In my case I positioned the servo at a hight of 18 cm and 11 cm from the left. This last part could be done better like 13 or 14 cm to the left. That way the cup is positioned a bit farther from the frame which is better when the arm is lifted.

I designed and 3D printed an arm and some feet for the frame. The feet have a gap which is 2mm wide which fits the carton I used for the frame. If you use a thinner carton just make the frame a bit longer and fold the carton at the bottom and press it in the feet. I did not print the frame itself. The feet took me about 2 hour to print so I was not patient enough to print the frame. If you want the STL files just send me an e-mail requesting them.

Thats it for this episode.
Have fun

Luc Volders