Tim's Hot Beverage Coaster

by Palingenesis in Circuits > Gadgets

1539 Views, 25 Favorites, 0 Comments

Tim's Hot Beverage Coaster

Hot Beverage Coaster.gif
Tim's Hot Beverage Coaster

When you want to stay worm, there is nothing like a nice mug of tea.

  • What's even better is that the mug of tea is at that perfect temperature you like to drink it.

This Instructable is about my attempt at making a coaster that will tell you when your hot beverage is at that perfect temperature.

I now have a laser that will cut 3mm plywood, so that's what I have used.

  • If you are to make this and you have the parts cut for you by a professional source, there is no reason why you cant have the parts made of another medium like acrylic.

The coaster has three different colour LEDs.

  • Red LEDs - Indicate the beverage is too hot.
  • Red LEDs with flashing Green LEDs - Indicates it is cool enough to drink.
  • Green LEDs - Indicates it is at the perfect temperature to drink.
  • Green LEDs with flashing Blue LEDs - Indicates it is going cold.
  • Blue LEDs - Indicate the beverage has gone cold.

I show my iterations in the process, the concept is sound, but we all know in practice there may be hurdles in the way.

Supplies

Plywood.png
STM8S103F Module.png
LEDs.png
NPN.png
Resistors.png
Temperature Probe.png
Temperature Sensor DALLAS DS18B20.png
DuPont_Kit.png
Cable.png
Tinned Copper Wire.png
LCD_1602.png
PCF8574 LCD Addaptor.png
ST-Link v2.png
830 Solderless Breadboard.png

3mm plywood.

  • I have a laser cutter, there is no reason why the parts cannot be cut using a jig saw.

Microcontroller

  • 1 * STM8S103F Module. (The little Blue Pill)
  • I have two variants of this. STM8S103F3 and STM8S103F2, either will do. (Only difference between the two is the amount of EEPROM)

5mm LEDs

  • 4 * Red.
  • 4 * Green.
  • 4 * Blue.

NPN Transistors

  • Any general NPN Transistors will do, to handle 5 volts.
  • 6 * 2N4401.

Resistors

  • 8 * 150 ohm (For the Red and Green LEDs)
  • 4 * 100 ohm (For the Blue LEDs)
  • 8 * 1k ohm (For Pin current limiters)
  • 1 * 4.7k ohm (For DS18B20 Pull-Up)

Temperature Sensor

  • 1 * DS18B20 Probe. (DS18B20 in a TO92 Package, if you want to try with sensor in the coaster)
  • My first iteration had the sensor in the coaster, it took too long to warm up.

Tinned Copper Wire

  • 25 AWG Tinned Copper Wire.
  • I have wired all the components end to end. Looks a mess, but as long as you can follow a circuit diagram, all will be fine.

Dupont Connectors and cable.

  • 1 * 4 pin male header.
  • 1 * 4 pin female header.
  • I have a box of assorted connectors and cables.

Display

  • 1 * LCD 1602. (16 char 2 line)
  • This is used to help set your preferred temperature.

I2C LCD Adaptor

  • 1 * PCF8574 LCD Adapter.
  • I have done the connection to the LCD via the I2C pins.

Programmer

  • 1 * ST-Link.
  • We need this to program the Microcontroller.
  • There is no programming language skills required, just some simple instruction.
  • I will give the link to download the software to do the programming.

Screws

  • 4 * M1.7 x 6mm long self tapping screws.

Various glues

  • PVA
  • Super glue.

Glue Gun

  • All component connections are isolated with each other using hot glue.

General Electrical tools

  • Soldering Iron, solder.
  • Side cutters.
  • Tweezers.
  • Screwdriver.

Solderless Breadboard

  • 1 * bord if you want to build the prototype.
  • I actually I used two 830 hole boards. but it should fit on one 830 hole board.

Prologue

Hot Beverage Coaster 002.png

Originally I had intended this coaster to have the sensor in the Coaster.

  • When the beverage was placed on the coaster, the heat from the mug would warm up the sensor.
  • This was my first iteration.
  • However the amount of time it took to warm up the sensor, the beverage was already cooling down in the mug.
  • By the time the sensor got to a temperature that was useful to read the beverage was below the perfect temperature.
  • This is because of the way Mugs are designed.
  • Mugs are designed to keep the heat in.

