Question:
How can I protect my data on the Dreambox from a power failure?
The Dreambox uses the Linux-Ext file system which is known to be sensitive to power failure. Although the newer ext4 is a journaling file system, which in principle should be less sensitive, there are several reports on the net that such a file system has also been corrupted by a power failure. If you have many gigabytes and possibly cell phone videos stored there, this can be very annoying. Personally, I have also suffered a serious loss. I had a backup from a month before, but the nasty thing about this case was that the corrupted SSD was not recognizably broken. In the next monthly backup, only 5% of the data was still visible. The backup program 'rsync' was unfortunately programmed stupidly and did not abort the backup process despite reporting IO errors, but considered them deleted and deleted the same data on the backup (although no switch '
--ignore-errors' was specified). So now my backup was practically unusable too. Very annoying.
Answer:
I already have a commercial UPS (Uninterruptible Power Supply) for my PC, a kind of lead-acid battery with inverter, but as the Dreambox is in a different location, I didn't want such a big, complicated and expensive solution. The Dreambox only needs 12V direct current of max. 5 Ampère (60W). I recently stumbled across the extreme performance of modern Supercapacitors on the Internet. They are now also very cheap to buy. It immediately occurred to me that I could try to provide some emergency power for the Dreambox with them. 10 seconds would be enough to prevent most short power failures and thus data loss.
I found such a supercap module very cheaply on Aliexpress:
Detail data to the module:
According to my calculations, its power should last for at least 10 seconds.
The next step was to create a circuit diagram. This was the result:
- Such a supercap module has a very low internal resistance. It cannot therefore be connected directly to the 12V power supply, as this would cause a short circuit. This is why a 10 ampere fuse has been fitted directly at the input. This should never be omitted! Without the fuse, such a module can easily cause wires to incandesce. So be careful when handling and avoid short circuits. The module is not dangerous for humans, as the voltage is too low. The module has additional logic on its circuit board that protects the capacitors from overvoltage. However, this is irrelevant for our application, as we don't even get into the limit range anyway. The highest we can ever see with the Dreambox power supply is approx. 11.7 volts.
- The DM900 I'm using has a 12V power supply that can deliver a maximum of 5A. This means that you are dealing with a maximum of 60 watts. The wires must therefore be thick enough. The positive pole of the plug is in the middle.
- The diodes are deliberately oversized at 10 amperes so that they last for a long time and do not get particularly warm. Schottky diodes were used here, but “normal” diodes will probably also work. Each diode produces a small voltage drop in the forward direction, similar to a resistor. Schottky diodes only make about 0.5V while “normal” diodes make about 0.7V. This means that you get more power out of the UPS if you use Schottky diodes.
- The diodes regulate the current flow in the 2 states that the UPS can have:
- Input voltage present: D2 supplies current directly to the box (with 0.5V drop), D1 supplies current to the resistors that charge the module (ditto). The test showed that the adapter supplied 12.2V, and the box could work with the remaining 11.7V without any problems. Even with much less.
- Input voltage off: D3 supplies the module's current directly to the box (unfortunately also with a 0.5V drop). D1 and D2 prevent current from flowing back into the power supply and being lost.
- The resistors are large power resistors for max. 10 watts of power. They are used to limit the charging current. The 4 x 20 Ω can be regarded as a module with 5 Ω resistance, which can radiate a maximum of 40 watts of heat. At 11.7V behind the diode, a maximum of 2.34 amperes flow through it, so 27.4 watts. The 40 watts are therefore generously dimensioned. However, this heat is only radiated for a short time when the supercaps are still completely empty. The more they are charged, the less is radiated. When charged, nothing at all.
Construction of the circuit
First I quickly built a prototype to test the whole thing:
Surprise, surprise, the result was better than expected: The circuit was able to supply the box with power for a whole minute and 9 seconds. All clear for installation in a box. The result looked like this:
Another safety consideration: This UPS is only intended for occasional, infrequent charging, e.g. after a power failure. As mentioned above, approx. 10-25 watts of heat can be emitted for a few minutes. In such a closed plastic housing, this should not be done too often in succession. The capacitors should also not be exposed to much heat. I therefore took measurements to see how the temperatures and currents behave:
Charging Time |
Current [A] |
Temperature [°C] from Thermal Camera |
30 s |
0.75 |
41.1 |
1 min |
0.74 |
46.1 |
2 min |
0.47 |
47.5 |
3 min |
0.40 |
47.0 |
4 min |
0.24 |
43.8 |
5 min |
0.15 |
39.6 |
6 min |
0.10 |
36.7 |
7 min |
0.08 |
36.2 |
8 min |
0.07 |
35.4 |
This data was measured on an open UPS. Click on the temperature to see the thermal image. The bar on the right shows the maximum and minimum temperature in the image. It is interesting to note that the diode D1 is the element that gets the warmest, and not the power resistors. In the thermal image, D1 is therefore responsible for the maximum value in the bar on the right. The maximum temperature of approx. 47.5 °C is reached after approx. 2 minutes, after which the temperature drops again. Such temperatures are absolutely no problem for anything inside the UPS.
So that you can also see what the temperature looks like when the UPS is closed, I charged it again and opened the lid after 5 minutes. This is what it looks like. Unfortunately, the bar on the right was not switched on, but you can clearly see that hardly anything is warm.
Also good to know: The UPS is almost fully charged after about 8 minutes and ready for the next power failure. Of course, this only applies if the previous failure was longer than 1 minute 9 seconds.
In general, it would be better if a box with a metal lid were used, or if the whole box was made of metal. The resistors and diodes could then be attached to it. However, as the measurement data shows, this is not necessary in the application as a UPS.
You could also install the circuit directly in the Dreambox. That would reduce the heat risk. One problem I see there is getting to the input of the power supply and cutting it off. It would probably be easier to lead out two cables with a male and female plug and then plug everything in externally. If you then want to switch to a new box in a few years, you would have to remove the circuit again and move it over. A separate UPS box is an advantage here. A separate box can also be used for other devices with a 12V power supply.
Disclaimer: As I am not an electrical engineer, but a software engineer, I cannot provide any guarantee for this design! You make this replica at your own risk. Perhaps something like this is now available commercially, I recommend to check that beforehand. At the time this text was written, there was no such thing, so I did it myself. I also enjoy tinkering with electronics.
Material required
- 1 x supercap module for 13.5 V. Higher voltages and any other capacities can also be used without changes to the circuit diagram.
- 1 x 10 A fuse of some sort. I used a "Fuse Holder Panel Mount" because it can be used as a pole to solder components on.
- 3 x diodes 10 A
- 4 x power resistor 10 W 20 Ω
- 1 x socket for 12 V, 5.5 x 2.1mm, DC-022
- 1 x plug for 12 V, 5.5 x 2.1mm, DC-022
- Approx. 50 cm 5 ampere cable
- 1 x box approx. 14 x 8 x 4 cm or larger. It would be better with a metal lid or made entirely of metal.
- Some plastic or hot glue for fixing the supercap module and for strain relief of the cables.
Tools required
- Soldering iron and solder
- Drill and drill bits with diameters of 4, 12 and 13 mm. For 12 and 13 it is best to use a Unibit drill.
- Pliers
- Screwdriver size 3
- Optionally a Small wrench for variable sizes
- Optionally Shrink tubing or insulating tape.
Result
- I was pleasantly surprised: The UPS can actually keep the box powered in active state for 1 minute 9 seconds! But it could be less if you have an external USB hard disk without a separate power supply. In any case, the 69 seconds are more than enough to even perform a regular shutdown. Great! If the box is in standby mode, e.g. at night, it should be able to do even more. Since most power outages last less than a minute, there is a good chance that the power will be restored before then.
- The dimensions are very small, which fits well with the small Dreambox
- Malfunctions are impossible, unlike UPSs with relays (where you can hear a click). I once had one of these for my PC and was not at all happy with it. Once, when the mains power went out and came back on in quick succession, this UPS switched off the output and the PC died while I was writing. Not funny! With this UPS here, the switching time is practically zero thanks to the diodes. No matter what the input current does, the output remains constantly powered, as it should be.
- The UPS is extremely durable and maintenance-free. Note that with a UPS based on lead-acid batteries, the batteries must be replaced approximately every 3 years. The Atlas UPS is much more convenient, cheaper and more economical.
- The power consumption of the USP when fully charged would be 2.5 watts at maximum load of the power supply. But as the Dreambox often draws less than 50% in practice, around 1 watt is probably a more realistic value. So it's a very economical device.
- Costs are super cheap: Approx. 30 $.
Disadvantages
This UPS does not trigger an automatic shutdown of the Dreambox in the event of a power failure. If you want this, you have to resort to a much more expensive commercial UPS.
Modifications of this circuit
The unchanged circuit can also be operated with much larger supercaps. The charging time would increase proportionally, as would the time for which it can supply current.
Instead of the charging resistor of 5 Ω (4 x 20 Ω in parallel), much larger resistors can also be used. This reduces the heat dissipation, but charging takes correspondingly longer. Example: You could use a 100 Ω power resistor. The charging current would then be about 110 mA and the resistor would have to be able to dissipate approx. 1.3 watts of heat. So a single 100 Ω / 3 watt resistor would probably be appropriate. The UPS would then be fully charged after 54 minutes. This would have no effect on the power supply duration.
If you don't have a Dreambox yet
The Dreambox has been voted the best box for watching live TV with recording function and playing videos of any format for several years. The cost is quite low, less than 400 $. We love this box, it is extremely well configurable. We have therefore also programmed the Atlas Subtitler software to supplement the films with subtitles. It is now installed on more than 1500 PCs worldwide. On this page you will find instructions on how to set up a Dreambox from scratch.
Golden Tip
As mentioned above, I once lost all the data on my 2 TB SSD due to a corrupted file system. This happened after a power failure lasting about 1 second caused by a flash. To mitigate this, you should do the following especially if you have no UPS: Open a command line window (e.g. with Windows app 'Tera Term' or Android app 'JuiceSSH') and enter this command:
tune2fs -c 1 /dev/sda1
This enables the built-in drive to perform a self-test with repair every time the box boots.
It's a pity that nobody had pointed this out to me before. Maybe it would have saved my data. That's why I mention it explicitly here.
More Stuff for the Dreambox
Cooling Fan for the Dreambox