Saturday, November 23, 2024

Insertomatic 6000 Part 4: Finishing up

Summary of the Insertomatic 6000

The Insertomatic 6000 is a device which generates six analogue TV channels for distribution around a domestic tv system, two of which are derived from external sources such as a PVR or digital TV receiver, and four of which are generated by Raspberry Pis. All six channels can carry modern enthusiast teletext services containing a range of artwork and information.

List of hardware features:

  • One Raspberry Pi 3 + three Pi Zero 2 Ws fully networked using USB Gadget
  • 6 analogue RF channels in total
  • ...4 of which are connected directly to the composite video outputs of the Raspberry Pis
  • ...2 of which are connected to the two VBIT-Pis, which insert teletext data into the VBI of external composite video sources
  • Each VBIT-Pi takes an external composite video source (such as that from a PVR) and adds a teletext service to the vertical blanking interval of the picture; the teletext service can be set independently from the service which is on the corresponding Pi's own output
  • A controller board which switches the audio channel of the two VBIT-Pi channels to an auxiliary input when the external video input is switched off, and which allows the three Pi Zero channels to be switched between their own audio and the audio of the Pi 3 under control of each Pi Zero
  • Audio selector switches, which select media playback on each of the four Raspberry Pis
  • LCD, which displays information about the playing media, and allows the modulator channels to be conveniently changed
  • A USB port on the front panel, which makes it possible to take full control of the system and run any program that can run on a Raspberry Pi

A short video demonstrating the TV channels generated by the Insertomatic 6000. Five modern enthusiast teletext services are currently carried. The four Raspberry Pi channels are presently showing slideshows but I hope to add visualisers for the audio in the future.

Safe shutdown

I decided it would be useful to incorporate a shutdown function into the Pi Pico-based controller so that all the Pis could easily be safely shut down without having to log into each Pi in turn and run sudo poweroff as I had been doing so far. I used this Sparkfun example to make the Pis shut down or reboot depending on the length of the pulse received on an input pin, and added some menu options to the controller which enable the user to issue a shutdown or reboot command and holds an output pin low for the correct amount of time.

A DuPont wire harness was made which connected pin 6 on each of the four Pis together and to a single I/O pin on the Pi Pico.

I found a flaw in the Sparkfun code which was that when attempting to issue a shutdown command, execution of the script does not terminate immediately, so if the pin goes high before the script has been terminated by the system shutdown, the restart command will be executed as well, and this overrides the earlier shutdown command, resuting in some of the Pis turning back on. I added a quit command immediately below the call to the shutdown function to resolve this problem.

Noise

My fear with this problem was that the wired construction simply resulted in poor grounds and that there would be no way around it except for creating a massive PCB with everything on it to provide a good ground plane. The fact that adding a single ground wire between a Pi and the modulators made little difference supported this view, but fortunately it wasn't necessary. All the Pis needed individual ground wires to the modulators, and once this was done, the picture quality was improved dramatically to the extent that it was now almost perfect.

Animation showing the improved noise

Thermals

The Insertomatic 6000 now has a lot of stuff inside a case with very poor airflow, so I was concerned that the Pis would get too hot, especially when used for something more than just internet radio.

A slot was cut in the base acrylic sheet to hold a fan and some holes were drilled in the bottom panel to the left of the Pi 3 to encourage air to flow across the small heatsink on the Pi 3.

Cutout for the fan cut by the laser cutter
Fan installed in the hole

The 35mm fan runs at high speed directly from a 5V power supply and makes a lot of noise. Whilst very effective, the noise and the 4W of power consumption were unacceptable, so diodes were added in series until a low level of noise was achieved without affecting its effectiveness very much, and the 2W power consumption was better if still a little disappointing.

Temperature of the Pi 3 measured using vcgencmd measure_temp with all Pis powered up and running the Slideomatic software and internet radio:

  • Case closed, no fan: 46.2°C
  • Case open, no fan: 44.0°C
  • Case closed, fan at full speed: 33.2°C
  • Case closed, fan at low speed: 36.5°C

With the Pi 3 running stress for 15 minutes (using the command shown in Part 3) but conditions otherwise the same:

  • Case closed, no fan: 72.0°C, soft temperature throttling activated
  • Case closed, fan at full speed: 49.9°C
  • Case closed, fan at low speed: 49.9°C