To get a quicker and more accurate reading.

  • An other way is to put a probe in the beverage.
  • This is what I may end up doing.

But

  • I will say having the sensor in the coaster does work, if the beverage is verry hot to start with.
  • I like my tea sweet and milky, so it starts of colder than most.
  • So the Instructable will show all my iterations of this coaster.

Cut Parts

Hot Beverage Coaster 003.png
Hot Beverage Coaster 004.png

There are four layers to the coaster.

  • It could probably be made thinner using thinner materials.
  • I have a laser cutter and some 3mm plywood, this is why it is the size it is.
  • There is no reason why it could not be made thinner.
  • As it is wood, the parts can be cut using traditional means.

I have done DXF Files for the wooden parts.

I have done three versions of the top piece.

  1. Coaster_Top1.dxf - This my original, I have a DS18B20 in a TO92 Package set into the wood.
  2. Coaster_Top2.dxf - This has a larger hole so that the DS18B20 in a TO92 Package could be set in the open air.
  3. Coaster_Top3.dxf - This has no hole for the sensor.

The top middle piece has a section to hold the STM8S Module.

  • Coaster_Top_Middle.dxf - The holes for the LEDs can be just drilled round if you are making it without a laser.

The bottom middle piece has as much removed as I thought necessary.

  • Coaster_Bottom_Middle.dxf

The bottom just has the counter boar hols so the screws are recessed.

  • Coaster_Bottom.dxf

There is a support piece if you use Top2, this goes under the hole to support the DS18B20.

  • Sensor Support.dxf

I have done cut all files also. If cutting all with a laser, these files have been drawn with the minimum cuts needed.

  • Cut_All_1.dxf
  • Cut_All_2.dxf
  • Cut_All_3.dxf

The image shows how all the pieces will end up fitting together.

  • The two Top pieces are glued together
  • The two bottom pieces are glued together
  • Then the two halves are fastened together using screws, this enables re-entry to the workings.
  • It is best not to glue the two bottom pieces until all the components have been fitted.

Fit the Main Components

Hot Beverage Coaster 005.png
Hot Beverage Coaster 006.png
Hot Beverage Coaster 008.png
Hot Beverage Coaster 007.png

Take a look at how the cut parts go in the image in the previous step.

  • Glue the Top two parts together.
  • Screw the Middle-Bottom part to the glued top parts.
  • Do not attach the bottom part.
  • By screwing the Middle-Bottom part to the Top pieces lets you see the area in which the components need to fit.

If you have the Parts laser cut, you will see that the inner holes for the LEDs have flats on one side.

  • I did this to remind me which pins are anode and cathode.
  • By placing all the LEDs in the same orientation, it won't get (be as) confusing when wiring them up.

The LEDs and sensor I have glued in place with super glue.

  • I changed the way the sensor was fitted to try and make it more responsive.
  • One of the top view shows how I altered the sensor fitting.
  • If putting the sensor on the recessed disc, the back of the sensor needs filing down to make it only 3mm thick.
  • The choice is yours, I don't think it made any difference.
  • I even tried adding some metal foil.

I am going to add a probe on a lead that can be placed in the beverage.

  • As I have already made this and altered it, I am going to leave it as is and just disconnect this sensor.
  • The Probe on a lead will be connected to the pin I had this connected to.

I have shown the different stages I went through so you may experiment yourselves.

  • I will say having the sensor in the coaster does work, if the beverage is verry hot to start with.
  • I like my tea sweet and milky, so it starts of colder than most.

The STM8S103F Module is glued in place using Hot Glue.

  • The STM8S103F Module is fitted upside down, so a good thing to do is mark the inside of the coaster with pin numbers we will be using.
  • As the STM8S103F Module is upside down make sure that the reset button is not pressed in when you glue it in place.
  • Don't put too much glue under the pin locations we are going to use, it may interfere with the soldering.

Prototype

Hot Beverage Coaster 010.png
Hot Beverage Coaster 009.png

