Fridge Controller for Danfoss/SECOP powered fridges/freezers

luthj

Engineer In Residence
We have a Danfoss/Secop based fridge/freezer in our van (Common to isotherm, vitrifrigo, truckfridge, indelB etc). Like most is was delivered with a garbage mechanical thermostat that kinda guessed at the freezer temp. We had to adjust winter/summer to keep the freezer cold enough, and it cycled fairly often.

We decided on a mod to improve on these issues.

The first step is to isolate the freezer compartment from the fridge compartment. Since the evaporator plate is in the freezer compartment, we needed to add a way to control heat transfer between the two. The first step was to insulate the freezer drip tray. 1/2" XPS foam worked fine with 90% coverage. We then covered the majority of the air/vent holes. The freezer door got some brush style weather stripping and a bungee to keep it closed tight. The second part of this is a small blower (a fan works fine). This unit is a generic 12V unit for small PCs and electronics. It uses about 100mA at full speed. This internal fan needs to be controlled separately from the compressor, so it will be driven by a FET controlled by the microcontroller PWM output. I suggest 5khz or greater PWM frequency to keep noise down. We ran ours at 65% duty cycle, but I still covered the output 80% with some tape to avoid big temp swings, as it moves a lot of air.

1615318190940.png

1615318708587.png

Now we need a method to regulate the compressor. The simplest method is to use the "T" (thermostat) input on the compressors attached control board. This is a 5V source, and when switching to ground (drain), the compressor speed can be varied. The list below shows the duty cycle of a 5khz PWM vs the current on T. There are two ways to turn the compressor off, 100% duty cycle (0mA current) or setting the microcontroler output pin to input (high impedance) mode.

0% = 5mA
5% = 5mA
10% = 5mA
15% = 4-5mA
20% = 4mA
25% = 4mA
30% = 4mA
40% = 3mA
45% = 3mA
50% = 3mA
55% = 2-3mA
60% = 2mA
65% = 2mA & does not turn on

Step three is to monitor the temperatures in the freezer and fridge compartments. We went with some 10k thermistors which were read through voltage divider circuits outputting to the ADCs on the microcontroller. I had to add some 3nF capacitors across them to remove a 50mv noise/ripple produced by crosstalk (I had a 4ft cable to the controller from the fridge YMMV).

For monitoring we added a blueooth module, and setup a dashboard using virtuino (see attached projects).

From here its a matter of making up a circuit with microcontroller and external components. An arduino nano would probably work for less space and cost. We went with a uno as I had one on hand. Then built a prototype shield to hold everything. The code will probably work with a nano, but you would need to change pin numbers to match up, and remove the voltage divider for the bluetooth module (5 to 3.3V logic conversion), and possibly change the PWM timer strings. I had a buck style DC converter on hand, so I set that to 7V and connected it to the Uno Vin. The controller needs to share a common ground with the SECOP/Danfoss control unit (should work with BD35/50 models). I suggest getting your power from the back of the compressor, piggyback spade connectors work fine. You don't want any ground offset if avoidable.


The code is mostly attached. You will need to grab the 1.8 version of virtuino, the recent versions of softwareserial, and the bit/bool array libraries.




1615318815709.png
1615319310592.png


Here you can see one of two dashboards. You can change the desired fridge and freezer temperatures from here. Compressor and internal fridge status can also be viewed. The other dashboard shows the number of minutes the fridge/freezer were in the "danger zone" in the previous periods.

1615318801382.png

In brief the controller has persistence of desired temperature, which is saved to EEPROM. It tries to keep the setpoint by varying compressor speed, which results in higher duty cycles, but lower power consumption. The fridge is maintained by pulling cold air from the freezer compartment. The freezer is maintained by running the compressor. Duty cycle values aren't rolling, so they will but a bit funky after initial startup, nor are they persistent through a power cycle. To get higher frequency PWM on the uno we used custom timer settings, there are a couple tools to help calculate them.
 

Attachments

  • Fridge_Project.zip
    6.3 KB · Views: 4
  • Virtuino Dashboards.zip
    4.2 MB · Views: 3
Last edited:

luthj

Engineer In Residence
For results, we have been running this for 4 days now. There was some initial debug, but it appears to be working well. Ice cream stays firm, fridge stays right in the desired range. This is a 110liter fridge with BD35 compressor. With the dynamic compressor speed built into the controller, the duty cycle is 50% with ambient temps at 60s high and 40s low. This seems like a lot, but the fridge is at low speed a lot of that time. High being 3500rpm and low be 2,000rpm.

A few notes. The thermistors will pick up temperature changes quickly, especially if the fridge isn't very full. After putting a few room temperature items in the fridge and leaving it open for a couple minutes, it shot up to 45F. It cooled back down shortly, but high temperatures like that could be alarming. When undisturbed it cycles within a 4F range for both compartments.

When it gets very cold (winter for example). The controller will prioritize keeping the fridge above freezing. This allows the freezer to warm to around 25F before the compressor is called back on. This eliminates the fridge freezing when the van is 40F, but will let the fridge drop below 33F if the freezer gets near thawing.

