Close
0%
0%

Hacking a microwave

I added a STM32 (nucleo board) in a microwave to program its firmware :D

Similar projects worth following
You may ask yourself "why?", but the best question is "why not?"
I wouldn't define this project as "hacking" because I'm not using the original microcontroller, but hacking is a cool word and attract some clicks, so I put in the title. My intention here was to change the controller and use a STM32 instead. The original purpose here was a programming exam for my students. Coding a real product is challenging even when seems simple...
In the way I could learn some new stuff from the original design, I love solutions made in products manufactured in large scale. I'll explore this solutions, raise some questions (from things I didn't understand) and describe how I've hooked up the nucleo here.
The final code runs just a basic functionality, my idea wasn't to replicate the working model, but to mess around with it! Hope you enjoy!

Introduction

Believe you or not, I've used a brand new microwave to do this. I've looked for the cheapest option with numeric digital keyboard and display I could find in UAE and got this model:

Honestly I never heard of this brand before, but the model was perfect for me!

First step was opening the machine. Second step was trying to understand how it works.

I didn't try to find the schematics online, tried to understand the circuit by myself (not really difficult, right?) and I got really surprised how fun it is! It has several hardware safety features. I'll talk about them one by one, but let's start by what I've found in the microcontroller's pinout:

IC1 pinFunction
1
Keyboard line 2
2Keyboard line 1
3NC relay
4Microwave generator relay
5Motor and light relay
6
Reset
7GND (Vss)
8NC
9Display CC4
10Display CC1
11Display CC3
12Display CC2
13???? I have no idea what it does
14Display segment A / Door
15Display segment B
16Display segment C / Keyboard column 6
17Display segment DOT / Keyboard column 5
18Display segment D / Keyboard column 4
19Display segment E / Keyboard column 3
20Display segment F / Keyboard column 2
21Display segment G / Keyboard column 1
22+5V (Vdd)
234MHz Crystal
244MHz Crystal
25Buzzer
26Keyboard line 3
27Keyboard line 4
28AC frequency in

Of course the part number was scratched, and I couldn't figure out what is this microcontroller considering Vdd, Vss, reset and crystal. If you know, make a comment!

Anyway, as my goal was to substitute the uC, I didn't spend much time searching for that.

Fun solutions found

One by one I'll point all features I noticed and liked. For some of them I'm not sure about the real reason but I'll raise some possibilities, if you know the actual reason put in the comments! 

Shared pins: The first nice feature was that most segments (anode pin) share pin with the keypad. While I was capturing the schematics and saw this I was very excited to alternate between inputs and outputs to make it work (as the code bellow). As @Ken Yap remarked in the comments bellow, it's not necessary to do so. Even being some obvious option to reduce pins I never thought about it when doing my own designs.

My solution in the firmware was creating a postscale inside the timer interruption handler with 5 steps as the quote bellow:

switch(postscale%5){
    case 0:    
        print7seg(display[0]);    
        setApin(OUTPUT);    
        DS1(0);    
        break;
    case 1:    
        DS1(1);    
        print7seg(display[1]); 
        DS2(0);    
        break;
    case 2:    
        DS2(1);    
        print7seg(display[2]); 
        DS3(0);    
        break;
    case 3:    
        DS3(1);    
        print7seg(display[3]); 
        DS4(0);    
        break;
    case 4:    
        DS4(1);    
        last_key=key;
        key=readKey();    
        setApin(INPUT);    
        door=HAL_GPIO_ReadPin(DOOR_PORT,DOOR_PIN);
        break;
}
postscale++;

Buzzer: This was one of my favorite things. The buzzer doesn't have an internal oscillator, and is possible to use it as a polyphonic speaker. I didn't implement that, but the fist thing came to my mind was a super mario themed microwave hahaha every key...

Read more »

Microwave hardware test.rar

RAR Archive - 8.79 MB - 05/15/2019 at 16:39

Download

Microwave basic firmware.rar

RAR Archive - 8.81 MB - 05/15/2019 at 16:39

Download

Microwave.pdf

Schematics

Adobe Portable Document Format - 27.95 kB - 04/30/2019 at 10:46

Preview

  • 1 × Microwave Evaluation, Demonstration Kits, Boards and Modules / Sample Kits
  • 1 × Wires
  • 1 × NUCLEO-L053R8

  • 1
    Hooking up the STM32

    After wondering all beauties of this mass production design, I started desoldering the microcontroller and soldering some header pins instead:

    Then comes the nucleo board:

    And finally I drawn some schematics to facilitate programming:

    And of course, add some hole to the USB cable:

    Here a very important note!!! Until program a stable software version, keep the microwave transformer hardware disconnected!

  • 2
    Hardware test code.

    Download the hardware testing code to check if is all functional. If it's not, have a good fault-finding.

  • 3
    Basic functionality code

    Once all hardware works, download the basic functionality code and modify it! :D

    The code I've attached here is really basic, doesn't have a clock configuration routine nether power control. It just have the real basic functions.

View all 3 instructions

Enjoy this project?

Share

Discussions

JamesSkidmore012 wrote 06/09/2023 at 05:07 point

Your creativity knows no bounds! Keep up the fantastic work. 

https://ptliga.fans/

  Are you sure? yes | no

Ken Yap wrote 05/16/2019 at 05:37 point

It's not uncommon to use the display multiplexing outputs to scan the keyboard as well. All the MCU needs to do is sense a level during the period when the display mux activates that scan line. This technique goes all the way back to single chip calculators.

Note that the scan pins don't have to alternate between input and output mode.

  Are you sure? yes | no

Gabriel D'Espindula wrote 05/16/2019 at 07:11 point

Yeah, you're right, is not needed to alternate between in and out, I didn't noticed before but only the columns are shared. When I was capturing the schematics got too excited to alternate between in and out and didn't see the full picture...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates