Lithium-Ion Battery Circuitry Is Simple

By now, we’ve gone through LiIon handling basics and mechanics. When it comes to designing your circuit around a LiIon battery, I believe you could benefit from a cookbook with direct suggestions, too. Here, I’d like to give you a collection of LiIon recipes that worked well for me over the years.

I will be talking about single-series (1sXp) cell configurations, for a simple reason – multiple-series configurations are not something I consider myself as having worked extensively with. The single-series configurations alone will result in a fairly extensive writeup, but for those savvy in LiIon handling, I invite you to share your tips, tricks and observations in the comment section – last time, we had a fair few interesting points brought up!

The Friendly Neighborhood Charger

There’s a whole bunch of ways to charge the cells you’ve just added to your device – a wide variety of charger ICs and other solutions are at your disposal. I’d like to focus on one specific module that I believe it’s important you know more about.

You likely have seen the blue TP4056 boards around – they’re cheap and you’re one Aliexpress order away from owning a bunch, with a dozen boards going for only a few bucks. The TP4056 is a LiIon charger IC able to top up your cells at rate of up to 1 A. Many TP4056 boards have a protection circuit built in, which means that such a board can protect your LiIon cell from the external world, too. This board itself can be treated as a module; for over half a decade now, the PCB footprint has stayed the same, to the point where you can add a TP4056 board footprint onto your own PCBs if you need LiIon charging and protection. I do that a lot – it’s way easier, and even cheaper, than soldering the TP4056 and all its support components. Here’s a KiCad footprint if you’d like to do that too.

Continue reading “Lithium-Ion Battery Circuitry Is Simple”

Hackaday Links Column Banner

Hackaday Links: October 9, 2022

Don’t you just hate it when you walk out of the bathroom with toilet paper stuck to your shoe? That’s a little bit like what happened when the Mars helicopter Ingenuity picked up a strange bit of debris on one of its landing pads. The foreign object was spotted on the helicopter’s down-pointing navigation camera, and looks for all the world like a streamer of toilet paper flopping around in the rotor wash. The copter eventually shed the debris, which wafted down to the Martian surface with no further incident, and without any apparent damage to the aircraft. NASA hasn’t said more about what the debris isn’t — aliens — than what it is, which of course is hard to say at this point. We’re going to go out on a limb and say it’s probably something we brought there, likely a scrap of plastic waste lost during the descent and landing phase of the mission. Or, you know, it’s getting to be close to Halloween, a time when the landscape gets magically festooned with toilet paper overnight. You never know.

Continue reading “Hackaday Links: October 9, 2022”

Mommy, Where Do Ideas Come From?

We wrote up an astounding old use of technology – François Willème’s 3D scanning and modeling apparatus from 1861, over 150 years ago. What’s amazing about this technique is that it used absolutely cutting-edge technology for the time, photography, and the essence of a technique still used today in laser-line 3D scanners, or maybe even more closely related to the “bullet time” effect.

This got me thinking of how Willème could have possibly come up with the idea of taking 24 simultaneous photographs, tracing the outline in wood, and then re-assembling them radially into a 3D model. And all of this in photography’s very infancy.

But Willème was already a sculptor, and had probably seen how he could use photos to replace still models in the studio, at least to solidify proportions. And he was probably also familiar with making cameos, where the profile was often illuminated from behind and carved, often by tracing shadows. From these two, you could certainly imagine his procedure, but there’s still an admirable spark of genius at work.

Could you have had that spark without the existence of photography? Not really. Tracing shadows in the round is impractical unless you can fix them. The existence of photography enabled this idea, and countless others, to come into existence.

That’s what I think is neat about technology, and the sharing of new technological ideas. Oftentimes they are fantastic in and of themselves, like photography indubitably was. But just as often, the new idea is a seed for more new ideas that radiate outward like ripples in a pond.

Engineers: Be Subversive To Be Green

The caterers for the volunteer workforce behind the summer’s MCH hacker camp in the Netherlands served all-vegan food. This wasn’t the bean sprouts and lentils that maybe some of the more meat-eating readers might imagine when confronted with vegan food, nor was it a half-as-good array of substitutes with leathery soy hamburgers and rubbery fake cheese smelling suspiciously of feet.

