Re: [Nut-upsuser] Supporting a DIY UPS with minimal effort butmaximum gain

2024-05-17 Thread Kelly Byrd
Re "DIY-NAS", that was a typo. I did mean "DIY-UPS" as you suspected.

Re: Using custom vid:pid while specifying the arduino subdriver, I didn't
know that! So if someone finds a particular board that doesn't match, they
could still move forward without needing to patch NUT. Nice!



On Fri, May 17, 2024 at 5:42 AM Jim Klimov  wrote:

> Looks very great, thanks for writing this! I gather you'd port this to the
> Wiki page you've started, too?
>
> A couple of comments:
>
> > So I run a NUT server on a Raspberry PI which is connected via USB to my
> DIY-NAS Arduino.
>
> DIY-UPS?
>
> > See drivers/arduino-hid.c for the list of supported IDs...
>
> Since NUT v2.8.1 [PR #1369], the `usbhid-ups` driver allows the user to
> specify a `subdriver` in config - to use the specific mapping for the
> specified vendorid:productid (and/or other matching options involved),
> allowing for IDs not yet known to NUT (built into any driver) or to use a
> different subdriver than the one associated with those IDs (some vendors
> historically have same IDs used for significantly different products).
> Either way, while it is ideally preferable to test and post PRs with
> correct out-of-the-box detection of devices handled by this or that code,
> the specimens seen roaming in the wild keep eluding any pre-created
> matchers that are set in stone for the particular build of (packaged) NUT.
> This feature allows for at least some more tweaks and experiments in the
> field.
>
> Hope this helps,
> Jim Kl.imov
>
>
>
> On Fri, May 17, 2024 at 1:05 PM Kelly Byrd  wrote:
>
>> Ha! I got several on and off list requests for details, so I'll give a
>> bunch of details here and then maybe I can move this to a wiki page others
>> can help edit.
>>
>> WARNING! WARNING! WARNING!
>> Be careful! My implementation required opening up high power components,
>> and dealing with 120VAC mains power and high currents on 12VDC. If you
>> decide to tackle any of this yourself, you need to understand how to do
>> this safely, size components appropriately, etc.
>>
>> My goal is to keep a home Internet connection available during a power
>> outage. This doesn't happen that often, but it bugged me when it did and I
>> like playing with power-related things, so this became a fun project to
>> tackle. I guess I should mention that my home network gear is in a rack in
>> the garage. "modem", router, switch, wifi APs powered over PoE from the
>> switch, NAS, and typically a Raspberry Pi or two doing whatever "always on"
>> things I want. I also previously built a substantial portable battery box
>> that will power other appliances like TVs and computers, but the networking
>> gear is all in the garage and I can't power both at once without some very
>> long extension cables snaking through the house.
>>
>> I noticed a few years ago that my Internet connection stayed up during a
>> couple of different neighborhood power outages, assuming I could power the
>> gear on my side. I guess the equipment on the ISP side is far enough away
>> that it isn't affected? For a few years, I did this with a 12V inverter
>> connected to an EV (an electric car). It turns out the 12V system in many
>> EVs will provide 12V power through a DC step-down from the main traction
>> battery. I really only need like 15A and previous testing made me confident
>> I could safely do this as long as the main battery had capacity left. So, I
>> did that for a while, but earlier this year we sold the EV and became a
>> one-car household. So...what do I do? I had an inverter, if I could get
>> batteries and a way to charge them, I should be most of my way toward a DIY
>> UPS, right?
>>
>> Specs/Requirements
>> * AC power needed is typically about 150W, I typically use 300W as a
>> value for max surge. If I turn off my NAS, the load is only about 50-55W
>> AC. I was aiming for 2-3 days of power for this load, and can live without
>> the NAS during an outage, so I need 2.8-4.3kWh of capacity with the NAS off.
>>
>> * While I do want this to work, this is a fun personal project. Mucking
>> with it is part of the goal. I had some hobby money to spend, but not
>> infinite. I wanted to reuse things I had on hand or could get easily for
>> v1. I also get to decide how reliable it needs to be.
>>
>> The system is:
>> * AIMS Pure Sine 12V 600W Inverter. I had it already. Having this
>> inverter on hand drove the decision for 12V vs 24/48V. Also, power needs
>> are relatively low so 12V doesn't lead to more than 55A of current, and
>> that's only when charging from a deep discharge.
>>
>> * RV Converter/Charger: PowerMax PM4 55A 12V. This is a lead acid battery
>> charger that will also provide power after batteries are charged. Many
>> battery chargers are not designed to be run 24/7, this one is.
>>
>> * Two 12V 200Ah Renology AGM deep cycle batteries wired in parallel. Got
>> a deal on these. I decided I was ok with 75%-80% DoD even though these are
>> lead acid. This gives me about 3.5kWh of usable AC 

Re: [Nut-upsuser] Supporting a DIY UPS with minimal effort butmaximum gain

2024-05-17 Thread Jim Klimov via Nut-upsuser
Looks very great, thanks for writing this! I gather you'd port this to the
Wiki page you've started, too?

A couple of comments:

> So I run a NUT server on a Raspberry PI which is connected via USB to my
DIY-NAS Arduino.

DIY-UPS?

> See drivers/arduino-hid.c for the list of supported IDs...

Since NUT v2.8.1 [PR #1369], the `usbhid-ups` driver allows the user to
specify a `subdriver` in config - to use the specific mapping for the
specified vendorid:productid (and/or other matching options involved),
allowing for IDs not yet known to NUT (built into any driver) or to use a
different subdriver than the one associated with those IDs (some vendors
historically have same IDs used for significantly different products).
Either way, while it is ideally preferable to test and post PRs with
correct out-of-the-box detection of devices handled by this or that code,
the specimens seen roaming in the wild keep eluding any pre-created
matchers that are set in stone for the particular build of (packaged) NUT.
This feature allows for at least some more tweaks and experiments in the
field.

Hope this helps,
Jim Kl.imov



On Fri, May 17, 2024 at 1:05 PM Kelly Byrd  wrote:

> Ha! I got several on and off list requests for details, so I'll give a
> bunch of details here and then maybe I can move this to a wiki page others
> can help edit.
>
> WARNING! WARNING! WARNING!
> Be careful! My implementation required opening up high power components,
> and dealing with 120VAC mains power and high currents on 12VDC. If you
> decide to tackle any of this yourself, you need to understand how to do
> this safely, size components appropriately, etc.
>
> My goal is to keep a home Internet connection available during a power
> outage. This doesn't happen that often, but it bugged me when it did and I
> like playing with power-related things, so this became a fun project to
> tackle. I guess I should mention that my home network gear is in a rack in
> the garage. "modem", router, switch, wifi APs powered over PoE from the
> switch, NAS, and typically a Raspberry Pi or two doing whatever "always on"
> things I want. I also previously built a substantial portable battery box
> that will power other appliances like TVs and computers, but the networking
> gear is all in the garage and I can't power both at once without some very
> long extension cables snaking through the house.
>
> I noticed a few years ago that my Internet connection stayed up during a
> couple of different neighborhood power outages, assuming I could power the
> gear on my side. I guess the equipment on the ISP side is far enough away
> that it isn't affected? For a few years, I did this with a 12V inverter
> connected to an EV (an electric car). It turns out the 12V system in many
> EVs will provide 12V power through a DC step-down from the main traction
> battery. I really only need like 15A and previous testing made me confident
> I could safely do this as long as the main battery had capacity left. So, I
> did that for a while, but earlier this year we sold the EV and became a
> one-car household. So...what do I do? I had an inverter, if I could get
> batteries and a way to charge them, I should be most of my way toward a DIY
> UPS, right?
>
> Specs/Requirements
> * AC power needed is typically about 150W, I typically use 300W as a value
> for max surge. If I turn off my NAS, the load is only about 50-55W AC. I
> was aiming for 2-3 days of power for this load, and can live without the
> NAS during an outage, so I need 2.8-4.3kWh of capacity with the NAS off.
>
> * While I do want this to work, this is a fun personal project. Mucking
> with it is part of the goal. I had some hobby money to spend, but not
> infinite. I wanted to reuse things I had on hand or could get easily for
> v1. I also get to decide how reliable it needs to be.
>
> The system is:
> * AIMS Pure Sine 12V 600W Inverter. I had it already. Having this inverter
> on hand drove the decision for 12V vs 24/48V. Also, power needs are
> relatively low so 12V doesn't lead to more than 55A of current, and that's
> only when charging from a deep discharge.
>
> * RV Converter/Charger: PowerMax PM4 55A 12V. This is a lead acid battery
> charger that will also provide power after batteries are charged. Many
> battery chargers are not designed to be run 24/7, this one is.
>
> * Two 12V 200Ah Renology AGM deep cycle batteries wired in parallel. Got a
> deal on these. I decided I was ok with 75%-80% DoD even though these are
> lead acid. This gives me about 3.5kWh of usable AC capacity.
>
> * Batteries and charger are wired up with 4AWG, the inverter is something
> smaller, I think 6AWG?
>
>
> What I have built is a double conversion online system. The inverter is
> powering the AC load all the time. There's no transfer switch. There's
> lower efficiency when power is on because the normal power path is always
> AC->DC->AC. I did this because I wasn't confident in my ability to find a
> transfer switch that would 

Re: [Nut-upsuser] Supporting a DIY UPS with minimal effort butmaximum gain

2024-05-17 Thread Kelly Byrd
Ha! I got several on and off list requests for details, so I'll give a
bunch of details here and then maybe I can move this to a wiki page others
can help edit.

WARNING! WARNING! WARNING!
Be careful! My implementation required opening up high power components,
and dealing with 120VAC mains power and high currents on 12VDC. If you
decide to tackle any of this yourself, you need to understand how to do
this safely, size components appropriately, etc.

My goal is to keep a home Internet connection available during a power
outage. This doesn't happen that often, but it bugged me when it did and I
like playing with power-related things, so this became a fun project to
tackle. I guess I should mention that my home network gear is in a rack in
the garage. "modem", router, switch, wifi APs powered over PoE from the
switch, NAS, and typically a Raspberry Pi or two doing whatever "always on"
things I want. I also previously built a substantial portable battery box
that will power other appliances like TVs and computers, but the networking
gear is all in the garage and I can't power both at once without some very
long extension cables snaking through the house.

I noticed a few years ago that my Internet connection stayed up during a
couple of different neighborhood power outages, assuming I could power the
gear on my side. I guess the equipment on the ISP side is far enough away
that it isn't affected? For a few years, I did this with a 12V inverter
connected to an EV (an electric car). It turns out the 12V system in many
EVs will provide 12V power through a DC step-down from the main traction
battery. I really only need like 15A and previous testing made me confident
I could safely do this as long as the main battery had capacity left. So, I
did that for a while, but earlier this year we sold the EV and became a
one-car household. So...what do I do? I had an inverter, if I could get
batteries and a way to charge them, I should be most of my way toward a DIY
UPS, right?

Specs/Requirements
* AC power needed is typically about 150W, I typically use 300W as a value
for max surge. If I turn off my NAS, the load is only about 50-55W AC. I
was aiming for 2-3 days of power for this load, and can live without the
NAS during an outage, so I need 2.8-4.3kWh of capacity with the NAS off.

* While I do want this to work, this is a fun personal project. Mucking
with it is part of the goal. I had some hobby money to spend, but not
infinite. I wanted to reuse things I had on hand or could get easily for
v1. I also get to decide how reliable it needs to be.

The system is:
* AIMS Pure Sine 12V 600W Inverter. I had it already. Having this inverter
on hand drove the decision for 12V vs 24/48V. Also, power needs are
relatively low so 12V doesn't lead to more than 55A of current, and that's
only when charging from a deep discharge.

* RV Converter/Charger: PowerMax PM4 55A 12V. This is a lead acid battery
charger that will also provide power after batteries are charged. Many
battery chargers are not designed to be run 24/7, this one is.

* Two 12V 200Ah Renology AGM deep cycle batteries wired in parallel. Got a
deal on these. I decided I was ok with 75%-80% DoD even though these are
lead acid. This gives me about 3.5kWh of usable AC capacity.

* Batteries and charger are wired up with 4AWG, the inverter is something
smaller, I think 6AWG?


What I have built is a double conversion online system. The inverter is
powering the AC load all the time. There's no transfer switch. There's
lower efficiency when power is on because the normal power path is always
AC->DC->AC. I did this because I wasn't confident in my ability to find a
transfer switch that would transfer fast enough and it was one more thing
to figure out and buy. In my head, this online architecture is simpler, but
I may change it in the next version. I worry a bit about the inverter being
ok running full time, but since it is rated for 600W and I use only 150W
all the time, I decided it's ok. When it fails, I'll figure out something
else.

I chose lead acid deep-cycle batteries because if you're willing to
discharge them to 70-80% they're very cost effective vs LiFePO4 or other
lithium types. I know this will shorten the number of cycles I get from
them. I'm ok with that. In this application, they sit at 100% for all but
maybe a few hours to a few days a year. They may see one or two deep
discharges a year. If I get five years out of them, that's great!

I calculated roughly 3.5kWh of usable capacity for these two wired in
parallel. Running with the NAS off is maybe 5A from the DC side of things,
which is a really low load for a 400Ah battery bank. They are very heavy,
but I already had a heavy duty storage rack next to the load, so that's not
a problem in this case. Also, the voltage range for 12V lead acid batteries
is still better supported than LiFePO4. Right now, there are still more
(and lower cost) chargers and inverters that assume a lead acid voltage
range. As an