vcgencmd get_throttled was added to the for loop from where stress was run to allow monitoring of the throttling status too.

With the Pi 3 under load, the difference between the fan running fast or slow is eliminated which is surprising, but the results at least show that having the fan lowers the temperatures significantly. However, even at the lower speed, the fan is still audible when the room is silent.

I considered adding a simple MOSFET circuit which allows the Raspberry Pi to control the fan via PWM; a Python script could then automatically turn the fan on when a certain temperature is reached or even use PWM to vary the fan speed and possibly drive it at an even lower speed when idle. However, I didn't want to risk introducing another place where noise could get into the pictures, so I decided to keep things relatively simple and add an extra AliExpress buck converter board which would only power the fan; this reduced the fan's impact on mains power consumption to just 0.5W, and the voltage adjustment potentiometer could be used to adjust the voltage to a point where the fan was very quiet but would still reliably start, and this happened to be at 1.82V. The temperature of the Pi 3 running stress was then 55.8°C and idle 38.6°C, a little warmer than when the fan was spinning faster but still much better than no fan at all, so I think it's sufficient to just have the fan running at this speed all the time and not bother adding a speed control.

Fan power supply added to the stripboard

Keeping all services up to date

The vbit2 package includes a script which keeps the currently enabled service up to date. In the case of the two Pi Zeros which each have a VBIT-Pi, it would be useful if when a different service is inserted using the VBIT-Pi to that inserted in the Pi's own composite video output, it is also kept up to date. The script was modified to update every installed service rather than just the enabled one, which works well. Unused services should be uninstalled to avoid updating unused services.

And that wraps up all the work on the hardware of the Insertomatic 6000. However, it's a project that will never be completely done, because there's always room for future improvements. One idea I'd like to implement at some point is visualisers for the audio playback instead of static images in the slideshow.

Code links

Slideomatic

Pi Pico RF Modulator and LCD controller

Customised version of teletext-update.py

Saturday, October 12, 2024

Insertomatic 6000 Part 3: Mechanical and wiring improvements

Mechanical design

The biggest part of this phase would be the mechanical design, as a number of issues had been identified and were to be improved upon.

Depth of the case

The case is slightly too deep to fit in the rack cabinet that I'd like to put it in, and as it should be possible to make everything fit in a shorter case, the case needed to be shortened.

The first step was to deal with the extruded side pieces of the case. Cutting these is easy using the metal bandsaw at the Hackspace, which achieved a perfectly straight cut in seconds. The threads for the screws were then tapped using the correct size taps.

Metal bandsaw
Extruded case offcuts

The next step was to cut the top and bottom panels, This was much trickier because the panels wouldn't fit in the metal bandsaw. They can't be cut with the laser cutter either, not even with multiple passes, but the laser cutter can at least cut a line in the paint which serves as a guide for manual hacksawing. This was done, and the results weren't very nice, as just a millimetre of deviation from the line shows up very clearly once the case is assembled, but it's acceptable. A hole was drilled in each panel for the screw which goes into the metal crosspiece near the front of the cabinet.

The internal sheet of acrylic which holds all the PCBs was also redesigned to make the parts fit more efficiently following the decision to mount the Pi Zeros on top of the VBIT-Pis.

View of the interior from above

Front panel

The design had a few imperfections; the cutout for the pushwheel switches was too big, leaving visible gaps above and below the switches. The cutouts for the three buttons weren't keyed, so the buttons could be rotated. The depth of the front panel made it difficult to plug anything into the USB port. It was also decided that wiring up the LEDs to the activity LEDs on the Pis would be too risky so the arrangement for those was also changed, reducing the number of holes needed. A new front panel was cut with all these changes made.

The LED holders are of a type which are normally secured to the panel using a nut, but in this case the diameter of the holes cut by the CNC were such that it was possible to tap a thread using an M8x0.7mm tap then screw the holders into the panel. This was just as well because the metal and laser cut panels together would have been too deep to get access to the thread of the holders to secure them with nuts.

View of the Insertomatic 6000 from the front

Electrical wiring

