This project uses the Nucleo STM32-F303K8 microcontroller to create a mug heater device that keeps your drink warm. The device is powered by USB-A.
- Project Overview
- Device Images
- Circuit Diagram
- Connected Components
- System Features
- Assembly and Setup
- 3D Printing Files
- Future Improvements
- Important Considerations
- License
The mug heater is designed to:
- Maintain your drink at a desired temperature (default: 60°C).
- Be simple and portable with USB power.
- Use a combination of an NTC thermistor, a MOSFET, and a buzzer for temperature control and alerts.
- Load switching MOSFET gate on
PA11 - NTC Thermistor on
PA3 - Buzzer on
PA5which indicates a reached temperature - Button on
PA7which turnsoffandonthe heating - LED on
PA4which indicates the mode of heating:- Flashes and then
on: Starting heating - Flashes and then
off: Stopping heating
- Flashes and then
- Temperature Control: Reads ADC every 10 seconds and adjusts the load based on a specified temperature (default: 60°C).
- On/Off Button: Turns heating on or off and toggles an indicator LED.
- Buzzer Alert: Plays a sound when the specified temperature is reached.
- LED Feedback: Temperature is displayed as blinks (1 blink per 10°C).
- Debounced Button: Ensures stable toggling with a 50ms debounce threshold.
- Failsafe Temperature: System ignores invalid temperature readings and keeps the load off.
-
Required Components:
- Nucleo STM32-F303K8 board
- MOSFET: BUK542-100A (for load switching)
- 10k NTC Thermistor: R3
- Buzzer: 2400Hz
- Button: HX TS-1101-C-W
- LED: LED-0603_R
- Resistors:
- R1: 10kΩ (pull-down for NTC thermistor)
- R2: 510Ω (series resistor for button)
- R4: 300Ω (current limiting for LED)
- R5: 510Ω (NRST Short See Notes)
- USB-A power source
- Load: 3.4Ω heating element
-
Setup Instructions:
- Connect the peripherals as shown in the Circuit Diagram.
- Flash the microcontroller with the provided firmware.
- Assemble the device with proper insulation for the heater.
-
Programming:
- Use PlatformIO with VS Code for flashing the microcontroller.
-
Testing:
- Verify temperature control functionality.
- Test the buzzer, button, and LED indicators.
The following files are included for 3D printing the device components:
3d_print/02_Wire_Plate.SLDPRT3d_print/03_Base.SLDPRT3d_print/04_Top_Base.SLDPRT3d_print/05_Aluminum_Plate.SLDPRT
These files can be used to fabricate the structural parts of the mug heater.
- Plastic casing does not lock in place. It needs larger gap around locking mechanism.
- Custom PCB
- PID heating control
- Custom buzzer sounds - like Star Wars Imperial March etc.
- Automatic shutdown
- A 510-ohm short from
NRSTto3.3Vis required to power the device with a single cable. This bypasses the issue where the ST-LINK pulls down theNRSTpin, causing the microcontroller to remain in reset when ST-LINK is disconnected. - Ensure proper insulation for the heating element to prevent accidental burns or short circuits.
This project is open-source under the Apache License. Feel free to use and modify it!


