Uninterruptible Supplies

Need a power supply with battery backup that shuts off your PI or similar gracefully when the battery gets low and starts up when the battery  recovers? I’m sure most of us who play with the likes of Raspberry Pis and other SBC boards as well as other devices, have looked at uninterruptible supplies at one point or another – I often use the little battery powered chargers you get for phones – and until recently I thought that was a universal solution – having powered my Pi in Spain for many months now on one of these and we get awful power cuts there – no problem.

08 May 2017: This is an update to the original article as I found a problem and came up with a solution!

Lithium chargingThen someone pointed out to me that SOME of these units turn off the output when charging. Well of course they don’t ADVERTISE that – so that’s a problem if you’re looking for cheap options.

So today I received from BANGGOOD a cheap circuit board that promises to do the job. As it happened my one and only Lithium in a torch left in storage over the winter had kicked the bucket… but I remembered I had a spare but dead battery pack for one of my laptops – and proceeded to open it up. Sure enough half a dozen Lithiums in there.

I took one out that looked clean – dead. Put it on my big power supply for a couple of minutes at 2 amps – it looks ok.  So now I’ve attached it to this little board and plugged the board into a decent USB supply. one of the little chips is getting a little hot as it pumps power into the board but I think it will be fine (update once the battery ha some charge this cooled off – then running a FriendlyArm SBC nothing at all got warm).   So after it had been on for a while to give the battery a chance to get some power, I plugged an SBC into it’s output. You can see all of this in the picture above. Worked a treat and the little board settled into a blue-flashing-light mode after a few seconds.   I repeatedly disconnected the incoming power – no difference, the SBC just kept going.

So if you want something new to play with…. and you’re aware of the dangers of going within 100 miles of Lithium batteries – you might want to give this a shot. At £2.37 inc shipping – you can’t really go wrong provided you give it a damn good test before doing anything serious with it.  I think I may make a little bank of them with the remaining Lithium batteries from my power pack.


I’ve had a look to see if I could identify the bits – the battery charging chip is easy and monitoring (2 of them) but can I hell figure out what is used to provide the 5v out boost.

But there is a catch! I only just discovered this...  If the battery is TOTALLY DEAD and you start things up - nothing happens - the battery doesn't charge - the load does not come on. Disconnect the load for a short time and the battery immediately starts to charge and you can now reconnect the load.

This got me to thinking about a solution and in keeping with the ultra-low costs above, here is my ultra-low cost solution..

An Arduino Nano with relay (total cost around £3 from AliExpress) can control the output of the unit via the relay. The analog input (A0) can attach to the battery while the NANO is driven by the output of the unit.  The ultra-low current consumption of the NANO when the relay is off should prevent issues....  so what is needed is this - when the power gets low, this unit should alert the Pi to shut down..  it does this with a GPIO bit (D11 in this case) and optionally via serial - a nice way to do this would be to output a JSON package.

Here is an example of testing the little board from power up..


So the output message is init - and stays that way - the power is seen to be adequate - and a timer starts - after X seconds the relay turns on. Next, the battery is seen to be low - a timer starts and a warning GPIO bit is turned on  - the Pi could depending on your software, choose to use either the serial signal or the digital input - and shuts itself down.  In my case, serial was out so a simple port input was used instead.

The output from the NANO then goes low and stays low until the battery voltage rises significantly. You HAVE to have "hysteresis" in there - i.e. a difference between ON trigger voltage and OFF trigger voltage as the battery is going to recover a little the instant you turn off the load.

Now then there is an important point here - the NANO in this case is running on 5v... and the Pi will be 3v3 - so in the case of the WARNING OUTPUT and the SERIAL OUTPUT if you use one, the other or both you will need LEVEL SHIFTING - the simplest being a pair of resistors - that is a resistor from the NANO output to the Pi and a resistor from that PI pin to ground - as you don't want 5v going into the Pi - the maths is simple - I'd make the first resistor say, 10k and the second (grounded) resistor, say 15k.  In my case I just used a simple serial 1K resistor to limit current.