I am showing the Prototype because when it comes to wiring, I have, well lets say; I took a shortcut.

  • I say short cut, but back in my day it's how a lot was done, you will see.

I have done a Fritzing, from this you can do a prototype of the circuit to check it working.

  • Hopefully yon can follow the fritzing Breadboard and Circuit diagrams to build the circuit.
  • How to program the STM8S103F will follow.

See attached.

  • I have also done PDF for you to view them without fritzing.

Spaghetti Wiring

Hot Beverage Coaster 011.png
Hot Beverage Coaster 012.png
Hot Beverage Coaster 013.png
Hot Beverage Coaster 014.png

This is what I meant when I say I took a short cut.

  • All the components are wired End-To-End or joined with Tinned Copper Wire.
  • Where wires cross over another that should not touch, I have used hot glue to keep them isolated.

Hopefully you can follow the circuit diagram in the Fritzing.

  • As parts of the circuit repeat, I found it best to do sub-assemblies.
  • I started with the middle LEDs and worked outwards on either side.
  • Take you time doing this.
  • When you finish, check there is no short between both voltage lines and ground before plugging in the USB.

I have taken photos of my work, I hope they help.

  • Some are early photos and don't include the iterations.

You can change the arrangement if you like, one of the images show which LEDs are paired with which by the pin number.

  • Obviously it is the transistor connected to the LEDs that is connected to the microcontroller pins.

Notice that I have added some colour codes to the pins of the headers.

  • The I2C header is connected via Tined Copper Wire, it points up slightly so the the LCD Cable can be plugged in.
  • The ST-Link header is a standard vertical pin header laying on its side.

None of the wires go through the holes in the module, they are just soldered on top of the board.

Currently the bottom-middle piece should be screwed to the top pieces.

  • Once you have finished you wiring, glue the bottom piece to the bottom-middle piece.
  • Once the glue has set, you should be able to remove the lower half from the top half. by unscrewing the four screws that are now recessed on the bottom piece

Programming [Software]

Hot Beverage Coaster 016.png

I have tried to make this as easy as possible to program.

  • All you have to do is upload two files to the Microcontroller.
  • Both are actually text files but they need the extension .s19
  • One needs editing, we could do it in a text editor but we won't. That's too easy to make errors.
  • We will use STVP (ST Visual Programmer) to do the editing and uploading.

STVP is part of STMicroelectronics STM8 Toolset.

Download the STVP-STM8 (ST Visual Programmer STM8) and install it.

Attached are the two files.

  • The files currently have the extension .txt This needs changing when you download them.
  • You need to change the extension to .s19 on both files.
  • Instructables does not support this extension, Supported File Extensions - Instructables
  • I have asked.

Programming [Connection]

Hot Beverage Coaster 015.png
Hot Beverage Coaster 018.png

To program the STM8S103F we need to use the ST-Link v2 USB device.

The ST-Link has two ways to connect to a microcontroller.

  • SWIM (Single Wire Interface Module) This is how we need to connect.
  • It also can use SWD (Serial Wire Debug) this uses two communication wires clock and data (SWCLK / SWDIO)

So for us there are four wires to connect from the ST-Link and the STM8S103F.

  • 3.3v
  • GND
  • RST
  • SWIM

The connections are same-to-same.

In the image you can see I have connected an 1602 LCD also.

  • This is connected to the I2C pins of the STM8 module via an PCF8574 Adaptor.
  • The PCF8574 adapter needs to have it's address changed.
  • The address needs to be 0x26.
  • This is done by bridging the pad A0, see image.

The reason for the LCD, is for when you are finding your preferred temperature.

  • It will display the current temperature of the sensor.
  • There is a setting for this to work in the EEPROM. Details to follow.

I have also connected the USB.

  • The only thing the USB does, is give power.
  • Power from the USB (5 volts) is needed for the LEDs.

Programming [Configuration]

01 Covficoration 001.png
01 Configuration 02.png
01 Configuration 003.png

Once you are connected as in Step 7.

  • We are ready to start programming.