While working on the project, it had become clear that using "DuPont Wire" to connect all the parts together was not so convenient after all. The solution to this problem would come in the form of custom wiring harnesses, which would be assembled from IDC ribbon cable, DuPont-syle housings with the right number of pins for each connector, and proper crimps which would be crimped on by hand. This enabled each cable to be made to the exact length required, making the wiring much neater, and all the connectors being the correct size for their connectors make assembly and disassembly much easier with less chance of error.

Hackspace crimping tools

Here is one of the wiring harnesses that I made up:

Picture of one wiring harness

Controller

Channel memory

Obviously it's highly inconvenient for the modulator channels to be forgotten every time the Insertomatic 6000 is turned off, so adding this feature to the Pi Pico-based modulator controller was important.

As is common with these newfangled 32-bit microcontrollers, unlike PICs and AVRs, the Pi Pico doesn't have any EEPROM, and it is necessary to write to the FLASH instead. The main difference is that flash can only be erased a whole sector at a time, which effectively means that all data has to be written in one go rather than updating it whenever each individual setting is changed to avoid making excessive write cycles. This is solved by having a dedicated option in the menu to save the settings when the user is ready. The cycle life is quite high (10,000) and there isn't a need to change the settings often, so it was decided that it would be acceptable to not bother with any wear levelling.

A channel banks feature was added, which makes it possible to save several sets of channels for the modulators and switch between them easily. It could be used to quickly reconfigure the modulator channels when moving the Insertomatic 6000 from where it is normally installed to other places such as teletext exhibitions.

Now Playing info display

I used the Raspberry Pi Foundation's serial PIO example and expanded it to work on four pins on the Pico. I added some code to poll the FIFOs of these PIOs and process the data into some arrays for the cyclic display on the LCD. I then learnt how to control the serial port on the Pi 3 and Zeros so that data could be sent to the Pi Pico; a little bit of code was added to slideomatic.py to process the data returned by the mpc command and send this to the Pico. The data from the Pis is stored and displayed in a cycle.

Animation of the now playing info display

Power supply

The inductors on the AliExpress buck modules got rather uncomfortably hot even when the Pis were all idle, and the linear regulator the for the modulators also got very hot despite only having a 7V input voltage, and it was decided that this could be detrimental to the long term reliability of the design once the box was closed up. It was decided that a second regulator would be added and each one would only be connected to two of the Pis; the result of this was that the inductors only get slightly warm when the Pis are idle, and only get very warm under a prolonged stress test using the stress command on all the Pis simultaneously. The 7805 regulator was changed to an LDO regulator so the input voltage for that could be reduced to under 6V, and it was mounted on one of the extruded edge pieces of the case for heat sinking, and as a result, this regulator now remains cold.

Power consumption

The following command was used to stress-test the Pis:

for ((i = 0 ; i < 60 ; i++ )); do stress -c 4 -t 60s ; vcgencmd measure_temp ; done

Measured with an inexpensive plug-in power meter, the total power consumption is listed below. From 240V to 5V the power supplies are 75% efficient, which doesn't seem great but as the conversion to 5V is done in two stages, this is still equivalent to 87% per stage. 240V to 5V power supplies tend to be less efficient than those with higher output voltages, so the gain of changing to one of these would not be significant even if that didn't introduce noise issues.

  • 15.0W - all Pis idle
  • 24.0W - all Pis running the stress test
  • 0.1W - when all loads are disconnected from the mains power supply

The power consumption is quite important because the total energy consumption adds up to quite a lot over time when the device is left running 24 hours a day as is the intention. For comparison:

  • 4.0W - Single Pi 5 at idle
  • 20.0W - Ivy Bridge office desktop at idle with no spinning hard drives
  • 7.0W - Ivy Bridge laptop at idle

Next steps

The main part of the project is done, but there's still some work to be done...

The picture quality on some of the channels is still quite disappointing, particularly the channels derived from the external AV inputs. I will experiment with extra ground paths between the modulators and Pis, and find a way to disconnect the +5V power lines between the Pi 3 and three Pi Zeros, which are not helpful when the Pi Zeros have their owm direct connection to the power supply board; this will also enable the second 5V switching supply to be dedicated to the two Pi Zeros with the VBIT-Pis, allowing the lone Pi Zero to be paired with the Pi 3 on the first 5V switching supply.

Animation of the noise

