USB-C For Hackers: Program Your Own PSU

Last time, I showed off a few ways you can convert an existing PSU to USB-C duty, and zoomed in on a particular way you can use to convert one of the ever-abundant 18 V – 20 V laptop PSUs to USB-C. All we have left is to write software for it, and I’ll explain how it works. There’s also that one cool USB-C secret I’ve found out, but you’ll have to read on to find out more.

From the last article, we have a board that has an RP2040 and FUSB302 combo on it, which takes a 20 V DC PSU input from a laptop brick, and can switch either 5 V, 20 V or 0 V to its USB-C socket using FETs. The USB-C communication firmware is simple enough, but there’s caveats, especially regarding safety. Let’s go through those!

The Code Logic

VBUS has to be non-powered by default – we only supply 5 V when the FUSB302 detects a 5.1 kΩ pulldown on one of the CC lines. After supplying 5 V, we send out PSU capability advertisements, of the kind that we’ve learned to parse in the Replying PD article – and whenever we get a Request, we have to switch to the requested profile, connecting the voltage rail requested to the FET. I opt to not do any current consumption control in this design, assuming a well-behaved device, but you theoretically should do that. It wouldn’t be hard to add a high-side current sensor, say, something from Analog Devices – I just don’t want to do that now, especially given that I’m already using two of the exposed ADC pins to do Lenovo/HP PSU capability detection instead, one is used up for VBUS measurement, and the fourth is used for VIN (20 V rail) measurement – that’s four ADCs, which is as much as the RP2040 has got. However, if I ever need more ADCs, I can add an analog mux like 4051 in the next version! Continue reading “USB-C For Hackers: Program Your Own PSU”

The Hoarder’s Dilemma Hack Chat

Join us on Wednesday, December 6 at noon Pacific for the The Hoarder’s Dilemma Hack Chat with Gabe Emerson!

There’s a lot to be said for the power of a well-stocked junk bin. It’s almost a magical thing, being able to dive into a random box and retrieve just the right part to perform a needful repair or to complete a project without the need to hit the web or hop in the car for a trip to the hardware store. For those who pride themselves on their resourcefulness, it can be a heady experience indeed.

But as with everything, such feats of fix-it come at a price. That little squirt of dopamine that comes from having just the right thing can make your monkey brain fixate on a simple equation: “More stuff is better stuff.” The higher and deeper your stash, the better your chances of having what you need, assuming you can find it, of course. This way lies madness, and perhaps an appearance on a reality TV show.

join-hack-chatIs there a better way? It’s hard to say, but we figured it would be a good idea to loop in someone with a lot of experience collecting junk that somehow finds its way into some pretty cool projects. Gabe Emerson runs the popular and aptly named “saveitforparts” channel over on YouTube, and fancies himself an accomplished hoarder. We’d have to agree, given his recent 1,000-mile drive to pick up a used geodesic dome, or his ever-increasing collection of RV satellite dishes, which he somehow puts to good use. His junk collection is pretty epic; he even has a whole piece of property devoted to the larger pieces of his collection, like an entire monorail train. He seems uniquely qualified to discuss the “Hoarder’s Dilemma” and the painful process of deciding what stays and what goes.

Our Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, December 6 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

Hackaday Links Column Banner

Hackaday Links: December 3, 2023

Sure, it does less than originally promised, but hey — at least it’s more expensive. That about sums up Tesla fans’ feelings after the long-awaited Cybertruck reveal at the Texas Gigafactory on Thursday, where Elon Musk himself handed over the keys — or their Cyber equivalent — to a few new owners. These are expensive machines — $61,000 for the two-motor model, and just shy of $100,000 for the three-motor all-wheel-drive model with all the bells and whistles. That’s considerably more than they were expected to cost back in 2019, a fact which may be at least partially behind the drop in Tesla shares after the launch.

Continue reading “Hackaday Links: December 3, 2023”

The Physics Lesson I Keep Re-Learning

One of the most broadly applicable ideas I’ve ever encountered is the concept of impedance matching. If you’re into radio frequency electronics, you’re probably thinking that I mean getting all your circuit elements working to a common characteristic resistance for maximum power transfer. (If you’re not, you’re probably wondering what that jumble of words even means. Fear not!)

But I mean impedance matching in the larger sense. Think about driving a stick-shift automobile. In low gear, the engine has a lot of torque on the wheels, but it can’t spin them all that fast. In high, the wheels turn fastest, but there’s not enough torque to get you started from a standstill. Sometimes you need more force and less motion, other times more motion and less force. The gearbox lets you match the motor’s power to the resistance – the impedance – it’s trying to overcome.

Or think about a cello. The strings are tight, and vibrate with quite a bit of force, but they don’t move all that much. Air, which is destined to carry the sound to your ear, doesn’t take much force to move, and the cello would play louder if it moved more of it. So the bridge conveys the small, but strong, vibrations of the strings and pushes against the top of the resonant box that makes up the body of the instrument. This in turn pushes a lot of air, but not very hard. This is also why speakers have cones, and also why your ear has that crazy stirrup mechanism. Indeed, counting the number of impedance matches between Yo Yo Ma and your brain, I come up with four or five, including electrical matches in the pre-amp.

I mention this because I recently ran into a mismatch. Fans blow air either hard or in large volume. If you pick a fan that’s designed for volume, and put it in a pressure application, it’s like trying to start driving in fifth gear. It stalled, and almost no air got pushed up through the beans in my new “improved” coffee roaster, meaning I had to rebuild it with the old fan, and quick before the next cup was due.

I ran into this mismatch even though I knew there was a possible impedance issue there. I simply don’t have a good intuitive feel how much pressure I needed to push the beans around – the impedance in question – and I bought the wrong fan. But still, knowing that there is a trade-off is a good start. I hope this helps you avoid walking in my footsteps!

Hackaday Podcast Episode 246: Bypassing Fingerprint Readers Is Easy, Killing Memory Chips Is Hard, Cell Phones Vs Sperm

It’s the week after Thanksgiving (for some of us) and if you’re sick of leftovers, you’re in luck as Elliot and Dan get together to discuss the freshest and best inter-holiday hacks. We’ll cue up the “Mission: Impossible” theme for a self-destructing flash drive with a surprising sense of self-preservation, listen in on ET only to find out it’s just a meteor, and look for interesting things to do with an old 3D printer. We’ll do a poking around a little in the basement at Tektronix, see how easy it is to spoof biometric security, and get into a love-hate relationship with both binary G-code and bowling balls with strings attached. What do you do with a box full of 18650s? Easy — make a huge PCB to balance them the slow way. Is your cell phone causing a population crisis? Is art real or AI? And what the heck is a cannibal CME? Tune in as we dive into all this and more.

Check out the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!

Grab a copy for yourself if you want to listen offline.

Continue reading “Hackaday Podcast Episode 246: Bypassing Fingerprint Readers Is Easy, Killing Memory Chips Is Hard, Cell Phones Vs Sperm”

This Week In Security: Owncloud, NXP, 0-Days, And Fingerprints

We’re back! And while the column took a week off for Thanksgiving, the security world didn’t. The most pressing news is an issue in Owncloud, that is already under active exploitation.

The problem is a library that can be convinced to call phpinfo() and include the results in the page response. That function reveals a lot of information about the system Owncloud is running on, including environment variables. In something like a Docker deployment, those environment variables may contain system secrets like admin username and password among others.

Now, there is a bit of a wrinkle here. There is a public exploit, and according to research done by Greynoise Labs, that exploit does not actually work against default installs. This seems to describe the active exploitation attempts, but the researcher that originally found the issue has stated that there is a non-public exploit that does work on default installs. Stay tuned for this other shoe to drop, and update your Owncloud installs if you have them. Continue reading “This Week In Security: Owncloud, NXP, 0-Days, And Fingerprints”

End Of An Era: Popular Science Shutters Magazine

Just three years after the iconic magazine abandoned its print version and went all-digital, Popular Science is now halting its subscription service entirely. The brand itself will live on — their site will still run tech stories and news articles, and they have two podcasts that will keep getting new episodes — but no more quarterly releases. While you can’t complain too much about a 151 year run, it’s still sad to see what was once such an influential publication slowly become just another cog in the content mill.

Started as a monthly magazine all the way back in 1872, Popular Science offered a hopeful vision of what was over the horizon. It didn’t present a fanciful version of what the next 100 years would look like, but rather, tried to read the tea leaves of cutting edge technology to offer a glimpse of what the next decade or so might hold. Flip through a few issues from the 1950s and 60s, and you won’t see pulpy stories about humanity conquering the stars or building a time machine. Instead the editors got readers ready for a day when they’d drive cars with warbird-derived turbochargers, and enjoy more powerful tools once transistor technology allowed for widespread use of small brushless motors. It wasn’t just armchair engineering either, issues would often include articles written by the engineers and researchers that were on the front lines. Continue reading “End Of An Era: Popular Science Shutters Magazine”