Decoding S/PDIF With A Microcontroller Brings A Few Headaches

The average punter shunts audio around with analog 3.5 mm cables, RCA jacks, or Bluetooth on a regular basis. A useful standard that hasn’t really bothered most of us is S/PDIF, standing for Sony/Phillips Digital Interface. It’s a useful way to pump digital audio around over copper cables or optic fiber. [Andrew Jeddeloh] got curious about the standard after contemplating some long cable runs in his home, and decided to try decoding it.

The target for [Andrew]’s development efforts was the STM32L476 Discovery, which had no SPDIF decoding hardware on board. Instead, [Andrew] tinkered with the peripherals he had to see what would work. In the end, a cavalcade of internal timers were daisy chained to allow the microcontroller to recover a clock from the self-clocked S/PDIF signal. This was then used to generate a clock to sync up the onboard SPI hardware to actually read in the 16-bit PCM data from the S/PDIF signal.

[Andrew]’s original broader plan was to pipe the S/PDIF data to the onboard I2S DAC, though he struggled manipulating the remaining resources on the STM chip to do so successfully. Anyone wishing to have a crack can take a look at [Andrew]’s code over on GitHub. If completed, the STM32L476 would become a useful analog endpoint for S/PDIF streams, allowing you to pump tunes digitally over long distances without signal degradation. If you know the key to getting it done, sound off in the comments! Alternatively, if you need to get up and running more quickly, the Teensy platform has you covered!

A Magnetic Field Strength Meter Using An Arduino

We’re used to Hall effect devices as proximity sensors in mechanical systems, used to provide detection of something that has a magnet attached to it. However it’s easy to forget that the devices that provide a magnet-or-not digital output are only part of the story, and linear Hall effect devices provide a handy way to measure a static magnetic field. It’s something [mircemk] demonstrates, with an Arduino-powered magnetic field strength meter that uses a UGN 3503U Hall effect device.

The circuit is extremely simple, comprising the sensor, an Arduino Nano, and an OLED display. This device is handy because its voltage output has a known relationship to the gauss level the sensor is experiencing, so while the accuracy of its calibration isn’t verified it can at least give a believable reading derived from the Arduino’s ADC.

The whole is wrapped up in an attractive case that looks as though it has been made from PCB material, with the sensor protruding on what seems to be the shell of a plastic ballpoint pen. It makes a handy instrument that provides a useful function for not a lot of money, so what’s not to like! Take a look at the video below the break for the full story.

Surprisingly such projects are few and far between here at Hackaday, however it’s not the first magnetic field measurement we’ve seen.

Continue reading “A Magnetic Field Strength Meter Using An Arduino”

Hackaday Links: April 4, 2021

Can I just say that doing a links roundup article in a week that includes April Fool’s Day isn’t a fun job? Because it’s not. I mean, how can you take something like reports of X-rays flowing from Uranus seriously when they release the report on such a day? It sure looks like a legitimate story, though, and a pretty interesting one. Planets emitting X-rays isn’t really a new thing; we’ve known that Jupiter and Saturn are both powerful X-ray sources for decades. Even though Uranus is the odd child of our solar system, finding evidence for X-ray emissions buried in data captured by the Chandra observatory in 2007 was unexpected. Astronomers think the X-rays might be coming from Uranus’ rings, or they might be reflections of X-rays streaming out from the sun. Or, it might be the weird alignment of the gas giant’s magnetic field causing powerful aurorae that glow in the X-ray part of the spectrum. Whatever it is, it’s weird and beautiful, which all things considered isn’t a bad way for things to be.

Another potential jest-based story popped up this week about the seemingly impossible “EmDrive”. It seems that when you appear to be breaking the laws of physics, you’re probably doing it wrong, and careful lab tests showed that fuel-free propulsion isn’t here yet. One would think it was self-obvious that filling a closed asymmetrical chamber with microwaves would produce absolutely no thrust, but EmDrive proponents have reported small but measurable amounts of thrust from the improbable engine for years. A team at TU Dresden found otherwise, though. Even though they were able to measure a displacement of the engine, it appears to be from the test stand heating up and warping as the RF energy flowed into the drive chamber. By changing the way the engine was supported, they were able to cancel out the dimensional changes that were making it look like the EmDrive was actually working.