Hopefully it won't come to the point of having to design a large PCB almost as big as the acrylic sheet to fit all the components and provide a nice ground plane, but at this point this could be done and it wouldn't add a massive amount of cost in the grand scheme of things.

Finally, once the Insertomatic 6000 has been installed in its rack, all that's left is to find some interesting alternative software to run on the Pi 3. It's possible to switch between the Slideomatic screen and the terminal by connecting a USB keyboard and typing Ctrl+Alt+F1 or Ctrl+Alt+F2, so the Pi 3 can be used for other things before being set back to the Slideomatic screen. Perhaps some BBC Micro and ZX Spectrum ROMs for software originally distributed via Telesoftware could be used to create a "Ceefax Game Pass" service!

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.

Saturday, July 20, 2024

Insertomatic 6000 Part 1: Assembling some RF modulators into a case and making a controller

The Insertomatic 4000 is a one-off four-channel teletext generator by Alistair Cree designed to feed four different teletext services to a number of TVs. It contains four Raspberry Pi Zeros, four surplus RF modulators, and some switching electronics to allow the audio to be independently switched. My goal is to make an improved version which is tailored to my requirements, with the addition of two external video inputs that would allow two external sources to be turned into RF channels in addition to four channels generated by the Pis. The device will feature some additional controls on the front for RF channel and audio programme selection - the audio programme selection will be used for my device's added focus on internet radio playback.

RF modulators

The RF modulators will be sourced from Sky boxes, as I already know how to use these and it's a fairly abundant source, which means I'll be able to get several identical modulators for the project.

I posted on Freegle and Freecycle to ask for boxes, and this was quite effective.

Photo of Sky boxes

There were a couple of issues with the Sky boxes though; the first was that the RF modulator had been removed from the later boxes and replaced with a connector for the optional Sky IO Link, but this was a fairly obvious problem and could be avoided once I had learned from reliable sources that the presence of the WPS button on the front can be used to identify the boxes with this feature removed when only a photo of the front was available. The only frustration was that these boxes were super common, as they'd been the standard for over 10 years by this point.

The far less obvious problem was that in the DRX890, Amstrad (who else?) had discovered that they could cut costs by placing all the components for the RF modulator onto the main board instead of having them on a separate module. This meant that it was no longer practical to remove the modulator, as doing so would require the cutting of a multi-layer PCB without shorting any internal layers, then adding wires to tap into the various parts of the circuit, and this would just be too difficult and fragile.

DRX890 SKy Box RF modulator

Eventually, I had acquired just enough suitable Sky boxes and removed their modulators. The modulator came out quite easily from the Pace box so that survived, whereas the Amstrad boxes required a lot more heat, presumably because they didn't use thermal reliefs on the internal layers of the main PCB, and were destroyed.

Picture of 5 modulators

In the past, I turned this Arduino-based modulator project into a more permanent stripboard assembly, but I had been disappointed by the noisy quality of the picture compared to when the modulator was in a Sky box. To address this issue, I bought some tiny 0402 size ferrite beads, and added one inline with the power connection to the modulator. This delivered a significant reduction in noise, so I proceeded to modify all the modulators, opening them up and cutting the track from the +5V pin before adding the ferrite bead inline. With that done, the modulators were then ready for use.

Controller

The controller was to be responsible for programming the frequency of all six modulators and displaying 'now playing' info from each of the Raspberry Pis on a HD44780-compatible LCD which would be fitted to the front panel. Not a huge amount of processing power needed then, but the unusual requirement of controlling six I2C devices with the same address and having four UARTs meant that choosing a microcontroller wouldn't be easy. I decided to go with the Raspberry Pi Pico because its unique PIO feature would allow the implementation of the UARTs. They would also be able to handle the unusual I2C requirement, but I ultimately decided to just use a software bit-banging approach for that since the actual data is very simple and infrequent.

PCB

I used matrix board for the circuit. I fitted two switching regulator boards, one of which would power all the Raspberry Pis, and the other of which would power just the modulators through a separate linear regulator, minimising the possibility of noise entering the modulators from the Pis. I then added the Pi Pico along with headers for connecting the modulators.