When you open "ST Visual Programmer", it is important that you have the correct Microcontroller selected.

  • Make sure STM8S103F3 is selected in the dropdown box in the toolbar at the top. (A)
  • This can also be selected on the configuration dialog window. (B)

Lets use the Configuration window.

  • Click Configure on the toolbar at the top. (1)
  • Choose: "Configure ST Visual Programmer". (2)
  • This will open the "Configuration" Dialog Window.
  • Select: "Hardware" to ST-LINK. (3)
  • Select: "Port" to USB. (4)
  • Select: "Programming Mode" to SWIM. (5)
  • Select: "Device" to STM8S103F3 (6)
  • Click "OK" when done. (7)

Notes!

I have purchased several STM8S103F Modules off eBay, so far I have had both variants: STM8S103F2 and STM8S103F3. Both work for this project.

  • Depending on your variant you may need to choose the other.
  • The only difference between the two is the size of EEPROM Memory. This project only needs 0x4000 to 0x4021.
  • The rest of the programming will be the same for both.

Programming [PROGRAM MEMORY]

02 Program 001.png
02 Program 002.png
02 Program 003.png
02 Program 004.png

Then we do PROGRAM MEMORY.

  • Select the PROGRAM MEMORY tab. (1)
  • Click "File" on the Toolbar. (2)
  • Select: "Open". (3)

In the "Open" dialog window:

  • Browse to where you downloaded the PROGRAM MEMORY.s19 file. (4)
  • Select it. (5)
  • Click "Open". (6)

When ready:

  • Click: "Program" on the toolbar.
  • Select: "Current tab"

The file should upload to the Microcontroller.

Programming [DATA MEMORY]

03 Data 001.png
03 Data 002.png
03 Data 003.png
03 Data 004.png

Then we do DATA MEMORY.

  • Select the DATA MEMORY tab. (1)
  • Click "File" on the Toolbar. (2)
  • Select: "Open". (3)

In the "Open" dialog window:

  • Browse to where you downloaded the PROGRAM MEMORY.s19 file. (4)
  • Select it. (5)
  • Click "Open". (6)

When ready:

  • Click: "Program" on the toolbar. (7)
  • Select: "Current tab" (8)

The file should upload to the Microcontroller.

Note!

We will be uploading this again later.

  • We first need to find our preferred temperatures.
  • On this tab is where we edit the temperature settings we want to use.

Cant Program It [Locked]

04 Options 001.png
04 Options 002.png

There is a third tab "OPTIONS BYTE"

If you get error microcontroller locked you need to do the following:

  • Select the OPTIONS BYTE tab. (1)
  • Change the "ROP" setting to say "Read Out Protection OFF". (2)

When ready:

  • Click: "Program" on the toolbar. (3)
  • Select: "Current tab" (4)

You should be able to do Steps 9 and 10 now.

Finding Your Temperature Settings

Hot Beverage Coaster 019.png
Hot Beverage Coaster 020.png
01 Calculator Programmer 001.png
01 Calculator Programmer 002.png

With the Microcontroller programmed with the default settings and the LCD connected, we should get readings from the Temperature sensor.

Using the coasters temperature sensor find the following temperatures. First being the highest temperature, last being the lowest.

  • Too Hot.
  • Drinkable.
  • Perfect.
  • Going Cold.
  • Cold.
  • A low temperature below all the above, that you would like the LEDs not to be on.

What happens at each temperature setting:

Too Hot.

Above this temperature. The Red LEDs will be on.

Drinkable.

Above this temperature and below Too Hot temperature. The Red LEDs will be on and the Green LEDs will be flashing.

Perfect.

Above this temperature and below Drinkable temperature. The Green LEDs will be on.

Going Cold.

Above this temperature and below Perfect temperature. The Green LEDs will be on and the Blue LEDs will be flashing.

Cold.

Actually this setting is not used. If the Temperature is below Going Cold. The Blue LEDs will be on.

A low temperature below all the above.

This setting will turn off all LEDs if the sensor is below this setting.

  • This setting also require a flag set to perform tis action.

Note!

All the Settings need to be Hexadecimal values.

