Arduino Measures Remaining Battery Power With Zero Components, No I/O Pin

[Trent M. Wyatt]’s CPUVolt library provides a fast way to measure voltage using no external components, and no I/O pin. It only applies to certain microcontrollers, but he provides example Arduino code showing how handy this can be for battery-powered projects.

The usual way to measure VCC is simple, but has shortcomings.

The classical way to measure a system’s voltage is to connect one of your MCU’s ADC pins to a voltage divider made from a couple resistors. A simple calculation yields a reading of the system’s voltage, but this approach has two disadvantages: one is that it constantly consumes power, and the other is that it ties up a pin that you might want to use for something else.

There are ways to mitigate these issues, but it would be best to avoid them entirely. Microchip application note 2447 describes a method of doing exactly that, and that’s precisely what [Trent]’s Arduino library implements.

What happens in this method is one selects Vbg (a fixed internal voltage reference that is temperature-independent) as Vin, and selects Vcc as the ADC’s voltage reference. This is essentially backwards from how the ADC is normally used, but it requires no external hookup and is only a bit of calculation away from determining Vcc in millivolts. There is some non-linearity in the results, but for the purposes of measuring battery power in a system or deciding when to send a “low battery” signal, it’s an attractive solution.

Being an Arduino library, CPUVolt makes this idea very easy to use, but the concept and method is actually something we have seen before. If you’re interested in the low-level details, then check out our earlier coverage which goes into some detail on exactly what is going on, using an ATtiny84.

Hackaday Links Column Banner

Hackaday Links: December 17, 2023

Disappointing news from the US Senate this week as the “AM Radio for Every Vehicle Act” failed to advance in the sausage-making legislative process. We’ve previously covered this bill, which aims to force vehicle manufacturers to provide the means to receive terrestrial AM broadcasts in their cars and trucks without the need for extra subscriptions or charges. The bill’s sponsors tried to get it through on a “unanimous consent” maneuver, but Senator Rand Paul decided he didn’t like the idea of the government mandating what equipment cars should have. The coverage we’ve seen on this bill leads us to believe its sponsors are missing the point. Instead of pitching this as an issue of freedom of choice in entertainment, what they should be concentrating on is the safety aspect of AM radio. We’ve seen how much the government has invested in keeping AM stations on the air in just about any foreseeable emergency, so it’s only natural to look at a car’s AM radio as essential safety equipment like airbags, antilock brakes, and backup cameras. Seems like that’s something that everyone can agree on.  Continue reading “Hackaday Links: December 17, 2023”

Radio Station WWV: All Time, All The Time

Of all the rabbit holes we technical types tend to fall down, perhaps the one with the most twists and turns is: time. Some of this is due to the curiously mysterious nature of time itself, but more has to do with the various ways we’ve decided to slice and dice time to suit our needs. Most of those methods are (wisely) based upon the rhythms of nature, but maddeningly, the divisions we decided upon when the most precise instrument we had was our eyes are just a little bit off. And for a true time junkie, “a little bit off” can be a big, big problem.

Luckily, even the most dedicated timekeepers — those of us who feel physically ill when the clock on the stove and the clock on the microwave don’t match — have a place to go that’s a haven of temporal correctness: radio station WWV. Along with sister stations WWVB and WWVH, these stations are the voice of the US National Institutes for Standards and Technology’s Time and Frequency Division, broadcasting the official time for the country over shortwave radio.

Some might say the programming coming from these stations is a bit on the dry side, and it’s true that you can only listen to the seconds slip by for so long before realizing that there are probably better things to do with your day. But the WWV signals pack a surprising amount of information into their signals, some of it only tangentially related to our reckoning of time. This makes these stations and the services they provide essential infrastructure for our technological society, which in turn makes it worth your time to look into just how they do it.

Continue reading “Radio Station WWV: All Time, All The Time”

Some Bacteria Could Have A Rudimentary Form Of Memory

When we think of bacteria, we think of simple single-celled organisms that basically exist to consume resources and reproduce. They don’t think, feel, or remember… or do they? Bacteria don’t have brains, and as far as we know, they’re incapable of thought. But could they react to an experience and recall it later?

New research suggests that some bacteria could have a rudimentary form of memory of their experiences in the environment. They could even pass this memory down across generations via a unique mechanism. Let’s dive into the latest research that is investigating just what bacteria know, and how they happen to know it.

Continue reading “Some Bacteria Could Have A Rudimentary Form Of Memory”

Nanobots Self Replicate

Hey, what if you could have a factory that makes robots that is run by… robots? This is hardly an original thought, but we are a long way from having an assembly line of C3POs self-replicating. On the other hand, animals — including humans — self-replicate all the time using DNA. Now, scientists are making tiny nanorobots from DNA that can assemble more DNA, including copies of themselves.

Assembling 3D structures with DNA has deep implications. For example, it might be possible to build drugs in situ, delivering powerful toxins only to cancer cells. Another example would be putting DNA factories in diabetes patients to manufacture the insulin they can’t.

Continue reading “Nanobots Self Replicate”

Artemis’ Next Giant Leap: Orbital Refueling

By the end of the decade, NASA’s Artemis program hopes to have placed boots back on the Moon for the first time since 1972. But not for the quick sightseeing jaunts of the Apollo era — the space agency wants to send regular missions made up of international crews down to the lunar surface, where they’ll eventually have permanent living and working facilities.

The goal is to turn the Moon into a scientific outpost, and that requires a payload delivery infrastructure far more capable than the Apollo Lunar Module (LM). NASA asked their commercial partners to design crewed lunar landers that could deliver tens of tons of to the lunar surface, with SpaceX and Blue Origin ultimately being awarded contracts to build and demonstrate their vehicles over the next several years.

Starship and Blue Moon, note scale of astronauts

At a glance, the two landers would appear to have very little in common. The SpaceX Starship is a sleek, towering rocket that looks like something from a 1950s science fiction film; while the Blue Moon lander utilizes a more conventional design that’s reminiscent of a modernized Apollo LM. The dichotomy is intentional. NASA believes there’s a built-in level of operational redundancy provided by the companies using two very different approaches to solve the same goal. Should one of the landers be delayed or found deficient in some way, the other company’s parallel work would be unaffected.

But despite their differences, both landers do utilize one common technology, and it’s a pretty big one. So big, in fact, that neither lander will be able to touch the Moon until it can be perfected. What’s worse is that, to date, it’s an almost entirely unproven technology that’s never been demonstrated at anywhere near the scale required.

Continue reading “Artemis’ Next Giant Leap: Orbital Refueling”

A Handheld Hackintosh, But So Much More

As handheld computing has solidified alongside everything else into the mobile phone, it’s sad that the once promising idea of a general purpose machine in the palm of the hand has taken a turn into the dumbed-down walled-garden offered by smartphone vendors. There was a time when it seemed that a real computer might be a common miniaturized accessory, but while it’s not really come to pass, at least [iketsj] has taken a stab at it. His handheld Hackintosh runs MacOS on a miniature scale, and looks rather nice.

At its heart is the LattePanda Alpha x86 single board computer, with a small custom expansion board  for a couple of buttons, a USB hub, a small keyboard, and a display. These parts are all mounted to a baseboard with metal stand-offs, and the power is sourced from a single USB-C socket at the bottom edge. What makes it more extraordinary is that it’s not the first handheld Hackintosh from this maker, the previous one being significantly bigger.

On one hand then, this is home-built PC like any other, assembled from off-the-shelf-parts. But on the other it’s far from normal, for despite its simplicity it forms a very usable small form factor device. The Akruvia Una keyboard uses tactile switches so maybe it’s not the machine to type your thesis on, but other than that it makes a great little machine for MacOS, Linux, or Windows. We like it, and we think you will too when you see the video below the break.

Continue reading “A Handheld Hackintosh, But So Much More”