The only unusual aspect of the circuit was the addition of a -5V rail. This would allow the HD44780-compatible LCD to operate from the 3.3V supply of the Pi Pico (regulator on board the Pi Pico), which creates a need for a negative voltage to drive the contrast pin. This avoids needing a 5V level shifter for the LCD as would be required if powering it from 5V, and the negative voltage would have been needed anyway since this particular 24x2 character LCD needs about -6V revative to Vdd to get good contrast as it's an extended temperature range LCD.

I2C

Since all six modulators would always be programmed at the same time, I decided that the best approach would be to share the same clock pin for all of them and just have separate data pins, meaning a total I/O requirement of 7 pins.

With AI being the trendiest thing in tech right now, I asked ChatGPT to write a code example for bit-banging the I2C bus for one device. I tested it and it actually worked first time, programming the modulator as expected. I noticed a flaw in the code which was that it drove the pin high and low, rather than only driving the pin low when needed and making it high-Z at other times, which we'd probably get away with since the slave doesn't appear to use clock stretching, but it's not really 'proper'. I pointed out this mistake to ChatGPT and it immediately produced correct code. I expanded the code myself to write different data to each of the modulators, and this also worked as expected.

At this point, I had just a bare minimum demo which proved that the modulators could be programmed and would work as expected. I still needed to add the user interface for programming them, the ability to remember the setting when turned off, and the display of 'now playing' info, but all that could come later.

Testing all the modulators together

I daisy-chained the six modulators, and they all worked as expected. I was aware that these modulators have a little loop-through gain, and with six in series, this could mean quite a significant difference between the strongest and weakest channel. I used an RTL-SDR to measure the strength of each channel, and found that the loop-through gain was exactly 6dB, so a 6dB attenuator would be needed on the input of each modulator to make them all have the same strength. I also decided to split them into two sets of three with a splitter in reverse to combine them, ensuring that the signal wouldn't travel through too many attenuation and amplification cycles before reaching the output.

Mechanical design

The project will ultimately go inside a rack-mount case, but to keep all the components in place, a laser cut panel was made.

Photo of the main components mounted on the laser cut panel

A very basic setup was made; the video inputs of the modulators were connected to the Pis but the audio was not. The picture became noisy once the Pi Zeros were powered up; almost certainly due to the setup of the ground paths, which will need to be improved to ensure that the Pis all have a good return path which isn't shared with the modulators.

Next steps

The next steps from a mechanical perspective will be to cut holes for all the connectors and buttons in the front and back panels of the case using the CNC.

From an electrical perspective, the next step to work on is the audio switching. The circuits for this will go in the empty space on the matrix board.

For the controller, the next feature to add is memory for the set channel numbers.

Saturday, May 20, 2023

Adding an aspect radio switch to CRT TVs

This post is about a simple modification that can be done to many CRT TVs to add an aspect ratio switch.

The main uses for this nowadays would be to make the TV more usable on a distribution system set up for 16:9 TVs, or to allow for correction of the aspect ratio for retro gaming consoles which were designed for NTSC then bodged to produce a letterboxed PAL picture for export to PAL regions.

This mod can be carried out on most TVs except those made at the end of the CRT TV era, which typically use the service menu for control of the vertical size.

The main objective is to find the V Size potentiometer, then add a switch and a second potentiometer. In the circuit below, decreasing the resistance between the wiper and top end of the track on VR301 will decrease the height of the picture. There are two main ways of connecting it up - remove the wiper connection on the existing potentiometer and connect it to the other leg of a double throw switch, which has the benefit of the second aspect ratio's height not depending on both potentiometers, or switching in the second potentiometer, which has the benefit of avoiding the problem of what happens during the time that the switch is not making contact with either throw when changing its position - that shouldn't damage the TV but doesn't look as good in my opinion.

If the purpose of the mod is to add a 4:3/16:9 switch, then the original potentiometer will set the height for 4:3, and the new one will set the height for 16:9.

If the purpose of the mod is to add a switch for the aspect ratio required for PAL consoles, then the original potentiometer will set the stretched height for that, and the new one will set the height for 4:3.

If 4:3, 16:9 and the stretched aspect ratio for PAL consoles are all required, then a double throw (SPDT) switch can be used. The second throw will connect a second potentiometer to the lower side of the V Size potentiometer. In this case, the original potentiometer will set the height for 4:3, and the new ones will set the aspect ratios for 16:9 and gaming.

