Yoyodyne Monkey Works

"Where the future begins tomorrow!"

YACPUS!

Yet Another CPU Swap
or
Why Does My Refrigerator Need WiFi?

Samsung makes the worst appliances. Seriously. They have made exploding phones1, exploding clothes washers2, and have made diet sodas explode in my refrigerator.

This story begins when my neighbors, who are truly wonderful, offered me their old refrigerator because it kept randomly freezing the food in the refrigerator compartment solid. I thought it would be a good fit for my shop and took it off their hands, hoping I could repair it.

I could not. It would glitch during power failures, which unfortunately happened frequently at the shop. We kept a lot of soft drinks in the fridge and the worst victims were the diet sodas. Being mostly water, they would freeze, explode, and paint the inside of the refrigerator with frozen cola. I’d come in and see the refrigerator temperature on the display at 15 degrees Fahrenheit and dread opening the door.

Despite knowing this, one of the officers at the shop bought a fairly high-end Samsung refrigerator. It began icing up at the in-door icemaker, causing it to become inoperative. When the dealer couldn’t repair it, they refunded his money and let him keep the refrigerator. He was happy with that outcome. There are YouTube videos of people repairing Samsung refrigerators that were icing up due to insufficient drain heating3 and also due to improper interior panel seals that let moist air get behind them to condense, freeze, and then block and stop the fan.

An odd fact about me is that I have never purchased a refrigerator. The refrigerator I have is a Kenmore Coldspot that’s been handed down twice. It’s a side-by-side, made by Whirlpool 40 years ago, with an icemaker in the freezer. Over the years, I have had to clean the coils, replace the door gaskets, and replace the thermostats to get the icemaker going.

My grandparents had a GE Monitor Top refrigerator that was made in the 1930s. Prior to that, they had an iceman who regularly came in without knocking or saying a word and delivered ice into their icebox. The GE Monitor Top was relegated to the back room when the growing family required a larger unit. It served its duty keeping sodas and overflow groceries cool until my grandparents passed away sixty years after it was made. It lasted a literal lifetime. 

The Samsung lasted eight years before my neighbors decided to get rid of it. American manufacturers have been making refrigerators for over a century now, twice as long as Samsung, and have gotten it pretty dialed in with a minimum number of parts. The engineers of Samsung thought my refrigerator needed a microcontroller. For more than half a century, no refrigerator required one. Now this one has more computing power than my first home computer just to keep food cold. Most people reading this know the engineers should have used a 555 instead.

The controller board for this refrigerator employs a KA75330 voltage detector IC to control the reset line on the Samsung S3P848 microcontroller. This is supposed to prevent power-related glitches. The temperature settings are stored on a 93C46 EEPROM. Some televisions have been bricked when this type of device has gotten corrupted data. I replaced the EEPROM to no avail. I also tried adding a supercapacitor to the 5V supply, without success. So I ordered a used controller board from eBay. I didn’t want to spend serious money on a free refrigerator. The replacement controller didn’t work and I didn’t want to gamble more money. I concluded there was probably a software bug and decided I would swap out the microcontroller with my own programming so I would know exactly what was happening. As a stopgap measure, I monitored the temperature to alert me to a freezing event with a custom setup using SmartThings until, ironically, Samsung acquired that company and ruined it.

Original Controller

The initial plan was to use an Arduino Mega 2560 for the large number of GPIO pins required, and I was going to have an ESP8266 attached for over-the-air (OTA) firmware updates. I wrote the bulk of the firmware and started drawing up the adapter. My plan was to remove the Samsung microcontroller and install a socket in its place. This would be an easy way to make a large number of connections to the refrigerator, have it provide all the necessary relays, current drivers, and power supplies. I unsoldered the 64-pin microcontroller and soldered in a machined-pin socket. My grand scheme was to place the Atmel processor and its oscillator directly on the adapter board I was going to make. This was as far as I got.

