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 1615318190940.png](https://expeditionportal.com/forum/data/attachments/549/549596-57f967dbf32c0b72d98f88d0d1c97005.jpg)
![1615318708587.png 1615318708587.png](https://expeditionportal.com/forum/data/attachments/549/549599-6b621de3d57a0c362c257b0088ddef89.jpg)
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 1615318815709.png](https://expeditionportal.com/forum/data/attachments/549/549604-53ea6359fb688526f1ae0c5737c90547.jpg)
![1615319310592.png 1615319310592.png](https://expeditionportal.com/forum/data/attachments/549/549607-ece653252be8c04158341b2f9bb2842f.jpg)
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 1615318801382.png](https://expeditionportal.com/forum/data/attachments/549/549603-5f4b47989a155a32590bff722121b681.jpg)
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.
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 1615318190940.png](https://expeditionportal.com/forum/data/attachments/549/549596-57f967dbf32c0b72d98f88d0d1c97005.jpg)
![1615318708587.png 1615318708587.png](https://expeditionportal.com/forum/data/attachments/549/549599-6b621de3d57a0c362c257b0088ddef89.jpg)
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 1615318815709.png](https://expeditionportal.com/forum/data/attachments/549/549604-53ea6359fb688526f1ae0c5737c90547.jpg)
![1615319310592.png 1615319310592.png](https://expeditionportal.com/forum/data/attachments/549/549607-ece653252be8c04158341b2f9bb2842f.jpg)
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 1615318801382.png](https://expeditionportal.com/forum/data/attachments/549/549603-5f4b47989a155a32590bff722121b681.jpg)
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
Last edited: