View Single Post
  #8  
Old April 8th 20, 05:58 PM posted to rec.aviation.soaring
Martin Gregorie[_6_]
external usenet poster
 
Posts: 699
Default Battery switching without tears

On Wed, 08 Apr 2020 08:57:43 -0600, kinsell wrote:

Runs an embedded linux, they're not storing any data during normal
operation, so baffling why that's so hard to fix.

When does it commit data to non-volatile memory, i.e. does in
intentionally buffer it and only commit at intervals or as part of
shutting down?

FWIW The same problem occurs with Raspberry Pis.

As you may or may not know, these run a Debian Linux clone as their OS
and use SD cards for non-volatile memory by default. Much of the time
people can get away with simply pulling the plug when the Pi appears to
be idle, but if you do that while the Pi is flushing its caches to its SD
card or, more rarely, the card is in the middle of a wear-levelling
process, then the SD card will become corrupted and possibly permanently
damaged if it was wear-levelling when the power vanished. Which is why
everybody soon learns to shut the Pi down with a 'sudo stop' command
before powering it off. I think its worse with SD cards simply because
their internal controllers and cheap, rather basic and have no power
buffering. Use an SSD instead or, even better, a hard drive and the
problem largely goes away because ext4 is a journalling filesystem, so
has built-in recovery.

I agree this is a tricky problem, and maybe best solved with some sort of
cheap'n cheerful UPS. Here's a suggestion along those lines:

Pimoroni sell the PowerBoost 1000 Charger, a small and fairly cheap UPS
circuit ($US 19.39 from Amazon), which you connect between a 5v power
supply and the device you want to power via a UPS socket. You also
connect a suitable sized 1S (3.7 volt) Lithium-ion battery to it - the
sort used to power small RC models would be fine - and there's a power
buffer for any UPS-powered device that doesn't have an internal battery.
Its good to supply up to 1000mA provided that the battery is rated for
that current. Some soldering is needed.

It comes with a selection of sockets, but they're all sat loosely in
place on the board so you can solder the ones you want on, sling the
others and solder any permanent connections you need.

I have one but haven't used it yet - I'm planning to make a PDA from a 4"
touch screen and a Pi Zero WL and use this Pimoroni plus an RC model 1S
LiPO battery to power it. Add a case made from epoxyboard and it should
be ready to rock'n roll.


--
Martin | martin at
Gregorie | gregorie dot org