Fast-forward to now, and AI has come a long way. It dawned on me that I could have AI help me finish this project. I provided what I had partially written and vibe-coded the rest. I used Claude because another officer at the shop uses it professionally. Claude was pretty amazing. He said my skeleton code was good and solid. In this skeleton code, I had an array of 368 elements that had all the polarity combinations of a six-by-six matrix of GPIO pins that would be needed to create the digits 0-9 on a seven-segment display. Claude immediately pointed out that I had omitted one segment of the digit six. He was able to figure out what I was attempting and what the visual results should be. At one point I told him that he had left something out of a file that caused a compiler failure. He said he had included it in my repository and that I had probably failed to download it locally. He had correctly diagnosed what my mistake was.

To help get the project finished, I decided to forgo having a custom circuit board with my own microcontroller IC on it, and instead have a socket for a microcontroller board. This would also potentially allow for upgrades or easy failure replacement. When I discussed hardware choices with Claude, he was partial to the ESP32, but the ESP32 uses 3.3-volt logic while the refrigerator uses 5-volt logic. He was advocating for 74HCT595 shift registers and ADS1115 ADCs. He said the ADC on the ESP32 was non-linear and noisy. Also, the ESP32’s ADC is 12 bits, whereas the ADS1115 is 16 bits. I wanted a minimal part count on the adapter board and suggested using an ESP32-S3 with its higher pin count to allow for the elimination of the 74HCT595s. I also went with using voltage divider resistors for logic level conversion between the ADS1115s and the ESP32. Using the ADS1115s, in addition to getting better readings, also allowed me to connect several thermistors to the ESP32 over a single I2C connection.

I was hesitant to ask then thought it couldn’t hurt to ask, but surely there was no way. I asked Claude if he could generate Gerber files for the PCB house. Not a problem. I provided him with the Samsung 64-pin CPU pinout and the pin order of the ADS1115 modules I purchased from Amazon. He banged it out and even provided a graphic of what it would look like. Flabbergasted, even gobsmacked I was! I had him generate KiCad files and was able to turn off and on the different layers and do a basic sanity check of the layout. When I received the boards back from the fab house, I soldered in the 64-pin machined-pin headers, Dupont-style sockets for the ESP32-S3, and a two-pin header for a power jumper that Claude threw in for when I might not want the ESP32 trying to power the Samsung controller board, or vice versa.

Mostly Bare Board
Adding the Socket for the ESP32
Soldering in the ESP32 Socket
ADCs Installed
Adapter Installed in the Controller

I installed the improved controller into the refrigerator and it worked! Sort of. Everything functioned as planned, but the next morning the refrigerator was warmer than it should have been. I suspected Claude or I had gotten something wrong. Turns out the compressor relay was bad. It’s the white one in the photo. This is probably why the used eBay board didn’t fix the problem. So the controller came back out and a new relay was installed and it worked flawlessly! Done, right?

Well, when I was troubleshooting the cooling problem, I noticed that Claude was guessing what the existing controller circuit looked like and there was no need for that, so I uploaded the service manual. When I did, he pointed out that I had made no provision for the refrigerator defrost heater. So out the controller came again. I wired in the heater relay while Claude updated the code. He also noted several errors in the manual, including an incorrect value in a sensor table and troubleshooting steps that referenced the wrong connector, which could lead a technician astray. Despite those shortcomings, I thought the manual was excellent and one of the things Samsung got right. I’m not in the appliance trade, but it’s one of the best manuals I’ve seen: thorough, and complete with schematics. It’s what made this project possible. The controller has now been reinstalled, hopefully for the final time, and has been running for over a week. No more exploding sodas!

Buried in the steel cabinet of the refrigerator, the WiFi didn’t work well when the refrigerator was pushed against the wall. So I added an external antenna from the parts bin using the U.FL / IPEX connector on the ESP32-S3.

Adding External Antenna
Antenna Installed

