Sunday, August 11, 2024

Insertomatic 6000 Part 2: Audio switching

One notable feature of the Insertomatic 4000 is that the same audio can be sent to all the RF modulators, which makes it possible to play music on one Pi and have the music perfectly synchronised on all four of its channels. This is most useful in a multi-TV setup where it is preferable that the music playing from all of them is synchronised.

I decided to include this feature on the Insertomatic 6000, but implemented a different way.

Raspberry Pi audio switching

The classic NAND gate multiplexer is used here to multiplex the Raspberry Pi PWM outputs, then the outputs of the multiplexers are connected to the modulators through the standard Raspberry Pi audio filter circuit.

The inverter need not be a separate part and it could use the fourth NAND gate in the package instead. I was using two inverters to buffer the Pi 3's PWM output before it was fed into its dedicated modulator channel so that its volume matched that of the multiplexed channels (it would be quieter otherwise) but I didn't come out ahead by using the inverters because the design only has three multiplexers for the three Pi Zeros; if there were four multiplexers, then the three NAND ICs + one inverter IC would give us two spare inverters compared to using four NAND ICs.

Digital multiplexer made using NAND gates, and audio filter

For 5V operation and compatibility with the 3.3V level signals from the Pi, it is important that 74HCT series devices are used. If 74HC or 4000 series devices were used, the maximum high threshold of the inputs would be above the guaranteed minimum output of the Raspberry Pis, and operation could be unreliable or it might not work at all.

AV input audio switching

For the AV inputs, I decided to keep things simple and do this entirely in the analogue domain. I also added an aux input for the audio rather than reusing that from the Pi, because I wanted a way to distribute the audio output from another device. To keep things simple, I didn't add the option of using the audio from the Pi 3.

The audio associated with the video input would be used when the video input is valid, and the aux input would be used otherwise. Fortunately, there was no need to add a video detection circuit, as the SAA7113 used in the VBIT-Pi hat features two programmable outputs, one of which was unused and could be configured to output a high signal when the input is valid or low otherwise. This signal controls a 74HCT4316 analogue switch, which is similar to the 4066 except it adds a negative supply pin (VEE). The VEE pin is connected to the circuit which generates the -5V supply for the LCD contrast, adds negligible current draw, and negates the need for DC biasing on the audio inputs.

Analogue multiplexer circuit using 74HCT4316

The video valid signal is generated by the SAA7113 by setting the RTSE0[3:0] bits to 0011, configuring the RTS0 pin as the horizontal lock indicator.

Build

Before building the circuits on the matrix board, I built them on breadboard just to confirm that they would work.

They did, so the audio switching circuit was added to the matrix board which already had the power supplies and Pi Pico fitted. The wiring was added to the underside to keep up appearances on the top side.

Photo of audio switching circuit

All the circuits were tested and worked as expected.

Mechanical design

The front and back panels were designed in Inkscape and converted into a format suitable for CNC machining on a CNC at the local Hackerspace using FlatCam (not the useless G-code generator in Inkscape). Holes were added for all the ports and controls including the LCD and switches in the front panel.

Picture of the back panel being machined in the CNC
Pictures of the cut but unfinished front and back panels
Back panel with connectors fitted

The back panel cut quite easily but the thicker front panel was much more difficult to cut and the CNC chewed it up quite a bit. The aluminium got very hot during the operation. The front was eventually cleaned up with arduous use of the file. During this process, it was revealed that the aluminium is painted rather than anodised, and the filing scratched up the paint quite badly, but ultimately it will be covered with a laser-cut sheet which will make it look much better than it does and this won't matter any more.

The front panel design was modified slightly to add the text and the four holes in the corner which were pre-drilled in the front panel. The height was reduced slightly so that there was no chance of the laser cut panel protruding above or below the front panel slightly and snagging when inserting the completed unit into a cabinet. The results of cutting the design into Perspex Duo look really good.

Picture of the laser cut front panel showing engraved text

Next steps

From a mechanical perspective, I'm going to re-cut the inside panel made in part 1 to make the layout more compact; originally I wasn't going to install the Pi Zeros directly on top of the VBIT-Pis, but during assembly, I decided that would be better, and recutting the panel will free up a lot of space, potentially making it possible to shorten the case.

The electronics are nearly done now and all that remains is to wire up the remaining front panel controls.

The Pi Pico software still requires a lot of work as nothing has been done on it since part 1. Memory for the channel numbers needs to be added as does the ability to receive the now playing info from the four Raspberry Pis.

Insertomatic 6000 Part 4: Finishing up

Summary of the Insertomatic 6000 One Raspberry Pi 3 + three Pi Zero 2 Ws fully networked using USB Gadget 6 analogue RF channels in t...