tomek-szczesny / OpenUPS

A versatile, high power SBC UPS
13 stars 0 forks source link

LED indicators #16

Open tomek-szczesny opened 1 year ago

tomek-szczesny commented 1 year ago

I keep forgetting about them.

I'm thinking about the following LEDs, driven by MCU:

We could add a "power on" LED but that feels redundant - at least one Batt LED will be on anyway.

Now when we need extra 5x GPIO, the real question is whether we switch to 48-pin AVR, or add I2C port extender...

hominoids commented 1 year ago

"Power on" is probably not needed if there are three "power good" LED. To avoid increasing pin count the "power good" could be AND together using one LED and the "charging" and "discharging" could be combined too. Off when charged, solid when charging and blinking when discharging.

tomek-szczesny commented 1 year ago

I made a little search and concluded it's far cheaper to use a bigger AVR than adding a dedicated external LED driver. By "Bigger AVR" I mean a 48-pin package, which has more pins, but is physically smaller than 28-pin variants. We already have too few pins at this point, so we may as well commit to this change already.

There is also a way of connecting 6 LEDs to 3 GPIO, which would require time multiplexing to control them, but let's not get THAT cheap.

I suppose we can allow ourselves to provide as many LEDs as we deem necessary and practical. We don't want to remove any useful indicator, but at the same time we don't want to create an interface that is too cluttered and hard to read.

"Power good" LEDs are meant to show not only that the output voltage is within limits, but also indicate which power outputs are on. I think I'll let the user switch power outputs on and off via I2C commands. On a second thought, there is no good reason to insist on driving these LEDs by MCU, so 5V power good will be driven by 5V Buck directly.

Anything else we wish to notify a user about?

tomek-szczesny commented 1 year ago

I added 5 LEDs for now, as per the original description. We still got pins left after I did #20 :) 2023-05-06-140507_651x633_scrot

Do we want any specific kind of LEDs, or just plain 0603 SMD types? We could use some sort of side facing LEDs instead. That depends on case design really. :)