Label Your Shtuff!

Joshua Vasquez wrote a piece a couple of weeks ago about how his open source machine benefits greatly from having part numbers integrated into all of the 3D printed parts. It lets people talk exactly about which widget, and which revision of that widget, they have in front of them.

Along the way, he mentions that it’s also a good idea to have labels as an integrated part of the machine anywhere you have signals or connectors. That way, you never have to ask yourself which side is positive, or how many volts this port is specced for. It’s the “knowledge in the head” versus “knowledge in the world” distinction — if you have to remember it, you’ll forget it, but if it’s printed on the very item, you’ll just read it.

I mention this because I was beaten twice in the last week by this phenomenon, once by my own hand costing an hour’s extra work, and once by the hand of others, releasing the magic smoke and sending me crawling back to eBay.

The first case is a 3D-printed data and power port, mounted on the underside of a converted hoverboard-transporter thing that I put together for last year’s Chaos Communication Congress. I was actually pretty proud of the design, until I wanted to reflash the firmware a year later.

I knew that I had broken out not just the serial lines and power rails (labelled!) but also the STM32 SWD programming headers and I2C. I vaguely remember having a mnemonic that explained how TX and RX were related to SCK and SDA, but I can’t remember it for the life of me. And the wires snake up under a heatsink where I can’t even trace them out to the chip. “Knowledge in the world”? I failed that, so I spent an hour looking for my build notes. (At least I had them.)

Then the smoke came out of an Arduino Mega that I was using with a RAMPS 1.4 board to drive a hot-wire cutting CNC machine. I’ve been playing around with this for a month now, and it was gratifying to see it all up and running, until something smelled funny, and took out a wall-wart power supply in addition to the Mega.

All of the parts on the RAMPS board are good to 36 V or so, so it shouldn’t have been a problem, and the power input is only labelled “5 A” and “GND”, so you’d figure it wasn’t voltage-sensitive and 18 V would be just fine. Of course, you can read online the tales of woe as people smoke their Mega boards, which have a voltage regulator that’s only good to 12 V and is powered for some reason through the RAMPS board even though it’s connected via USB to a computer. To be honest, if the power input were labelled 12 V, I still might have chanced it with 18 V, but at least I would have only myself to blame.

Part numbers are a great idea, and I’ll put that on my list of New Year’s resolutions for 2021. But better labels, on the device in question, for any connections, isn’t even going to wait the couple weeks until January. I’m changing that right now.

Portable MRI Machine Comes To The Patient

To say that the process of installing a magnetic resonance imager in a hospital is a complex task is a serious understatement. Once the approval of regulators is obtained, a process that could take years, architects and engineers have to figure out where the massive machine can be installed. An MRI suite requires a sizable electrical service to be installed, reinforced floors to handle the massive weight of the magnet, and special shielding in the walls and ceiling. And once the millions have been spent and the whole thing is up and running, there are ongoing safety concerns when working around a gigantic magnet that can suck ferromagnetic objects into it at any time.

MRI studies can reveal details of diseases and injuries that no other imaging modality can match, which justifies the massive capital investments hospitals make to obtain them. But what if MRI scanners could be miniaturized? Is there something inherent in the technology that makes them so massive and so expensive that many institutions are priced out of the market? Or has technology advanced far enough that a truly portable MRI?

It turns out that yes, an inexpensive MRI scanner is not only possible, but can be made portable enough to wheel into a patient care room. It’s not without compromise, but such a device could make a huge impact on diagnostic medicine and extend MRI technologies into places far beyond the traditional hospital setting.

Continue reading “Portable MRI Machine Comes To The Patient”

Raspberry Pi 4 HDMI Is Jamming Its Own WiFi

Making upgrades to a popular product line might sound like a good idea, but adding bigger/better/faster parts to an existing product can cause unforeseen problems. For example, dropping a more powerful engine in an existing car platform might seem to work at first until people start reporting that the increased torque is bending the frame. In the Raspberry Pi world, it seems that the “upgraded engine” in the Pi 4 is causing the WiFi to stop working under specific circumstances.

[Enrico Zini] noticed this issue and attempted to reproduce exactly what was causing the WiFi to drop out, and after testing various Pi 4 boards, power supplies, operating system version, and a plethora of other variables, the cause was isolated to the screen resolution. Apparently at the 2560×1440 setting using HDMI, the WiFi drops out. While you could think that an SoC might not be able to handle a high resolution, WiFi, and everything else this tiny computer has to do at once. But the actual cause seems to be a little more interesting than a simple system resources issue.