The refrigerator is twenty years old now. Its LEDs had grown dim, so the attract mode wasn’t very impressive.I decided to replace the LEDs and was surprised to find that the displays weren’t old-school 7-segment modules but individual SMD LEDs behind light guides. I don’t do much hot-air reflow work and didn’t use a solder-paste stencil, so that was a challenge. I replaced them with 1206-size LEDs I found on Amazon, which are slightly larger than the originals.

Original LEDs
Newly Installed LEDs
FrigeDuino
FrigeDuino
Version 2.3

fridge = 35.5 °F
fridge setpoint = 36 °F
fridge defrost sensor = 0.1 °F
fridge door = closed

freezer = 0.3 °F
freezer setpoint = 0 °F
freezer defrost sensor = -3.1 °F
freezer door = closed

compressor = off
compressor fan = off
compressor run time since defrost = 5 hours 22 minutes

ambient = 72.7 °F
defrost = idle
defrost heaters = off
active alerts = none
uptime = 9 days 3 hours 40 minutes
5 V rail = 4.98 V
last button pressed = SW4

Web Status Page

Door Ajar Alert and Attract Mode Demo

Features:

  • Uses bang-bang compressor control with hysteresis plus a three-minute minimum on time and a five-minute minimum off time (also applied at power-up).
  • Defrost starts after eight hours of compressor run time. The compressor and fans are stopped and the heater runs until the evaporator reaches 50 °F. The heater shuts off after 30 minutes as a safety cutoff (12 minutes if the defrost sensor is dead), followed by a five-minute drip period.
  • A dead sensor puts the related compartment on a fixed 12-minutes-on / 18-minutes-off cooling cycle.
  • Settings are stored in flash memory and are written three seconds after the last button press to avoid wear on the flash memory. Settings are CRC-checked and fall back to defaults if the check fails.
  • Fans are turned off and the lamps come on when a door opens. If a door is left ajar for too long, the Imperial March plays.
  • Web status page over WiFi as well as the ability for software updates.
  • Remote notification of out-of-range temperatures, compressor on too long, and reset events.
  • Attract mode that displays one of seven different sequences on the seven-segment LED displays at random while idle.
  • An Easter egg that displays my name.

Afternotes:

Lately, especially after COVID, parts and products have been pretty shoddy across many product types. For refrigerators, one out of every ten sold required service in the first year.4

Aviation engineer Bill Lear said “Strive for simplicity. You never have to fix what you leave out,” a sentiment echoed by Elon Musk as “The best part is no part.” If you don’t have an icemaker, it will never need servicing. If you have to have one, the best location is in the freezer. A worse location is in the refrigerator. The worst location is in the freezer door; these have the highest number of service calls.

The most reliable refrigerators have the freezer compartment at the top. The Whirlpool WRT518SZFM is known as a reliable example. If you have to have a French door refrigerator, according to YouTube experts, Bosch makes the most reliable ones. Hotpoint, Frigidaire, and even LG, despite a wave of compressor failures, also rank as more reliable than other brands.

  1. DOT Bans All Samsung Galaxy Note7 Phones from Airplanes, https://www.transportation.gov/briefing-room/dot-bans-all-samsung-galaxy-note7-phones-airplanes, https://www.cpsc.gov/Recalls/2016/Samsung-Recalls-Galaxy-Note7-Smartphones ↩︎
  2. Samsung recalls 2.8m washing machines after reports of explosions, https://www.theguardian.com/technology/2016/nov/04/samsung-washing-machine-recall-explosion-risk ↩︎
  3. How to Fix a SAMSUNG RF 267 Refrigerator Not Cooling Icing and Freezing…, https://www.youtube.com/watch?v=7NtIFdfC9fk ↩︎
  4. https://blog.yaleappliance.com/the-best-counter-depth-refrigerators
    Based on real service data, but does not reflect Samsung as they do not carry that brand.
    ↩︎

Leave a Reply

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

Yoyodyne Monkey Works © 2017 Any resemblance to any person living or dead is purely coincidental. Frontier Theme