With a few modifications this controller could be used with other compressor types. Obviously the variable speed option would need to be removed, and the output used to switch a relay.
 
Last edited:

luthj

Engineer In Residence
They do have a modbus on some models, but it an odd proprietary format, so you would need to code your own implementation.
 

OllieChristopher

Well-known member
Thanks for sharing. I personally would not go to all that trouble but it looks like you enjoyed the time consuming modification. As long as you enjoyed it then two thumbs up!!
 
  • Like
Reactions: plh

luthj

Engineer In Residence
It took about 2 weeks on and off to get the hardware together and testing it out. It was a fun project. If there was an off the shelf product that let me control both a fridge and freezer, I would have bought it!

We live in our van for years at a time, so having easy to use fridge/freezer is important to us. Space constraints prevented us from moving to two separate units.
 

67cj5

Man On a Mission
The BD-35 is normally fitted to Off road fridges up to 60L but in an industrial type fridge they are fitted to much bigger fridges, They can take a long duty cycles so there is little chance of them giving up the ghost,

As for the original problem I think I would be looking at a more efficient fridge.
 

OllieChristopher

Well-known member
An ESP32 could be used to read the bus and provide a report on fridge temperatures at the same time be used to tweak temperatures like making it quiet at night time and cool more during peak sun, so it stores thermal energy in the freezer when batteries are already full.
A breakout board like this can be used: https://copperhilltech.com/lin-bus-breakout-board/ or this https://www.superhouse.tv/linmod/

I can only see how this would be useful if you are building your own fridge/freezer.

Correct me if I'm wrong as it has been a while since working with these microcontrollers. I don't see how you can read the buss with just the standard ESP32. Wouldn't you have to have the ESP32-S2 that has the USB host built in? This way you can control all your data transfers with multiple clients to the system.The S2 model also has the advantage of very stable and secure 4096 bit inscription and also uses only half the power consumption in sleep mode.
 

WanderingBison

Active member
We have a Danfoss/Secop based fridge/freezer in our van (Common to isotherm, vitrifrigo, truckfridge, indelB etc). Like most is was delivered with a garbage mechanical thermostat that kinda guessed at the freezer temp. We had to adjust winter/summer to keep the freezer cold enough, and it cycled fairly often.

We decided on a mod to improve on these issues.

The first step is to isolate the freezer compartment from the fridge compartment. Since the evaporator plate is in the freezer compartment, we needed to add a way to control heat transfer between the two. The first step was to insulate the freezer drip tray. 1/2" XPS foam worked fine with 90% coverage. We then covered the majority of the air/vent holes. The freezer door got some brush style weather stripping and a bungee to keep it closed tight. The second part of this is a small blower (a fan works fine). This unit is a generic 12V unit for small PCs and electronics. It uses about 100mA at full speed. This internal fan needs to be controlled separately from the compressor, so it will be driven by a FET controlled by the microcontroller PWM output. I suggest 5khz or greater PWM frequency to keep noise down. We ran ours at 65% duty cycle, but I still covered the output 80% with some tape to avoid big temp swings, as it moves a lot of air.

View attachment 646731

View attachment 646734

Now we need a method to regulate the compressor. The simplest method is to use the "T" (thermostat) input on the compressors attached control board. This is a 5V source, and when switching to ground (drain), the compressor speed can be varied. The list below shows the duty cycle of a 5khz PWM vs the current on T. There are two ways to turn the compressor off, 100% duty cycle (0mA current) or setting the microcontroler output pin to input (high impedance) mode.

0% = 5mA
5% = 5mA
10% = 5mA
15% = 4-5mA
20% = 4mA
25% = 4mA
30% = 4mA
40% = 3mA
45% = 3mA
50% = 3mA
55% = 2-3mA
60% = 2mA
65% = 2mA & does not turn on

Step three is to monitor the temperatures in the freezer and fridge compartments. We went with some 10k thermistors which were read through voltage divider circuits outputting to the ADCs on the microcontroller. I had to add some 3nF capacitors across them to remove a 50mv noise/ripple produced by crosstalk (I had a 4ft cable to the controller from the fridge YMMV).

For monitoring we added a blueooth module, and setup a dashboard using virtuino (see attached projects).

From here its a matter of making up a circuit with microcontroller and external components. An arduino nano would probably work for less space and cost. We went with a uno as I had one on hand. Then built a prototype shield to hold everything. The code will probably work with a nano, but you would need to change pin numbers to match up, and remove the voltage divider for the bluetooth module (5 to 3.3V logic conversion), and possibly change the PWM timer strings. I had a buck style DC converter on hand, so I set that to 7V and connected it to the Uno Vin. The controller needs to share a common ground with the SECOP/Danfoss control unit (should work with BD35/50 models). I suggest getting your power from the back of the compressor, piggyback spade connectors work fine. You don't want any ground offset if avoidable.


The code is mostly attached. You will need to grab the 1.8 version of virtuino, the recent versions of softwareserial, and the bit/bool array libraries.




View attachment 646739
View attachment 646742