Instead it was a well-crafted, interesting, and tasty menu that was something to look forward to after several hours driving a vanload of handwashing sinks. It was in one of their meals that I found food for thought when driving a week later past the huge Garzweiler open-cast lignite mine on my way through Germany to Luxembourg’s Haxogreen as part of my European hacker camp summer tour.

The meal was deep-fried soy protein strips and the mine is probably one of Western Europe’s dirtiest and most problematic CO2 sources in a country that likes to imagine itself as environmentally friendly, so where in this unlikely connection did I find a pairing? Continue reading “Engineers: Be Subversive To Be Green”

This Week In Security: PHP Attack Defused, Scoreboard Manipulation, And Tillitis

If you use PHP, you likely use the Composer tool for managing dependencies, at least indirectly. And the good folks at SonarSource found a nasty, potential supply chain attack in this tool, when used in the Packagist repository. The problem is the support for arbitrary README filenames. When a package update shows up on Packagist, that service uses a Version Control Service (VCS) like Git or Mercurial to pull the specified readme location. That pull operation is subject to argument injection. Name your branch --help, and Git will happily run the help argument instead of doing the pull intended. In the case of Git commands, our intrepid researchers were unable to weaponize the issue to achieve code execution.

Composer also supports projects that use Mercurial as their VCS, and Mercurial has a --config option that has… interesting potential. It allows redefining a Mecurial command as a script snippet. So a project just has to contain a malicious payload.sh, and the readme set to --config=alias.cat=!hg cat -r : payload.sh|sh;,txt. For those keeping track at home, the vulnerability is that this cursed string of ugly is accepted by Composer as a valid filename. This uses the --config trick to redefine cat as a bit of script that executes the payload. It ends in .txt because that is a requirement of Composer.

So let’s talk about what this little hack could have been used for, or maybe still used for on an unpatched, private install of Packagist. This is an unattended attack that jumps straight to remote script execution — on an official package repository. If discovered and used for evil, this would have been a massive supply chain attack against PHP deployments. Instead, thanks to SonarSource, it was discovered and disclosed privately back in April. The official Packagist repo at packagist.org was fixed the day after disclosure, and a CVE and updated packages went out six days later. Great work all around.
Continue reading “This Week In Security: PHP Attack Defused, Scoreboard Manipulation, And Tillitis”

Git Your PCBs Online

Last time, I’ve shown you how to create a local Git repository around your PCB project. That alone provides you with local backups, helping you never lose the changes you make to your files, and always be able to review the history of your project as it developed.

However, an even more significant part of Git’s usefulness is the ability to upload our creations to one of the various online Git repository hosting services, and keep it up to date at all times with a single shell command. I’d like to show you how to upload your project to GitHub and GitLab, in particular!

Continue reading “Git Your PCBs Online”

Immersive Cursive: Growing Up Loopy

Growing up, ours was a family of handwritten notes for every occasion. The majority were left on the kitchen counter next to the sink, or in a particular spot on the all-purpose table in the breakfast nook. Whether one was professing their familial love and devotion on the back of a Valpak coupon, or simply communicating an intent to be home before dinnertime, the words were generally immortalized in BiC on whatever paper was available, and timestamped for the reader’s information. You may have learned cursive in school, but I was born in it — molded by it. The ascenders and descenders betray you because they belong to me.

Both of my parents always seemed to be incapable of printing in anything other than all caps, so I actually preferred to see their cursive most of the time. As a result, I could copy read it quite easily from an early age. Well, I don’t think I ever had any hope of imitating Dad’s signature. But Mom’s on the other hand — like I said in the first installment, it was important for my signature to be distinct from hers, given that we have the same name — first, middle, and last. But I could probably still bust out her signature if it came down to something going on my permanent record.

While my handwriting was sort of naturally headed towards Mom’s, I was more interested in Dad’s style and that of my older brother. He had small caps handwriting down to an art, and my attempts to copy it have always looked angry and stilted by comparison. In addition, my brother’s cursive is lovely and quick, while still being legible.

Continue reading “Immersive Cursive: Growing Up Loopy”