Windows has calculator that can be used to convert Decimal to Hexadecimal.

  • Open Calculator.
  • Click on the three lines Icon. (1)
  • Chose "Programmer" from the list. (2)
  • Select "DEC" on the left. (3)
  • Click "CE" button if you need to clear a previous entry. (4)
  • Enter the temperature reading using the numeric key pad. (5)
  • Read the value in Hexadecimal at "HEX". (6)

Make a note of all your temperature values and there corresponding HEX value.

Changing Settings

03 Data 001.png
03 Data 002r.png
Hot Beverage Coaster 021.png
Hot Beverage Coaster 022.png
Hot Beverage Coaster 023.png
Hot Beverage Coaster 024.png

To change the setting we use the STVP (ST Visual Programmer).

Make sure you have the microcontroller connected via the ST-Link.

  • When we are all done we will not have the LCD connected, so have this disconnected at this stage.
  • Should you wish to repeat the above step 12, and reconnect the LCD, one of the following setting will need changing back.

Open STVP.

  • Click the "DAT MEMORY" Tab. (1)
  • Click: "Read" on the toolbar. (2)
  • Select: "Current tab". (3)

This will load the "DATA MEMORY" from the microcontroller.

  • This should currently the same as the file we uploaded to the microcontroller in step 10.
  • If you didn't do step 10 it will be whatever was on the microcontroller.

I have done an image of what the current DATA MEMORY should be. In the image I have identified the settings with a letter.

  • Only the first three lines are used by the program.

This is what each value represents.

A

Hex value of Too Hot.

B

Hex value of Drinkable.

C

Hex value of Perfect.

D

Hex value of Going Cold.

E

Hex value of Cold. (not used)

F

Hex value of a low temperature below all the above, that you would like the LEDs not to be on.

G

Hex value of what is displayed on the top line of the LCD.

  • This can be edited normally on the right hand side of the HEX values.

H

Hex value of 1 or 0.

  • This is a Flag. Set to 1 if the LCD is connected. Set to 0 if the LCD is not connected.
  • If this flag is set to 1 and the LCD is not connected, the Microcontroller will hang.

I

Hex value of 1 or 0.

  • This is a flag. Set to 1 if you want to turn off the LEDs below a set temperature. Set to 0 if you want the LEDs to be always doing something.
  • This setting works with the F setting.

All data below these three lines are not used.

After changing the setting to your preferred settings:

  • Click: "Program" on the toolbar. (4)
  • Select: "Current tab" (5)

If you want to save your settings to a file:

  • Click "File" on the Toolbar. (6)
  • Select: "Save As...". (7)
  • Browse to where you want to save the file. (8)
  • Give it a name. (9)
  • Click the Save button. (10)

All Done

Hot Beverage Coaster.gif

When you have finished programming the coaster.

  • Attach the lower half using the four screws.
  • Plug in a USB to give it power.
  • Sit you hot beverage on the coaster.

Your coaster should let you know the perfect time to drink your hot beverage.

I found for it to work properly the beverage has to start of verry hot, the heat of the beverage needs to get through the Mug to warm up the sensor to the same ambient temperature of the mug. When all has equalized Mug and Coaster, a relative temperature can be used.

Probe Option

Hot Beverage Coaster 025.png
Hot Beverage Coaster 026.png
Cut All Probe.png

I decided to add a Probe option.

  • Using a probe the temperature reading is an actual and not a relative reading.
  • The reading is faster, more accurate.
  • The downside is there is one more action you have to when you place/remove your beverage to/from the coaster. You have to place/remove the probe in your beverage.

The temperature setting will be totally different to the setting used on the coaster sensor.

  • So a different set of temperature settings are required if using a probe.

I fed the probe cable in from the back below the Microcontroller Module, There is a gap it can fit through, and it gets clamped when the two halves are screwed together.

  • I disconnected the DQ lead of the coaster sensor.
  • Make sure the pull-up resistor is still connected in the circuit.
  • I connected the Yellow Probe Lead to the D2 pin on the microcontroller.
  • I connected the Black Probe Lead to the GND on the microcontroller.
  • I connected the Red Probe Lead to the 3.3 volts on the microcontroller.

Done some DXF flies for the Probe Holder.

  • I glued the Probe holder together using supper glue.