Here you can see one of two dashboards. You can change the desired fridge and freezer temperatures from here. Compressor and internal fridge status can also be viewed. The other dashboard shows the number of minutes the fridge/freezer were in the "danger zone" in the previous periods.

View attachment 646738

In brief the controller has persistence of desired temperature, which is saved to EEPROM. It tries to keep the setpoint by varying compressor speed, which results in higher duty cycles, but lower power consumption. The fridge is maintained by pulling cold air from the freezer compartment. The freezer is maintained by running the compressor. Duty cycle values aren't rolling, so they will but a bit funky after initial startup, nor are they persistent through a power cycle. To get higher frequency PWM on the uno we used custom timer settings, there are a couple tools to help calculate them.

That’s awesome - thanks for sharing!

A couple of questions, if you don’t mind -

Have you heard of the Stainless Lobster? It’s a controller that was developed in the cruiser community as a start-up and that was purchased by another company, that now seems to have discontinued it. It also seems like the base of the Pika Outfitter product. How similar is your approach?

How do you find t with respect to frost build up? Has it helped? Have you built any intelligence to reduce frosting?

How essential is the insulation board? Wondering since it reduces space. Also, how has it survived being exposed? Do you think it needs to be protected in the long run?

Thanks again - I look forward to making holes and modding my Isotherm fridge ... I guess we don’t spend enough to get a great fridge




Sent from my iPhone using Tapatalk Pro
 

luthj

Engineer In Residence
Have you heard of the Stainless Lobster?

I haven't heard of that product, but I don't follow the marine stuff closely.


How essential is the insulation board? Wondering since it reduces space. Also, how has it survived being exposed? Do you think it needs to be protected in the long run?

It depends on the model, but without some insulation on the freezer tray, the fridge and freezer temperatures are much more closely coupled. This creates the situation where keeping the freezer nice and cold can cause the fridge to freeze in cold weather. You needs may vary, but at least 1/4" of XPS foam is suggested. You might get by with just plugging most of the air holes/gaps, but I doubt it.

The XPS insulation is closed cell and won't absorb stuff. Its also pretty tough. So unless you are really beating on it, it should last many years.

The isotherm smart energy controller (there is a newer version, but I haven't used it), can get you pretty close. Put the probe in the freezer and set it to freezer mode. Then insulated the freezer tray as I have described. If you find the fridge temp to be hard to dial in with insulation/air gaps, you can add a small fan, and a thermostat in the fridge to control air movement. Its quite fiddly.

Some folks report the stock thermostat setup works fine for them. It really depends on the usage case and specific unit. I suggest testing a new unit out before making any modifications.

-----------------------

As a bit of an update, I was having some stability issues (really unusual for ATMEGA 328 applications). I think I have it solved, turns out running the fan at 10khz PWM was creating some odd noise with the brushless fan controller. Switching to a simple on/off state instead of PWM speed control seems to have solved the issue.

I have also decided to log the fridge duty cycle data on the EEPROM for persistence. This will allow me to store around 80-90 days of duty cycle data. The EEPROM should last at least 20 years with this much writing. Likely a lot longer.

I will post the code once I have a few weeks of testing.
 

Saabologist

New member
DANFOSS BD35 WIRING ISSUE. Any tips and advice appreciated!

Hi there, what a great thread thanks!

I am perplexed by my 101N0210 controller! I have a 2003 Danfoss unit on a Waeco portable fridge. ISSUE: Linking C+T will not start the compressor. But, grounding the T terminal will make the compressor run even if C is disconnected. When I wire a digital temp relay the relay works but the compressor will never stop running. Is there any way I can wire a thermostat to this old 101N0210 controller?

- This is an old Waeco cf50 I bought in 2003.
- I recharged the system to 10psi and it gets very cold.
- BUT the controller will not respond to the thermostat. (I've connected two thermistors and know they are both good.)

Thanks for any helpful comments!
 

luthj

Engineer In Residence
DANFOSS BD35 WIRING ISSUE. Any tips and advice appreciated!

Hi there, what a great thread thanks!

I am perplexed by my 101N0210 controller! I have a 2003 Danfoss unit on a Waeco portable fridge. ISSUE: Linking C+T will not start the compressor. But, grounding the T terminal will make the compressor run even if C is disconnected. When I wire a digital temp relay the relay works but the compressor will never stop running. Is there any way I can wire a thermostat to this old 101N0210 controller?

- This is an old Waeco cf50 I bought in 2003.
- I recharged the system to 10psi and it gets very cold.
- BUT the controller will not respond to the thermostat. (I've connected two thermistors and know they are both good.)

Thanks for any helpful comments!


What is the voltage between C and T? Between C and ground/negative?
 

Saabologist

New member
What is the voltage between C and T? Between C and ground/negative?

All Voltages taken with power ON from battery:
--Voltage between - and + is 12.7 running off a fully charged 100 ah battery.
-- Voltage between C and T is 0.05
-- Voltage between C and ground is 0.0
-- Voltage between T and ground is 4.84 and compressor runs and fridge gets cold. But it takes a while.

Thanks for helping me diagnose this,
 

Forum statistics

Threads
185,541
Messages
2,875,681
Members
224,922
Latest member
Randy Towles
Top