Temperature alarm for boiling milk

Anyone who has ever boiled milk on the stove knows, that it has a nasty habit of overflowing. That is why I created the temperature alarm for boiling milk to be used my mother. It continuously measures the temperature of the milk and sounds an alarm when the temperature is over the preset alarm value.
Temperature alarm uses an Atmel attiny841 microcontroller, DS18B20 high temperature waterproof temperature sensor from adafruit, 2×16 HD44780 LCD and a buzzer to do its job.
I’ve designed the pcb in KiCAD, etched the pcb at home and soldered it together. The circuit is fairly simple so it fits nicely on a single sided pcb. The attiny841 is programmed using my avr-usb-programmer.
The case is made from 4mm plywood and the buttons are small pieces of wooden rod glued to a square piece of plywood so they can not fall out.

How it works

Measuring temperature

DS18B20 is a very simple 1-wire interface temperature sensor, that returns its output nicely in degrees Celsius, so all we have to do is request a conversion, wait for the result, read the output and display it.
I found a nice library by Jacajack that does all the heavy lifting for me, and all I have to do is call the function.
I’m reading the temperature approximately every half a second, triggered by a timer. For the sensor to work this fast I have to set lower resolution, but as I’m only displaying temperature to one decimal place, it is good enough.

Hardware interface to the temperature probe is also simple, just supply 5V and GND and connect signal to a MCU pin with a 4k7Ohms pull up. There is a mistake in my schematics and board, and I had to hack the pull up, but luckily the 5V was right next to the signal so I was easily able to solder an 0805 resistor in.
I’m using the computer fan connector, because it was the only keyed connector I had at home.



Interface to display is standard HD44780. I’m using the 4-bit mode as it only requires 6 pins on the microcontroller. The hardware also requires a potentiometer for contrast setting and supply for lcd and led backlight.
I’m using a library I wrote for this type of lcds, and it can be found in my avr-cpp-lib repository.

User interface

The user interface is really simple, I have 3 buttons:

  • up increases alarm temperature
  • down decreases alarm temperature
  • center turns the alarm off

Sometimes simplicity is simply the best.
Read More: Temperature alarm for boiling milk

Leave a Comment

Your email address will not be published. Required fields are marked *