OLED display on controller

What we have here is an AliExpress OLED display costing just a couple of pounds, a cheap supply as mentioned above – running on a single cell and running on an Arduino NANO.

For the OLED, the Adafruit library uses WAY too much RAM but this little number doesn’t.. https://github.com/greiman/SSD1306Ascii

Here’s a link to the little OLED display -  on a cheap Chinese Nano it uses pins A4 and A5 and you need to use a couple of pull-ups to 5v for the i2c. I used 2k2 as they were handy  - https://goo.gl/nXjpxd (another – possibly slightly cheaper https://goo.gl/PO0GiO)

Code here https://bitbucket.org/snippets/scargill/XLeLE

This unit also lets you set the max and min voltages and this is stored in EEPROM. I’m using 3.7 and 3.1 by default. Pins to ground for the controls are D5 for set, D6 for up and D7 for down.

And here’s a diagram kindly provided by Antonio, aka MrShark (on this blog comments) who’s been closely following this project! If you’re on a PC you can expand these images by clicking on them. Power supply is just the nearest available and does not represent the current supply you see in the photo above.

As for getting the Pi or whatever controller you are using to listen to port inputs – if you’ve a genuine Pi that should be no problem – I was using a NEO2 – not quite so simple until it all started to sink in – read this entry for more about accessing GPIO - https://tech.scargill.net/gpio-the-hard-way/


Disclaimer: if this blows up your Pi – or worse – blows up – it is on your head! If you don’t understand the above – don’t do it. Make sure you have everything working and polarity is correct before attaching anything expensive.

Incidentally if you want to roll your own and find the above  text-only library for those OLED displays a bit limiting, the Adafruit lib is no good as it takes WAY too much RAM. The u8glib library on the other hand uses <400 bytes of RAM and has full graphics capability – here it is – I ran their standard test and it ran no problems – https://goo.gl/e2yVNM – if on the other hand you want speed, stick with the one I’ve used.