[Mike Walters] on a Twitter post about this issue probed around with a HackRF and discovered a radio frequency issue. It turns out that at this screen resolution, the Pi 4 emits some RF noise which is exactly in the range of WiFi channel 1. It seems that the Pi 4 is acting as a WiFi jammer on itself.

This story is pretty new, so hopefully the Raspberry Pi Foundation is aware of the issue and working on a correction. For now, though, it might be best to run a slightly lower resolution if you’re encountering this problem.

Back To Video Basics With An ESP32 VGA Display

In a world where standards come and go with alarming speed, there’s something comforting about VGA. It’s the least common denominator of video standards, and seeing that chunky DB15 connector on the back of a computer means that no matter what, you’ll be able to get something from it, if you can just find a VGA cable in your junk bin.

But that’s the PC world; what about microcontrollers? Can you coax VGA video from them? Yes, you can, with an ESP32, a handful of resistors, and a little bit of clever programming. At least that’s what [bitluni] has managed to do in his continuing quest to push the ESP32 to output all the signals. For this project, [bitluni] needed to generate three separate signals – red, green, and blue – but with only two DACs on board, he had to try something else. He built external DACs the old way using R/2R voltage divider networks and addressed them with the I2S bus in LCD mode. He needed to make some compromises to fit the three color signals and the horizontal and vertical sync pulses into the 24 available bits, and there were a few false starts, but the video below shows that he was able to produce a 320×240 signal, and eventually goosed that up to a non-native 460×480.

It’s a pretty impressive hack, and we learned a lot about both the ESP32 and the VGA standard by watching the video. He’s previously used the ESP32 to build an AM radio station and to output composite PAL video, and even turned his oscilloscope into a vector display with it. They’re all great learning projects too.

Continue reading “Back To Video Basics With An ESP32 VGA Display”

Tearing Into Delta Sigma ADCs Part 2

In part one, I compared the different Analog to Digital Converters (ADC) and the roles and properties of Delta Sigma ADC’s. I covered a lot of the theory behind these devices, so in this installment, I set out to find a design or two that would help me demonstrate the important points like oversampling, noise shaping and the relationship between the signal-to-noise ratio and resolution.

Modulator Implementation

modulatorCheck out part one to see the block diagrams of what what got us to here. The schematics shown below are of a couple of implementations that I played with depicting a single-order and a dual-order Delta Sigma modulators.

schematicBasically I used a clock enabled, high speed comparator, with two polarities in case I got it the logic backwards in my current state of burn out to grey matter ratio. The video includes the actual schematic used.

Since I wasn’t designing for production I accepted the need for three voltages since my bench supply was capable of providing them and this widget is destined for the drawer with the other widgets made for just a few minutes of video time anyway. Continue reading “Tearing Into Delta Sigma ADCs Part 2”

Tearing Into Delta Sigma ADC’s

It’s not surprising that Analog to Digital Converters (ADC’s) now employ several techniques to accomplish higher speeds and resolutions than their simpler counterparts. Enter the Delta-Sigma (Δ∑) ADC which combines a couple of techniques including oversampling, noise shaping and digital filtering. That’s not to say that you need several chips to accomplish this, these days single chip Delta-Sigma ADCs and very small and available for a few dollars. Sometimes they are called Sigma-Delta (∑Δ) just to confuse things, a measure I applaud as there aren’t enough sources of confusion in the engineering world already.

I’m making this a two-parter. I will be talking about some theory and show the builds that demonstrate Delta-Sigma properties and when you might want to use them.

Continue reading “Tearing Into Delta Sigma ADC’s”

Making Better Noises With Dual PWM

pwm_16b_sm

Although it’s technically possible to get 16 bits of resolution on a ATMega328, most implementations of PWM on everyone’s favorite ‘mega – including just about every Arduino sketch – are limited to 8 bit PWM. This means the pins can only output 256 different values, so if you’re playing around with music made on an Arduino don’t expect very high fidelity.

There is a clever way around this: use two PWMs, and use one pin for high bytes and another for low bytes. That’s what Open Music Labs did when working on a synthesizer project that needed very high quality audio.

The basic idea behind the build is that PWM pins can be used to create audio frequencies. Using two PWM pins and adding them together means it’s possible to add extra bits of resolution. This requires using different values of resistors on each pin. For example, using the same value of resistors on two PWM pins increases the resolution by one bit. Two pins with a resistor value ratio of 1:4 increases the resolution by four bits, and so on.

There’s a great tutorial for setting up these higher resolution, dual PWM outputs on an ATMega or Arduino, as well as a distortion analysis for this dual PWM setup.