Want to use surface-mount parts, but don’t want to bother spinning up an SMD board? Not a problem, at least if you follow the lead of David Buchanan and perform no-surface surface-mount prototyping. We stumbled upon this on Twitter and thought it looked cool — it’s got a little bit of a circuit sculpture feeling, and we like the old-school look of plain 0.1″ perfboard. David reports that the flying leads are just enameled magnet wire; having done our share of scraping and cleaning magnet wire prior to soldering, we figured that part of the build must have been painful. We pinged David and asked if he had any shortcuts for prepping magnet wire, but alas, he says he just used a hot blob of solder and a little patience while the enamel cooked off. We still really like the style of this build, and we applaud the effort.

Speaking of stumbling across things, that’s one of the great joys of this job — falling down algorithmically generated rabbit holes as we troll about for the freshest hacks. One such serendipitous was this YouTube channel documenting a really nice jet engine build. We’ve seen plenty of jet engines before, but very few with afterburners like this one has. There’s also something deeply satisfying about the variable-throat nozzle that Praendy built for the engine — it’s a level of complexity that you don’t often see in hobbyist jet engines, and yet the mechanism is very simple and understandable.

The other rabbit hole we discovered was after reporting on this cool TIG tungsten grinding tool. That took us into The Metalist’s back catalog, where we found a lot of interesting stuff. But the real treat was this automatic tube polisher (video), which we have to say kept us guessing up to the very end. If you’ve got 12 minutes and you enjoy metalworking builds at all, watch it and see if you’re not surprised by the cleverness of this tool.

And finally, we had heard of the travails of Anatoli Bugorski before, but never in the detail presented in this disturbing video. (Embedded below.)

Who is Anatoli Bugorski, you ask? He is a Russian particle physicist who, while working in an accelerator lab in 1978, managed to get his head directly in the path of a 76 GeV proton beam. Despite getting a huge dose of radiation, Bugorski not only survived the accident but managed to finish his Ph.D. and went on to a long career in nuclear physics. He also got married and had a son. He was certainly injured — facial paralysis and partial deafness, mainly — but did not suffer anything like the gruesome fates of the Chernobyl firefighters or others receiving massive radiation doses. The video goes into some detail about how the accident happened — two light bulbs are better than one, it turns out. We enjoyed the video, but couldn’t stop thinking that Bugorski was the Russian atomic-age equivalent of Phineas Gage.

Pocket Cheat Sheets For Electronics

What started as business cards for [Nerdonic]’s engineering clients unexpectedly expanded into a project in its own right. A CheatKard set consists of seven electronics cheat sheets made in the style of PCB rulers. Sized at 80 mm x 50 mm, they should fit in your business card holder or wallet regardless of the standard in your country. Alternatively, the set can be held together with a small ring in the top corner. The cards are made from fiberglass PCB stock, 0.6 mm thick with gold plating and matte black solder mask. The stackup goes like so:

  • Cover
  • Measurements
  • Schematic Symbols
  • Component Values
  • Footprints, SMD 1
  • Footprints, SMD 2
  • PCB Design
  • Laws and Theory

Even before shipping this electronics set, [Nerdonic] has already been asked to make sets of CheatKards for other fields, such as photography, chemistry, antenna design, mathematics, etc. While these aren’t as comprehensive as the Pocket Ref book from years gone by, we like a good cheat sheet. If you want to get a set, check out [Nerdonic]’s Kickstarter project which was funded within hours of going live, and see the short video clip below the break. He also makes a pledge to plant one tree in the Amazon rainforest for each set he sells.

Do you have any favorite cheat sheets or cheat sheet making techniques? Do you prefer your cheat sheets to be physical or stored on your computer? Share your comments down below.

Continue reading “Pocket Cheat Sheets For Electronics”

A Big Ship Chop Shop On The Georgia Coast

Last week we saw a hapless container ship vaulted to fame, where people converged on its combination of mind-boggling size suffering an easily relatable problem of getting stuck. Now that it is moving again, armchair engineers who crave more big ship problem-solving should check out [David Tracy]’s writeup on the salvage operation of an overturned car carrier ship, the MV Golden Ray published by Jalopnik. If the ship’s name doesn’t ring a bell, the writeup opens with a quick recap.