97 thoughts on “Uninterruptible Supplies

  1. I was looking for a cheap solution for a long time 🙂
    I order from this module and will try
    Thanks for the sharing

    1. There's a 4056 and several other chips on the board. The 4056 is presumably the one that handles charging - I'm not sure what handles voltage conversion to bring the output up to 5v - whatever it is, it does a good job.

  2. Would this be a reasonable option for solar charging?
    I'm looking to power a project with a couple of 18650 cells, with a solar panel to charge them, but I was running into the "no output while charging" situation you described.

    1. I see no reason why not but there is a pair of input pads - I'm wondering if they'd be better suited to variable input voltage than the usb input. Perhaps someone familiar with the 4056 could comment?

      1. I'll rephrase that - it seems like the chip is expecting something around 5v input... so you'd need an extra stage - a switching downconvertor - mind you, they're only around £1.50 - I've seen them handle an amp output - taking in anything from 5v to 30v - might check the same supplier. Each of these stages of course reduces efficiency but if you have a big enough solar panel (as, funnily enough I do - I've a couple of 12v (generating up to 18v) 40w panels... I dare say this board and one of those step down boards together would do the job for solar.

          1. Agreed on that tiny solar cell. I have one from Ray-o-Vac, made for outdoor trail cameras, that I want to use. Just took it outside with my meter and it did a steady 11v at 105mA, so with a step-down converter, I should be in good shape.

  3. Does the 'Mini USB To USB A Power Supply Module' have a status pin that you can connect up to one of the GPIO pin's on the SBC and shut it down after x seconds when it is on battery, like a normal ups?

  4. I have something similar for my projects for recharging but I've found I can power my project at the same time I'm charging although the device is battery powered and the mains just tops it up.

    I'm using to power my remote temperature display so that I just keep it on top of a QI wireless charger pad and it will run for around 4 days when removed. (I'm sure I could get it to run longer if I revisit the code)

  5. I'm still searching for my perfect Pi UPS. For something so simple, it seems many people want to make it really complex. I think I'll end up running one of them from one of the little switchmode "buck" regulators that you can get for a few dollars from China. I can then diode or a 9v power supply and a pack of 8 x 1.2v NiMH batteries onto the input to the regulator.

    I came across this project - I'd be interested to see if anyone else is using one? https://pi.gate.ac.uk/pages/mopi.html

    1. The most likely cause here is that you did not install as user Pi and/or you were not sitting in the /home/pi/.node-red directory when you installed it.

      The folder should be in /home/pi/.node-red/node-modules folder. Just delete the folder and try again.

  6. This is a great little board. It's been working well for me for the last 3 weeks.
    I noticed one potentially troubling behaviour, though:
    I have a bank of three 18650 cells connected in parallel, with an Arduino and sensor shield.
    I left it running overnight to drain, which it did. The Arduino, of course, shut down.
    I connected it to power to charge, which it did, however, the power to the Arduino did not restart until the Arduino was disconnected and reconnected.
    I need to do some more testing to see if I can reproduce it.

      1. Wired up another module, this time to a single 18650 and attached my Arduino and shield (about 1.8 A load) and let it run down.
        When I plugged in charging power, once again the Arduino did not come back to life automatically. I let it charge for a bit and it still did not. I pressed the Arduino's reset button and this didn't work, but disconnecting and reconnecting the USB *did* let it restart.

  7. Thank you for posting about this little power supply board, Peter. Just what I was looking for...

    Cheerful regards, Mike

  8. An outstanding share! I've just forwarded this
    onto a friend who has been doing a little research on this.
    And he in fact ordered me dinner simply because I found it for him...
    lol. So allow me to reword this.... Thanks for the meal!!

    But yeah, thanx for spending time to discuss this issue
    here on your web page.

    1. Thanks Michal - that link actually seems to have a nice charger... but for one thing - they say 2 amps output (that would be at 5v) - but at the same time say 0.5amps charge current at 5-8v.

      Hmmm.... no warning signal for the Pi to shut down either...

      The more I read about these things the more I'm inclined to get the PCB design package out 🙂

      Nice and compact though...

  9. According to my humble opinion, the solution with lithiums lacks the elegance i learned to love in your blog.
    My recommendation is the use of supercharge-capacitors with these chinese 5V step-up convertres as described in
    "https://www.stall.biz/project/usv-fuer-homematic-ccu2-und-raspberry-mit-wirkungsvollem-ueberspannungsschutz" .
    I think google translator will offer the clever solution decribed in there ( as it´s unfortunately written in german language ) .
    And´it´s in my opionion a clever straight forward solution. Any raspberry, ESP .. only needs to spend one I/O pin with 2 resitors as voltage dividers to detect voltage failure. And the software needs ( or even has to try ) to send the last MQTT power failure message and start the controlled shutdown of system.

    1. Hi Klaus

      I've had a preliminary play with supercapacitors and buck convertors with no joy. There are no doubt elegant ways but none of them seem to be particulary cheap. There is little point in getting one of these £20 boards then spending £40 on backed-up power supply for it... hence I'm hoping discussing in here will provide at some point one or more cost-effective solutions for hobbyists. My little test board is actually working a treat - the reason I've gone quiet is I can't get the serial ports to work on the FriendlyArm NEO2 🙂 Indeed I've just written to them to ask the point of providing a board with so much IO and no drivers to make use of it.

  10. did my best with (the beast) Fritzing, was my first design (under indications of Peter about some errors and later additions)... now i understand why so many hate it (crashed 2 times, with partial recovery on restart...) and prefer Eagle or others... but this is the only i know with a breadboard view for easier understanding (not everybody knows real electronic components symbols...)

    note that the serial connection is not reported on schematic, in case you use it you better add an other limiting resistor on the line which goes from the TX of the arduino to the RX of the SBC you're using, as most of them are 3.3V and not 5V... no need for reverse sbc tx-->arduino rx as it's not used and anyway the arduino can detect a 3.3v signal as HIGH anyway, no problem here... but, as said, not used in this case...

  11. I considered https://www.tindie.com/products/xorbit/lifepo4weredpi3/ because it does say in the description:
    -An auto-boot feature to maximize uptime by making the Raspberry Pi run whenever there is sufficient battery power or when the USB input voltage is present.
    -An auto shutdown feature that makes it possible to automatically shut down the Raspberry Pi when the USB input voltage has been removed for a programmable amount of time.
    But yes a bit more expensive....

    1. But thanks Scott for bringing this into the discussion. I noted they state 1.33 amps. Is that really going to be enough for the Rasperry Pi 3 and can it be used with other boards? Often manufacturers of these boards state you should have a 2 amps power supply.

      So - one or two options out there, but we keep looking. Basically there is nothing stopping anyone with PCB skills taking what we have here now and making a new PCB to do the job... but I would like to see something that remains pretty low cost, now I'm used to it I do like the idea of the display.. and I'd like to see the ability to handle 2 amps. Some useful comments on that Tindie links about batteries!

      Something that is REALLY nice about that Tindie project - is the SIZE.. the board is tiny...

      1. Pete, I would also not buy the finished product and yes, I did see the limit which I think comes from the LiFePo battery he is using and not from the MIC2876 boost regulator with a 4.8A switch. Add a good heat-sink and a LiFePO4 26650 or a LiFePO4 32600P battery and you are better off. I am also looking for a better solution so I am thinking of hacking this one.
        In https://hackaday.io/project/9461-lifepo4weredpi he mentions he made a board to use the TI TPC61235P, which is a significant step-up to the MIC2876. I will ask if he will sell a few boards.

        1. I see what he's done - well, having gotten to grips with the monitoring side now - all I need is a very basic charger/buck convertor to provide the 5v... pref at 2 amps....

  12. So - monitoring and control cracked - what is now needed is the simplest possible circuit for a charger and boost-to-5v circuit able to simultaneously charge and power the load - but able to power up to 2amps - and pref with a logic control of the output to save having to use a relay.....

    Thoughts anyone.....

  13. I did think of a better way to do the status if one didn't want the LCD. Instead of using 1 light.. use 2... red and green - so red is standby, red flashing is considering coming on - green is on - green flashing is warning the micro it is about to shut down.... I think that's better and means in general use, no flashing lights.

      1. I would be inclined to use a serial RGB LED for that.. but I think folk are more likely to have red and green LEDs lying around. All my serial RGBs are SMT. Anyway the software is simple enough to do any of those based on a flag.

  14. I've found this page providing a nice comparison of various power supply solutions available for RPI UPS.
    Most offer finished products, however some are open source. You can review what has been tried.

    The TPS2113A autoswitching power multiplexer, also looks like a very helpful little IC. It allows to "switch seamlessly between two power sources of 2.8 V to 5.5 V while blocking reverse current into either source."

    1. Hey thanks for that Michal - the LIPO versions of these still seem to think 1 amp is enough (or less in some cases).... designs must be before Pi3 (though most of the boards I get these days recommend 2 amp supplies). I'll check all the links.

    1. But you see... THAT is the problem - these things are 10 a penny and are usually based on similar chips - but the specs are so vague you can't really tell and being Chinese your chances of getting a dialog with the supplier are slim. Two questions always to try and get answered - CAN it supply full power AND charge at the same time - and WHAT happens if the battery is FLAT - will it start up with a load connected - many will fail one or both of these challenges - presumably just due to lack of thought in the design process.

      So this looks good but the display is little more than a gimmick as it doesn't do anything. I'm wrestling with the idea of getting a little board made or encouraging someone to get one made - with my little OLED - maybe something that could pin onto the back of the Nano - and I only say THAT because the NANO is so cheap it is hardly worth duplicating. Actually there's a 4 line version of that OLED which is even smaller which would INDEED mount on the back of a Nano... I'm wondering how much degradation I'd get by using a P channel MOSFET to supply power to the Pi...mainly as it would be 10x smaller than a relay, not for any other reason.

      1. I wish we had schematics for some of these - on that board in question I can see the charge controller - and I can see what looks like 3 mosfets - but I can't see the bit that provides the output - surely that must have a chip.

      2. I ordered one. Testing and reporting in... 45 days? 🙂

        I am currently using a nice powerbank. One of those that keep powering the Raspi even when you plug and unplug it from the charger.

        I has been working flawlessly for more than a year, but it is a bit expensive for 'massive' deployments.

  15. Had a similar problem for a car dashcam. My car has start/stop and cuts power to the cigarette lighter socket during this. This was causing the camera to sometimes stop and not restart.

    I got 2 £1 usb powerbanks, and took the battery out of one, and wired it to the battery of the other powerbank, ie share the battery.

    One powerbank is now able to supply power via usb, and the other can be used to supply a charge at the same time, whereas they often cut output during charging.

    Cheap, and works well for me.

    1. Hi Paul

      So I'm looking at this on the English language site - https://goo.gl/KM6Q0i

      Around a tenner.... Not sure what Tesla's batteries have to do with anything as he doesn't exactly sell them in your typical Chinese outlet... however... "the output can reach 2 amps" - does that mean it can PEAK at 2 amps or that it will handle 2 amps... no sign of any heat dissipating arrangements. 0.5 amps charging current - they all seem to be tarred with this brush... so let me do the maths - starting with a flat battery.... (mains went off overnight....) and another power cut is coming along - you need 4 hours charge to get 1 hour out at 2 amps. I guess that's being picky but I do wonder why that limit.

      5v to 8v input is good - that means at a pinch you might be able to supplement things with solar input... that would be good. I'm assuming this then is merely a power supply - and not any kind of monitoring or having any kind of alert system which basically puts it on a par (though a lot neater) with solutions out there but POSSIBLY with that advantage of greater output.

      Would LOVE to hear from someone who can give this a good hammering and check the 2 amps claim, check if it will start up from dead etc.

  16. Searching for a different thing I bumped into these cheap UPS/Powerpack hats.

    Description (UPS board) says:

    - Can be charged and supplied power to raspberry pi at the same time.
    - With 4 LED power indicator;
    - Provides an example code to beginner to demonstrate how to demonstrate battery capacity displays the current battery level in the raspberry pi
    current program, it can detect the current battery, voltage etc.
    -- Applicatoin scene 1: You can program to control automatic backup of data at low power and safe shutdown.
    -- Applicatoin scene 2: Remind users to charge at low battery levels. etc.)
    - Removable battery, user can choose a more larger capacity lithium battery pack (NOTE: voltage must be 3.7V).
    - With safety protection circuit to prevent overcharge and over discharge.

    UPS hat: https://www.banggood.com/Geekworm-UPS-HAT-Board-2500mAh-Lithium-Battery-For-Raspberry-Pi-3-Model-B-Pi-2B-B-A-p-1105260.html

    Powerpack hat: https://www.banggood.com/V1_0-Lithium-Battery-Expansion-Board-For-Cellphone-Raspberry-Pi-3-Model-B-Pi-2B-B-p-1059297.html

    Comments are a bit scary, however 🙂

    1. the second one seems the one that Peter tested and was rubbish... you can find in other blog posts a photo where Andreas Spiess added a capacitor to try to not have it power down the pi, but even so is not ideal for rpi3...

      for both: none of them arrive at 3A, they talk about 2A or 1.8A, and NOT saying if it's continuos or only peak usage...

      a good ups have to have these features:
      1) 3A stable, or at least 2A stable and 3A peak...
      2) can be charged WHILE using it, without causing a reboot...
      3) startup the pi EVEN if battery is low, if charging power is back... many of these will not work if battery is flat and load is connected...

        1. It does indeed seem that way. This phrase needs clarification "When you click once the button, charging work will start and LEDs will show the dump energy. When you keep clicking the button over 2.5s, output will stop."

          Erm, what? Does that mean you have to press a button to start off charging? surely not?

          1. i think they just wrongly wrote... as they talk about dump energy... i think the button is to just start the power delivery FROM the battery to the load, but this is a problem anyway, as if battery goes flat and then power returns and start charging, even if charged, who will press the button to start the attached device???

            for rpi shutdown, as the board has 4 leds, you can test when the led just before the latest goes LOW, so you can trigger the shutdown... something Andreas Spiess did in 1 of his latest videos, using a 4 bars battery indicator

  17. so, my little board arrived... initial post: https://tech.scargill.net/a-question-of-lifespan/#comment-34547 (i took the model for 2.5A output, has a little lcd on a side)

    little soldering (some photos here: http://imgur.com/a/qjJt3 ) attached to charge, it says 032 (display is upside down, the photo with 001 was of a faulty battery, then changed...), i think it's a percentage... now it's at 074...

    while it's charging, i attached a little load, an usb flash light... no light at all... leaved light attached, disconnected charging cable, light came up... reattach charge, light off... very disappointing...

    to test the actual amps it can deliver, i'll wait it's charged... side note, don't know what's that button, as does nothing while charging, nor it does while serving power...

    1. Oh I would think that Nano gadget I made would do the job nicely. If they only problem it has is not starting up from flat, the simple solution indeed is for the Nano to turn off the load (except it's own very small load) before the battery gets to that point - and then not turn it on until the voltage has increased significantly and that's just what my little nano project does.

      1. no, the flat test was not done yet, as i just surrendered when i attached the load and it did not start until removed charging power... it works as many powerbanks, no output while charging... can we bypass this step? if yes, i'll do the remaining tests, otherwise they're worthless... 🙁

          1. do you think that monitoring battery power and using your nano setup to send the shutdown signal to the raspberry, and after 1 minute powering on the charge via your relay, is a viable thing? This way the PI is already shutted dows, so no problems when starting charge will disconnect server output power... when it' fully charged (or above a certain %, let's say 98%), disconnect the charge so power will go out from the battery and restart the PI... only BIG problem I see, this way the board will always be powered by battery and then shutted down while it's recharging, then again restarted, and so on... no, not good, at all... 🙁

  18. I think part of the problem we see is that none of these boards was designed for the purpose we want to use them for - most of the ones on Ebay will be from discontinued products or excess production or whatever. The problem is that if one of us tried to make one - the costs would vastly exceed anything the Chinese charge. I note that many of them use little controller chips with no attempt to utilise the PCB for heat dissipation - something that would cost almost nothing to implement. Anyway, so the ones that won't charge and run at the same time are suitable for the waste bin only - as for the rest, if nothing else my little Nano solution stops them getting to the point of discharge that they don't come back on and gives the opportunity for a graceful shutdown. A shame the I2c is in master mode for the display as if in slave mode, one could poll the unit for voltages and times and whether or not the computer should shut down. Hmmmmm.

  19. Browsing through BangGood I found this low voltage UPS for US$24
    5V2A 44W UPS Uninterrupted Power Supply https://www.banggood.com/5V2A-44W-UPS-Uninterrupted-Power-Supply-Alarm-System-Security-Camera-Dedicated-Backup-Power-Supply-p-1118312.html?rmmds=search.
    There is also a 12V version.
    Thinking about ordering one and seeing if there is some way to trigger a low voltage state to send the PI and let it know when to shut down. But 6 hours is probably enough for blackouts and brownouts that are not catastrophic.

    1. Hi Scott

      This one has had me rolling about laughing... check the specification...

      "If long time did not use this mini UPS, suggest 3-5 months to charge it once"

      Don't you just love Chinese translations.

      In all seriousness - it could well be a good one - my biggest question is always the same - if it is allowed to go flat.... given that the load is plugged in - when the power is returned - will it sensibly wait for sufficient charge and then turn on - or will the load need disconnecting, defeating the object.

      I would love for you to buy one of these and give it the test and let us know the result in here. Well spotted.

      1. Hey Pete,
        As with all Chinese products most come without a good manual and only way to know is to buy one and test it. The other thing is quality of critical components to handle the application.
        My question besides low budget is what are your critical power requirements, (Spain power)? With a product like this I am sure you are covered if you use a few relays and large Caps to make a serial UPS going from BG UPS to Solar to mains. The probability of not having sun, mains and the mini UPS run out is very low unless there is a major catastrophe, In my case it would be a hurricane in SoFla.
        I'm unemployed now so I need to justify to the wife buying more "toys", while I figure out how to set up NR to override BigClock with a push button.

        1. So most of the time here in rural Spain the power is ok, but without warning we may get a 5 minutes power break. Generally never more than a matter of minutes... however, very occasionally our hot tub has managed to take out the main earth leakage breaker... I've disconnected the heater for now as it is HOT here and that has solved the problem but I don't have a MEGGER to test for leakage - my normal meter shows around the correct resistance for the heater and no apparent earth leakage. A neighbour is bringing his megger over.. Now if that were to happen when we are not in Spain, it could be a day or two before I get someone to turn on the power. So for me I would like something that could power devices for a day but more importantly, that it will ALWAYS recover when the power recovers. To date, experiments with various boards has shown boards that will not recover from a flat battery until the load is removed - which is just about the stupidest thing imaginable. I've managed to get around that but it would be nice to stumble on a supply board at low cost that handles this without adding bits in.

          1. Sounds like Mexico.... Do you have a spike suppressor (MOV) on your mains? I have a few industrial units peppered around my house near motors, I got those from some Radio Base stations I installed last century. They are good for lightning strikes and reverse EMF when the fridge or pump start when demand is high after power comes back. A friend in rural Italy had a similar problem that actually killed some electronics. That is the importance of a good ground. Do you have a spear breaker? From hot tub to electric chair?
            I was also going to build a few Li-Ion packs with salvaged computer batteries instead of using Pb batteries http://www.batteryspace.com/pcbfor148vli-ionbatterypack5alimitwithfuelguagesocket.aspx.

    1. Well, if we replaced what I've done with the NANO - with an ESP-12 you'd have exactly the same thing though more messy - for considerably less. What is needed is a board like that little one I use - more power and a logical input to turn off ONE of the power outputs - the ESP still needs 5v to operate - the only down side on a small battery system would be the power consumed by the ESP unless it was put to sleep and periodically woken up.

        1. For me that's really overkill - you can get low power from the ESP if you keep it off most of the time - in this case ultra-low power is not that important - if you get a power cut lasting more than day you're in severe trouble anyway....

    1. those boards have a nice addon board on the side of which you can plug many premade modules, or a protoboard... this is a kit of esp8266+oled board, together with addon board and relay module:

      all the available modules, as of today: https://it.aliexpress.com/item/X1-shield-new-NODEMCU-wifi-ESP8266-ESP-12F-0-96-inch-OLED-learning-kit/32815664805.html

        1. well, yes, but if you take a wemos d1 mini, + an oled display, + a relay, and a little protoboard to put it on all by yourself, you get quite there as price, and you have to do all the required connections (in a bulkier way) and add the TIME you need to do all that... 🙂
          otherwise, take a standard sonoff and add an oled, and you end up to about 8€ for everything 🙂
          but maaaaaaaaaybe (*) you need to change the winbond memory, too... 😉

          (*) OT, a very funny sketch by Louis CK 😀

Leave a Reply

Your email address will not be published. Required fields are marked *