BATC Video Source

From BATC Wiki
Jump to navigation Jump to search

The BATC Video Source, based on a Raspberry Pi Zero or later models (but not the Raspberry Pi 4), was published in CQ-TV 270.

It was based on an earlier (now unsupported) version by G4EWJ described here: RPi Test Card.


Using a Raspberry Pi 1, 2 or 3, or a Pi Zero or a Pi Zero W, this video source will output a PAL static test card, or a test card with a moving banner and bouncing balls, from the composite video output. Test card F can be overlayed with a programmable callsign. Additionally, a Contest Card is available.

If a Raspberry Pi Camera is connected, it can output a picture from the camera with a callsign overlay.

It is not designed to output an HDMI signal. It will not work on a Raspberry Pi 4.

The test cards shown below are selected sequentially on each press of the push button. Closing the switch selects the camera. A long press (> 2 seconds) of the push button shuts the Raspberry Pi down safely. On shutdown, the last selection is saved and used at the next power-up.

1 Montage.jpg

Hardware Design

The design is really simple. All that is required is a Power Supply, a push-button and a video output socket. If you want the camera capability, then you need a camera and a single pole toggle switch as well. You can conduct initial testing without the push-button and switch.

2 Wiring.PNG

The wiring is shown above. Some points to note for the Raspberry Pi Zero:

- Unusually, the ground of the video output is a circular PCB connection (actually Pin 2 of the connector) while the square land (pin 1) is the video output.

- The Raspberry Pi Zero, as supplied, has no pins on the headers, so you can either solder directly to the PCB, or fit header pins.

- If using a camera, you will need a special camera ribbon cable for the Raspberry Pi Zero, as the camera connector is smaller than the standard Raspberry Pi camera connectors.

The same wiring arrangement works equally well for Raspberry Pi Zero W, or the full size Raspberry Pi 1, 2 or 3. The video output connector on a Raspberry Pi 1 is a phono socket, whereas it is a 4-terminal 3.5mm jack on the more recent Raspberry Pis.


The software needs to be written to the SD Card using a PC. You can then customise it with your own callsign on the PC before fitting the card to the Raspberry Pi Zero. A full system image is available on GitHub here:

Download and unzip; the unzipped file is vidsource.img. Write this image to an SD Card (size 4GB or greater) using Win32DiskImager.

Once the image is on the card, open Windows Explorer and find the SD card volume which will be called boot. There should be a folder in that volume called testcard. There are 3 files to edit in that folder: callsign.txt, where you should replace “BATC” with your callsign; locator.txt, where you should replace “IO90LU” with your locator, and numbers.txt, where you should enter contest numbers that you might like to use. In each case save the changes once made.

You can change these files (for example to put in a portable callsign or locator) between uses as many times as you like and the static test cards and camera overlay will be amended the next time you start the card up. The banner text is more complex, and you will need to directly edit the last line of tcdata1.txt and tcdata2.txt with any revised banner text.

If you want to edit the files on a network-connected Raspberry Pi, you will find them in the folder /boot/testcard/. You should use commands of the form “sudo nano /boot/testcard/callsign.txt” to edit them as they are owned by the root user.

It is possible to build your own card using the instructions on the GitHub site; the procedure is similar to building a Portsdown or a Ryde SD Card. However, there is no update process. Future updates will simply require a new card to be built.

Advanced Usage Notes

All the files used to customise the display are in the folder /boot/testcard. This folder can be accessed directly on the card if you log in by SSH on a network-connected Raspberry Pi (not a Pi Zero on its own), or as the boot volume if you read the card on a Windows PC. The files are owned by root, so the use of sudo is required to edit them by ssh.

On start-up, if the previous banner text on the second and third slides include the text "BATC" or "IO90LU", the callsign.txt and locator.txt files are read and the banners are changed to "callsign at locator". This enables all the callsigns on the card to be initialised simply by setting the callsign.txt file correctly.

Also on start-up, the text in "callsign.txt" is convereted to an image and superimposed on the Test Card F used in the first slide. The same text is also stored for use as a camera caption.

Inserting New Images

Additional image files without a banner should be 720x576 .jpg files, and those for use with a banner should be 640x480. Each image needs to be accompanied by a text file named in sequence like tcdata10.txt and containing:


The number in the filename determines the sequence that the card is displayed in; for example the card specified in tcdata10.txt will be displayed in the 10th button push after the first card.

The first line must be tcprog.
The second line is the filename of the .jpg image to be displayed, without the .jpg extension.
The third line is the x displacement of the bottom left of the card.  This should be 40 for cards with a banner and 0 for cards filling the screen.
The fourth line is the y displacement of the bottom left of the card.  This should be 52 for cards with a banner and 0 for cards filling the screen.
The fifth line is the text for the "bubbles".  A maximum of 5 characters.  Some special characters such as "-/P-" can be displayed (try it).
The sixth line is the text for the scrolling banner.

Be careful to edit the file in a true text editor. Microsoft Word and Wordpad introduce special characters that will cause the file to not work. Use Notepad, or Notepad++.

Current Consumption

Current consumption of a Raspberry Pi Zero running the test card is about 150 mA, which increaes to 190 mA if the camera is selected.


Assembly of Video Source projects are covered in this topic.

Using an EBay £9 tripod ( with its 1/4" UNC mounting thread) to finish the project (M0YDH)
The video source shown fitted in a diecast box (M0YDH)