Kris Slyka Builds a Working Analog TV Transmitter From an STM32 and "Almost No [Other] Parts"

STMicroelectronics' STM32G431 gets pushed to the limits to create the VideoThing analog video transmitter for CRT TVs.

Maker Kris Slyka has designed a transmitter for analog TV signals using "almost no parts" — starting with nothing more than a spare STMicroelectronics STM32G431 development board and ending with a compact custom PCB dubbed the VideoThing.

"So after looking around for a bit, realizing that CRT TVs have gotten stupidly expensive, and finally picking up this adorable thing for €50 [around $59] I found myself with a whole new technological rabbit hole to dive into," Slyka writes of the project. "Turns out that one of the reasons this TV was so cheap was because it doesn’t have any video input besides an antenna. And it’s black and white. Both of which are deeply disappointing to gamers. And since analogue video broadcasts around here have stopped like a decade ago I couldn’t even enjoy our high quality domestic TV programming, let alone connect any of my weird cameras. So, there’s two options here, basically: either mod the TV for composite video input (not too hard) or just get an RF modulator (easy)."

What do you do when you have an analog TV but the transmitters have long since been shut down? Build your own from a microcontroller, of course. (📹: Kris Slyka)

Slyka decided, in true maker fashion, that both those options were too easy — so set about building a custom RF modulator, capable of outputting a video signal the TV's analog tuner could understand. The starting point: an STMicro NUCLEO-G431KB development board, built around the STM32G431 microcontroller "which, according to ST," Slyka notes, "features 'medium analog level integration.' That's just the amount of analog integration I was looking for!"

The first part of the process: outputting a blank signal, to replace the static of a tuner failing to lock on to a carrier. For that, Slyka used the microcontroller's internal op-amps. "The internal operational amplifiers on this chip support input muxing, allowing them to quickly switch between different input signals," the maker explains. "If I could make them switch fast enough, well… that’s basically an RF modulator right there."

Slyka's adapter includes a range of features, like a tile renderer for games (above), Conway's Game of Life, and a text renderer, plus an implementation of the Speak and Spell's LPC-10 voice codec — all on-device. (📷: Kris Slyka)

With a success there, with the otherwise-unamplified signal being fed to the TV's integrated antenna by the simple act of wrapping a wire around it, the STM32G431's digital to analog converter (DAC) was added to the mix in order to deliver video — using two DACs in parallel and switching between them with the op-amp. "All I had to do now," Slyka writes, "was to generate a composite video signal and output it through the two DACs in the right way to achieve the desired modulation of the RF carrier."

With video — eight-bit grayscale at a 400×300 resolution — sorted, Slyka moved on to adding sound. "This should be easy, right? It’s just audio! That’s so much easier than video," the maker says. "Audio was hard. Really hard. Way harder than I thought it would be. And the main reason for that is that the audio in a TV signal uses FM modulation. And creating a finely frequency modulated signal on a microcontroller is surprisingly hard. And I really didn't want to have to resort to creating the signal in software."

While the solution of using the STM32G431's second 48MHz oscillator, originally intended for USB operation, proved a challenge owing to signal leakage on the breadboard, it proved the concept well enough for Slyka to design a custom PCB: the VideoThing. "In addition to all the previous features I also added some headers for digital and analog inputs and outputs for composite video and line level audio," the maker notes.

The original breadboarded prototype has led to the VideoThing, a compact but capable TV transmitter board. (📷: Kris Slyka)

"I feel like I got incredibly lucky here because not only was I able to use every pin on the small 32 pin package but I was even able to keep all the digital stuff tucked safely away from the analogue portion doing the external signal mixing. You could even do it all on one layer! All the video generation still happens inside the chip, the external components are just support for making the chip run and getting the signals in and out."

The project is documented in full on Slyka's website; source code is available in the project's Git repository, under the succinct "shrug" open source license, with PCB design files to follow once the boards have been tested.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles