Sunday, January 26, 2025

A short-term "UPS" for mini (NUC-type) PCs

The problem

Figure 1:
A "Beelink" small form-factor PC.  This unit sports a Ryzen
processor. and runs from an external 19 volt supply.
Click on the image for a larger version.
Very small computers (so-called "NUCs" - a term that we'll use generically throughout) of recent manufacture are energy efficient and are increasingly used in lieu of full-size desk top PCs.  Many of these use external power supplies - often referred to as "bricks" - of the sort also used to power and charge laptops.

Even if one has a UPS (Uninterruptable Power Supply) attached to their computer - or especially in the case of a "whole house UPS" (e.g. Tesla Power Wall or equivalent) there are instances during which the transition between power grid going down and the UPS picking up the load may not be fast enough to prevent the computer from rebooting or just crashing and hanging.

For this article, we are looking at the case when the power supply for a "NUC" (small form-factor power supply) is incapable of "riding" through the aforementioned UPS transition.  In this instance at least part of the problem has to do with that unlike the power supply in a desktop computer - which is relatively large and has a comparatively large reservoir of energy storage in the form of big filter capacitors - the small power supplies used for these small computers have a comparatively small energy reserve - and unlike a laptop, there is no onboard battery to serve as a backup.

Returning to the "whole house UPS" and, to a lesser extent its much smaller counterpart used to back up only critical gear, it may take more than 100 milliseconds for the power to resume after the grid is lost - depending on the nature of the outage:  Owning a Tesla Powerwall - and talking to others with this and similar (non-Tesla) systems - they all seem to share a common trait:  Sometimes they switch quickly enough that nothing reboots, but other times they take much longer to switch (sometimes more than 500 milliseconds) and many computers - even desktop PCs with more capacitive energy storage - fail to carry through the transition.

For this reason it might be reasonable to have a smaller (and, presumably a "fast") UPS to carry the computer through this transition although it seems a bit silly to have a UPS when one already has one for the entire house - but all it needs to do is to run for a few seconds, so even UPS batteries in poor condition will likely suffice.

In the case of a very small form-factor computer such as a NUC, we could contrive a means of providing power for just long enough for the UPS - whether desk-top or whole-house - to do its job.  It, too, needs only last long enough - perhaps a second or so.  If it's powered via an external power supply, this makes it a bit easier and it is those devices with external power supplies that this article addresses.

Carrying through the interruption

In the specific case of the "NUC", these are often (but not always) powered via an external DC power supply.  In my case, I have a Beelink NUC using a Ryzen 5700 that is powered from a 19 volt supply.  In communicating with others who own this same mini PC it's clear that it's shipped with a wide variety of different power supplies from different manufacturers - some of them with ratings that seem a bit low for the rated power consumption of the computer - so I replaced it with a good-quality MeanWell unit which not only has more robust ratings, but its input is power factor corrected - a very important consideration when powering it from a UPS!

Details about the replacement power supply

The MeanWell power supply that works with this Beelink NUC may be found at Jameco Electronics and it is Jameco Part Number 2223486 (link) and MeanWell model number GST90A19-P1M.  This unit is rated for 19 volts at 4.74 amps - much greater than the supply that is likely to have been supplied with the PC and it has the needed 5.5mm O.D./2.5mm I.D. coaxial power connector with center positive.  Other NUCs will have different power requirements and connector types and polarities so it is up to YOU to determine what might work for your computer.

As noted, it has good power factor correction (PF of 0.9 or better) and produces very little to no radio frequency interference - unlike some power supplies of "unknown" brands.  As a bonus, it so-happens that this supply works perfectly with my older Asus ROG laptop as well!

In testing, neither the original or MeanWell power supply had enough reserve capacity to consistently carry it through a UPS transition - particularly if the computer was "busy" and consuming maximum power

The major reason why there is this concern is that this Beelink computer is located at the remote site of the Northern Utah WebSDR where power bumps and outages causing the load to switch to the UPS are very frequent - and occasionally, this causes the computer to "hang" (and not reboot!) requiring that the power outlet be remotely switched off - and back on.  As this is not a "public-facing" computer (it does WSPR monitoring) its outage may not be immediately noticed.  It's worth noting that the desktop-type computers have no issues with these transitions.

What to do?

Figure 2:
The Tecate SCAP PBLS-3.5/21.6 capacitor module.
This unit contains the necessary voltage equalization circuitry.
Click on the image for a larger version.
I did not want to put a separate mains-powered UPS on this computer and while I could have figured out a battery-based solution, this seemed overkill as I literally needed it to power the computer for less than one second - plus I didn't want to have batteries that would eventually "age out" and need to be replaced.  The obvious solution seemed to be the "supercapacitor" - devices with Farads of capacitance, capable of storing enough energy to power the computer for a very short period of time.

In perusing the DigiKey catalog I found at least two useful candidates:  One capacitor of 1.25 Farads with 540mΩ of internal resistance (Tecate P/N: SCAP,PBLS-1.25/21.6) and another of 3.5 Farads with 260mΩ of internal resistance (Tecate P/N: SCAP,PBLS-3.5/21.6), each rated for 21.6 volts - both suitable for use with a 19 volt supply.  These are actually capacitor modules, consisting of eight 2.7 volt capacitors of 10 and 20 Farads each, respectively, and containing simple circuitry to assure that the voltage across each of the internal capacitors was balanced.  It's worth noting that the voltage equalization circuitry itself will consume a small amount of current (perhaps as high as a few 10s of milliamps) - particularly as one approaches the maximum voltage rating and this must be considered in the design of the support circuitry.

It's important to note that these won't actually function as a UPS in the tradition sense:  These capacitors can store enough energy to power the computer for a short time - only for a few seconds at most - but this is more than enough to carry it through for the few hundred milliseconds of drop-out that might occur during a UPS transition.  If the UPS fails to come online, these capacitors will power the computer for only a few seconds at most - but that's more than enough for our purposes.

Using the supercapacitors

The problem with using a supercapacitor is that when they are discharged, they look like a dead short, meaning that you probably cannot simply tack them in parallel with a power supply:  To do so would stress the power supply - putting it into current limiting at best, possibly causing it to "trip out" and go offline, or in the worst case, damaging it - so provisions must be made to regulate the charging of the capacitor.  The diagram in Figure 3 shows the circuit surrounding the capacitor.

Figure 3:
Schematic of the supercapacitor NUC UPS.
A standard outboard power supply is used - typically the one supplied with the computer, but it could
be another unit - probably of better quality - as noted in the article.
Click on the image for a larger version.

How it works

For charging, we are using old and "newer old" tech here - R1 is a simple series resistor of 100 ohms with a power rating of 5 watts which will limit the current to around 200mA, tapering off gradually as the capacitor charges up.

In parallel with R1 is a 100 milliamp self-resetting thermal fuse (e.g. "Polyfuse").  This device is really a thermistor and when "excess" current flows through it, it heats up and the resistance skyrockets, greatly reducing the current flow.  The way that it is used here means that when the power supply is first connected (and the capacitor is fully-discharged) there's a brief inrush of current until F2 "blows" (gets hot) at which point it takes only 15-20 milliamps to keep it in this state at which point R1 is handling most of the current.  As the capacitor charges and the voltage differential across R1 decreases, the current through the 100 ohm resistor will also drop - but F2 will also gradually cool down as the voltage across it decreases - but the current will also increase - but never more than approximately the 100 mA rating.

Figure 4:
Internals of the UPS.  The support circuit was constructed
on a small piece of prototype board (left) while the LEDs to
indicate the status are on the right.  The rear panel (far left)
has the power cable and coaxial power connector.
Click on the image for a larger version.
asfasdf

The use of F2, the 100mA fuse results in much faster charging of the capacitor.  In testing with a 3.5 Farad capacitor, it took about an hour for the capacitor's terminal voltage to be within a hundred or so millivolts of the power supply voltage with just R1, the 100 ohm resistor - but it took about 9 minutes with the addition of F2.  As an added bonus, when the capacitor is nearly fully charged (within a volt) the current through the 100 ohm resistor would be only about 10mA or so and the charging rate would slow to a crawl - plus the equalizing circuit within the capacitor module draws a few milliamps meaning that it will never get closer than 200-500 millivolts of the power supply voltage.

With the addition of F2 - and the fact that at this low voltage drop it will have cooled off and have a resistance of between 3 and 10 ohms - the capacitor's resting voltage will be within a few 10s of millivolts of the power supply rather quickly.  This is important as even a few hundred millivolts of extra charge on the capacitor will measurably extend the "run" time.  Attaining this sort of "full charge" could be done with a solid state circuit,  but it would be fairly complex:  This approach - with a single, inexpensive component - is nice and simple.  The use of F2 also overcomes the small current consumption of the capacitor module's equalization circuitry:  A few milliamps of current from this circuitry would drop the full-charge voltage by as much as a few hundred milliamps without F2.

A maximum charge current of 200-300mA seems reasonable as that would not put a significant amount of burden on the power supply - which must be able to power the computer and charge the capacitor.  I also considered the use of a simple transistor-type current limiter which would maintain a constant current until the capacitor got to within a volt or so of the supply voltage, but decided that it probably wasn't worth the added complexity - and I would still have required something like F2 to bright the capacitor right up to the supply voltage.

The "Charge" LED works by detecting the voltage crop across R1:  If it exceeds approximately 0.6 volts, Q1, a PNP transistor, is turned on, pulling its collector high, turning on LED2.  When this LED goes out, the capacitor will be within 0.5-0.6 volts of full charge.  The "Ready" LED (LED2) is in series with D2, a 15 volt Zener diode and it will start illuminating when the voltage across the capacitor exceeds about 17 volts for an old-tech AlGaInP LED (with a 2.1 volt threshold) or about 18 volts for a more modern GaN LED.  In a "standby" state, the "Charge" LED will have extinguished and the "Ready" LED will be on indicating the unit's readiness.  Neither of these circuits are perfect, but they give a "good enough" indication of the state of the device.

Figure 5:
The completed UPS with the two LED indicators on
on the front panel.
Click on the image for a larger version.

An "ideal" diode - in real life

Parallel with R1 is a diode that is reverse-biased when the capacitor's voltage is lower than the supply voltage, preventing current flow other than through the resistor.  While I originally considered using an "ordinary" diode - which would have a voltage drop of about 0.6 volts for a standard silicon or around 0.4 volts for a high-current Shottky type - I decided to do something different:  Use an "ideal diode".

A voltage drop of 0.3-0.6 volts from a typical diode would represent an immediate voltage drop from the capacitor - and since the voltage on the capacitor will drop as it's discharged, the "diode drop" would represent less time that the computer could be powered by it, alone.  A hypothetical "ideal" diode would have zero voltage drop in the forward direction and block current in the reverse - and fortunately, something pretty close to that actually exists these days!

As it turns out, such a thing actually exists - and it is pretty inexpensive.  This implementation of an "ideal" diode is actually a module with several components:  The specific modules that I used (which I got from Amazon - five for US$10) use the Diodes Incorporated DZDH0401DW chip along with an AGM30P05A P-channel FET along with a 100k and 1 Megohm resistor.  These are rated for a maximum stand-off voltage of 26 volts and a steady-state current of 10 amps.

The way that these work is that the DCDH0401DW has a comparator that is used to detect the minute voltage drop between the "input" of the diode (the "+" side) and the "output" (the "-" side):  If the voltage on the input is higher than the output, the P-channel FET is turned on, allowing it to conduct from the input to the output.  If the voltage on the input is NOT higher than the output, the FET is turned off, preventing current from flowing from the output to the input.  The use of a P-channel FET allows the switch to be placed in the positive lead which permits the negative side of the power sources - the power supply and the super capacitor - to be connected together.  Incidentally, the FET is wired such that even if it weren't "on" at the moment that it might need to conduct, it's intrinsic diode would conduct, anyway, albeit with a 0.6 volt drop, but since the DZDH0401DW chip responds within a few microseconds at most, the FET would be very quickly turned on.

Figure 6:
The back panel of the supercap UPS.
The original power supply plugs into the jack while the
short cable needs to be just long enough to get to the
back panel of the PC.
Click on the image for a larger version.

When the FET is on, it's resistance is on the order of 5.5 milliOhms which means that if there's three amps flowing through it, less than 20 millivolts will be lost - about 1/30th of that of a standard silicon diode - and since there is so little voltage lost, there will be a similar fraction of heat being produced as well.

As you may have noticed in the schematic diagram of Figure 3, there are actually three connections to this "diode":  The anode, the cathode and ground - the ground being required because not only does the comparator/control chip need power, but the gate of the P-channel FET needs to be pulled negative with respect to its source.  The "overhead" current of the FET and comparator/control chip is only on the order of 175 microamps according to the data sheets so it's power consumption is practically negligible in our application.

The other components in the circuit include D2 - a 15 volt Zener diode along with LED1 and R2 for current limiting:  This LED will illuminate if the applied voltage exceeds about 17 volts and functions as a "Power" indicator.  Transistor Q1, a PNP, is connected across R1 via current-limiting resistor R4 and when the voltage drop across R1 exceeds about 0.6 volts, its collector will be pulled toward V+, causing LED2 to illuminate, indicating that the capacitor is charging.  When this LED goes out, this indicates that the capacitor is - at the very least - "mostly" charged.

The final component is F1 - a self-resetting thermal fuse (e.g. "polyfuse") which could have a rating of anything between 5 and 9 amps.  As the capacitor can deliver a large amount of current when shorted, this is provided as protection.  A "normal" fuse of 6-10 amps would suffice here, but I happened to have the polyfuse on hand.

Variations on a theme:  Backing up a 12 volt PC.

As noted, this unit was built using the 3.5 Farad capacitor - but it should be capable of doing its job with the lower-cost (and physically smaller) 1.25 Farad unit.

The described unit is also designed to be used with a NUC/PC that operates at 19 volts - a common voltage used by laptop computers.  Many of these small computers use 12 volts - and while one could possibly tack a small battery across the power supply, the use of a capacitor-based backup would mean that there would be no battery that would have to be checked/replaced on a routine basis.

The circuit depicted in Figure 3 - designed for 19 volts - would have to be modified slightly, as follows:

  • D2, a 15 volt Zener, would be changed to a 9 volt device for a 12 volt bus.  This would better-represent the charge state of the capacitor for a 12 volt supply, causing it to illuminate once it had charged to better than about 11 volts.
  • R1, a 100 ohm resistor for the 19 volt device would be changed to somewhere between 47 and 62 ohms but still a 5 watt device.
  • The capacitor described is rated for 21.5 volts - which is probably overkill for a 12 volt power supply.  A 16 volt capacitor would be a better choice.  Additionally, a lower-voltage capacitor module will have commensurately lower internal resistance which improves efficiency - and for a 12 volt power supply where voltage droop due to Ohmic losses is arguably more important, it would be best to keep it below 400mΩ.   Possible capacitors for 12 volt use include:
  • It's worth mentioning that while a "12 volt" computer may operate from a supply voltage that is nominally 12 volts, it's worth checking to make sure that it's within the safe operating range of the capacitors that you choose.  For example, the Tecate capacitors listed above can operate safely only up to 13.5 volts, ruling out the use of a power supply that operates in that range - but the Cornell-Dublier capacitor with its 18 volt rating would work nicely over a slightly wider range.

Conclusion

Figure 7:
The supercap UPS, on the shelf next to the PC -
now in service at the Northern Utah WebSDR!
Click on the image for a larger version.

As can be seen from the photos, the capacitor and support circuitry was placed into a plastic enclosure:  The two LEDs were placed on the front panel and labeled while the back panel has a female coaxial power connector that matches that of the computer and power supply along with a short cord terminated with the same type of male power connector used by the PC - which happens to be the common "5.5mm x 2.5mm" type with the outside shell being negative.

To install the UPS, the PC was powered down and the device inserted into the power lead - the power supply plugging into the UPS and the short cable plugging into the PC.  After a bit less than 10 minutes, the "Ready" light went on - followed soon after by the "Charge" light extinguishing, but since the charger is current-limited, the PC could be powered up immediately after installation - not needing to wait for it to fully charge.

As can seen in Figure 7, the UPS was placed on the shelf next to the PC that it supports.  With the PC under a "moderate" load (about half of the maximum power consumption) the power supply was unplugged briefly to see if it would hold.  Interruptions of up to 1.5 seconds were tried with no disruptions of the PC with the capacitor being fully "recharged" to just a few 10's of millivolts of the maximum voltage in under two minutes due to the "shallow" discharge.  We chose not to try to see how long it really would hold the PC up, but with the UPS installed, we cycled the UPS several times and the PC happily rode through it - something that it would not do without.

In other words, success!

* * * * * * *

This page stolen from ka7oei.blogspot.com

[END]

 


No comments:

Post a Comment





PLEASE NOTE:


While I DO appreciate comments, those comments that are just vehicles to other web sites without substantial content in their own right WILL NOT be posted!

If you include a link in your comment that simply points to advertisements or a commercial web page, it WILL be rejected as SPAM!