Learn how to connect an Arduino to a TV to display text, information, and graphics!
The Arduino can be connected to many devices including sensors, electromechanical parts, and even simple displays. But imagine if you could connect an Arduino to a TV and use it to display text, information, and even crude graphics! In this Maker Pro project, we will do just that!
How it Works: Composite TV Signals
Composite TV signals are rather complex and confusing, so we will only look at the basics. It should also be noted that we will only be considering PAL and not NTSC since the two have slightly different timings, and I live in Europe, which uses PAL.
The rate at which TVs show a series of images to form a moving picture is called frames per second (also known as FPS). Since each frame is a still image and these images on a TV are drawn line by line, images are sent to a TV serially, with each pixel sent one at a time. But if the image line is serial data, how is brightness determined? Unlike a digital serial connection, PAL signals are analog and the voltage on the serial line determines how bright a pixel is. The graph below shows a PAL graph and what different voltages indicate.
If the input signal is 0V, then the TV sees this as a synchronizing signal. Depending on how the synchronous signal is done, it can be used to tell the TV one of two things:
- Horizontal sync – Get ready to display the next line in our picture
- Vertical sync – Get ready for a whole new image
Voltage between 0.3V and 1V are image pixels where 0.3V represents a black pixel, 1V represents a white pixel, and voltages in between are gray. Color pixels will not be covered, since color is very complex using phase shifting and color burst signals. So how can we achieve these voltage levels if we do not have an analog output on the Uno? This is where our two external resistors come in!
The Arduino Uno, when used in conjunction with the TV Out library, have two pins: video and sync. The video pin is used to transmit video data (individual pixels), while the sync pin is used to synchronize the TV. These two pins are connected together via R1 and R2, which form a simple potential divider that gives the following voltage levels.
How to Install the TV Output Library
Start by loading the Arduino IDE, then click Sketch > Include Library > Manage Libraries.
In the library window that opens, select the search bar and type “TV Text”.
When the search is complete, select the TV Text library and click “install”.
The last step will involve opening the built-in example so we can test it out. Start by clicking File > Examples > TV Out > Demo PAL.
This project takes advantage of a breadboard to help connect the Arduino Uno to the two resistors and the composite video cable. The Arduino is connected to the host PC for easy programming as well as providing power, and once the setup has been done (as shown below), you can program the Arduino and turn on your TV.
If all goes to plan, you should have something similar to the TV screen shown below.