Written for an audience of gearheads, [Tracy]’s writeup walks through some technical aspects of the salvage plan and initial results of execution. Citing from the official entity in charge, the St. Simons Sound Incident Response Unified Command, and augmented with information from elsewhere. Even though the MV Golden Ray is “only’ half the length and a third of the gross tonnage of our meme darling MV Ever Given, it is still a huge ship. Every salvage operation this big is unique, requiring knowledge far beyond our everyday intuition. At this scale, most Internet “Why don’t they just…” comments range from impractical to absurd.

Fortunately, people who actually know how to perform salvage work designed plans, submitted by multiple bidders, each making a different tradeoff in cost and speed among other factors. The chosen plan was to cut the ship into sections small enough to be carried by barge for further processing elsewhere. This required a huge floating crane, a chain pressed into cutter duty, custom fabricated lugs for lifting, and similarly custom fabricated cradles for the barges.

But we all know that no plan survives contact with reality. While this plan was seemingly chosen for speed, it hasn’t gone nearly as fast as advertised. Certainly the pandemic was a huge hinderance, but cutting has also been slowed by pieces built far stronger than spec. Delays also meant more sediment buildup inside the wreck, compounding headaches. Other bidders have started saying that if their plan had been chosen the job would be done by now, but who’s to say their plan wouldn’t have encountered their own problems?

In time St. Simons Sound will be cleared as the Suez Canal has been. Results of their respective investigations should help make shipping safer, but salvage skills will still be needed in the future. At least this operation isn’t as controversial as trying to retrieve the radio room of RMS Titanic.

Cheat At Cornhole With A Bazillion-Dollar Robot

While the days of outdoor cookouts may be a few months away for most of us, that certainly leaves plenty of time to prepare for that moment. While some may spend that time perfecting recipies or doing various home improvement projects during their remaining isolation time, others are practicing their skills at the various games played at these events. Specifically, this group from [Dave’s Armory] which have trained a robot that helps play the perfect game of cornhole. (Video, embedded below.)

While the robot in question is an industrial-grade KUKA KR-20 robot with a hefty price tag of $32,000 USD, the software and control system that the group built are fairly accessible for most people. The computer vision is handled by an Nvidia Jetson board, a single-board computer with extra parallel computing abilities, which runs OpenCV. With this setup and a custom hand for holding the corn bags, as well as a decent amount of training, the software is easily able to identify the cornhole board and instruct the robot to play a perfect game.

While we don’t all have expensive industrial robots sitting around in our junk drawer, the use of OpenCV and an accessible computer might make this project a useful introduction to anyone interested in computer vision, and the group made the code public on their GitHub page. OpenCV can be used for a lot of other things besides robotics as well, such as identifying weeds in a field or using a Raspberry Pi for facial recognition.

Continue reading “Cheat At Cornhole With A Bazillion-Dollar Robot”

Color-Changing Sutures Detect Infection

If you’ve ever had surgery, you know firsthand how important it is to keep the wound from getting infected. There are special conductive sutures that sense changes in wound status via electrical signal and relay the information to a computer or smart phone. As awesome as those sound, they’re a first-world solution that is far too pricey for places that need it most — developing countries. And surgical wounds in developing countries are about four times more likely to get infected than those in the US.

Iowa high-school student [Dasia Taylor] found a much simpler solution that could drive down the infection rate. She used beets to develop color-changing sutures that turn from bright red to purple within five minutes if an infection is present.

Beets, and other fruits and vegetables like blackberries, plums, and blueberries are natural indicators of pH. They have a compound called anthocyanin that gives them both their pigment and this cool property. Beets are perfect because they change color at a pH of nine — the same pH level of infected human skin, which is normally around five.

[Dasia] experimented with several types of suture thread to see which ones would absorb the beet juice in the first place. She settled on a cotton-polyester blend that is braided. While it probably helps absorb the beet juice, it would also give bacteria several places to hide. Another problem is that many surgeries involve cutting muscle, too, and by the time a deeper infection would show up on the sutures, it would be pretty late in the game. But if these color-changing sutures can be made to be cost-effective, safe for skin, and of course, keep wounds together, this solution is way better than nothing at all and definitely worth producing. You can see [Dasia] talk about her project in the video below.

Want to know more about natural pH indicators? Sure you do.

Continue reading “Color-Changing Sutures Detect Infection”