The next step is to select an appropriate switch and find somewhere to mount it. Switches with any exposed metal should be avoided unless you are absolutely sure that the TV is powered through a fully isolated transformer. The new potentiometer or trimmer should be accessible once the new switch is installed so that the picture height adjustments can be carried out reasonably safely once the modification has been assembled.

Modification on a 21" colour CRT

A hole was cut in the dummy speaker grille.

Modification on a 12" black and white TV

This TV is powered from a 12V DC input or a transformer. The method of using both throws of the switch to select between the original and new potentiometers was used on this one, with the consequence of the vertical height jumping if the switch is moved too slowly between the two positions.

Once the mod is assembled, assuming the original potentiometer has already been set accurately, the new potentiometer can be adjusted while looking at the picture until the correct aspect ratio is achieved.

Sunday, March 5, 2023

ESP32-based Octopus Tracker Unit Rate Display

This project is based on the ESP32 and demonstrates how the chip can be used to connect to the internet, fetch useful data and display it.

octopus Tracker is a tariff which tracks the day-ahead wholesale prices of electricity and gas. This gets around the problem of energy being bought in advance at very high prices in 2022, making it by far the cheapest non-time of use tariff available in early 2023, but this comes at the expense of the tariff prices changing every day, so it's useful to have these prices conveniently displayed.

The project uses the esp-idf-json library and is based on the json-http-client2 example.

The code connects to wifi, then fetches the JSON data which contains the unit rates. The date and time in the HTTP response header is used to get the current date and time and set the ESP32's built-in RTC, which isn't displayed to the user, but used to refresh the prices every hour and determine what the current date is in order to display the correct prices from the JSON data.

The data is updated hourly because the day's unit rates are occasionally not available from the start of the day, and the correct unit rates won't be available for several hours in such a case.

Link to the source code on GitHub

Hardware design

Two three-digit 7-segment displays are used to display the prices. Each display already has three common anodes for the digits and has the matching segments of each digit connected together internally, and the segment pins of each display have been connected together to produce a display which is electrically a 6-digit multiplexed display. The anodes are switched with some general purpose PNP transistors because the peak current exceeds the current limit of a single ESP32 pin, and the segments are connected to ESP32 pins via resistors to limit the current.

A photodiode has been added to dim the display in conditions of low ambient light. An LDR would also be suitable. The voltage generated by the voltage divider is read using an ADC input and used to select one of four brightness levels. Filtering and hysteresis are used to avoid the brighness flickering in certain lighting conditions.

As an ESP32 WROOM 'dev kit' has been used for this project, the UART and 3.3V voltage regulator are built into the dev kit, so these components didn't have to be included in the circuit. Power to the project is supplied via a USB cable which is plugged into a convenient USB power supply.

Schematic

Schematic

Hardware

The prototype has been carefully built on the copper side of some stripboard, taking care to ensure that no leads are sticking through to the component side on which only the 7-segment displays and photodiode are mounted. The perfectly smooth surface of the component side has been used to apply some labels.

Hardware front
Hardware back

Saturday, September 24, 2022

Bush WI-1810 Internet Radio - Quick Teardown and Analysis

The Bush WI-1810 is a budget internet radio and Bluetooth speaker sold by Argos. At the time of writing, it was discounted to £25, but at its usual price of £49.99 it still represents the low end of the internet radio market. The radio is based on the Magic Systech platform, which is a popular platform and is found on many internet radios, but more premium brands such as Roberts and Pure use the competing Frontier Silicon SmartRadio platform. Both platforms allow set designers to incorporate a variety of features in a set including but not limited to internet radio, Bluetooth, uPnP streaming, FM, DAB+, CD player, and line in, but this set analysed here only features the first three of those features.

Inside the Bush Internet Radio
Close-up view of the PCB

The current consumption of the radio is 0.25A @ 6.0V when in standby and 0.3A when on but nothing is playing. The current goes up by a negligible amount when an internet radio station is playing and the volume is turned down. When the volume is turned up to maximum, the current varies according to the audio and peaks at around 0.5A.

The level of integration in this product is surprisingly low. My original expectation was that there would be a Magic Systech-branded chip inside performing most of the key functions of the radio, much like the Frontier Silicon radios, but all of these functions are carried out by independent ICs and the CPU is an off-the-shelf one not specifically designed for radios. Despite the complexity of the design, components have been carefully selected to lower the cost whilst still delivering a reasonable level of performance where it matters - the audio quality.

Electrolytic capacitors - all off-brand through-hole 10V types, but surprisingly rated for 105 degrees C. Through-hole electrolytic capacitors are still cheaper than surface mount ones for some reason, so the extra assembly effort is often worth it.

CHMC SBE SCA108 Voltage regulator - I couldn't find anything for this part number, but the 0.33R resistor between pins 6 and 7 and the connections to the inductor, schottky diode and timing capacitor point to this being a really cheap Chinese clone of the MC34063, which itself is the cheapest widely available Western switching regulator IC. The 51k and 33k feedback resistors give an output voltage of 3.18V. This IC has a rather high maximum input voltage so this should give good headroom against overvoltage on the input.

The MC34063 is generally a good choice for this application. The only real disadvantage it has is that its switching frequency is low, which means it needs a fairly high-value inductor (typically 220uH), which is physically quite large at the regulator's typical rated current of 0.5A. Large inductors are expensive, so the designer has used a rather small inductor here.

I don't know how much current this design uses at 3.3V, or the current rating of the inductor, so I can't comment on whether it is comfortably adequate or being stressed. However, as both the inductor and chip get rather warm when the set is running, and the set uses 0.3A @ 6V when it's not producing any sound and it runs Linux, I would guess that the current it uses at 3.3V is much closer to 500mA than it is to 0mA, so if the device fails, I would check this inductor.

Nuvoton N32905U3DN main CPU - a surprisingly exotic chip which can run Linux and drive LCDs up to 1024x768. I found some limited information elsewhere on the internet which indicates that the Magic Systech software platform is Linux-based and that it is not exclusive to Nuvoton CPUs. The chip itself is not very old but the ARM926EJ-S CPU core itself is rather dated, which probably keeps costs down and contributes to the general sluggishness of the user interface.

W25Q32JV flash - this 32Mbit capacity (4Mbyte) flash chip will contain the entire program of the product as the CPU does not have any significant program memory of its own.

Super Chip SC2314 audio processor - this applies effects like volume, balance, bass, treble, etc. I'm surprised they didn't integrate these functions into the main CPU and implement them in software. Both channels appear to be in use, so there's an opportunity to mod in a stereo headphone jack to replace the mono jack it comes with. The L and R outputs from this chip go to C15 and C14, the other ends of which are connected together. I haven't tested it to see if the channels are stereo before that point.

CS8509E - Class D amplifier. Rated for operation up to 9.2V, and can deliver up to 8.5W into a 4-ohm load at 8.5V or 3W into a 4-ohm load at 5V. When powered from 6V, the maximum power would only be just over 3W at 1% THD according to a graph in the Chinese-language datasheet, which is probably why the Argos listing says it only has an output power of 3W despite the speaker being rated for 5W.

MT7601 Wi-Fi chip - commonly found in cheap Wi-Fi dongles, and probably selected for availability of Linux drivers. There is no Ethernet port on this set, which keeps the price down, but can result in reception being wiped out if the microwave is used in the kitchen (a common location to deploy a radio like this).

Bluetooth receiver - Beken BK8000 (under the sticker). This chip is commonly used on those Bluetooth-to-3.5mm modules which can be found on Aliexpress for next to nothing. Some of those Aliexpress modules look identical to the module in this radio. The module features a flash chip with a quarter of the capacity of the main processor's flash chip! All the audio decoding is done inside the BK8000, so the main processor just drives the module with some GPIO and presumably routes the audio to the speaker via the SC2314.

Speaker - 5W. This rather hefty speaker is not hi-fi quality but it's much better than that which would typically be found in an entry-level DAB/FM radio or even some entry-level boomboxes and the sound quality is quite reasonable for such a cheap set. I don't have a proper sound level meter so I can only give approximations of the frequency range, but when connected to a phone running a signal generator app via Bluetooth, the volume started to drop off below 80Hz and nothing was heard below 50Hz. At the high end, it sounded fine up to at least 9kHz.

Insertomatic 6000 Part 4: Finishing up

Summary of the Insertomatic 6000 The Insertomatic 6000 is a device which generates six analogue TV channels for distribution around a domes...