keepcalculator

06 Numbers and Powers

Display Images on Analog TV with Arduino

Card No. 06·80931 · Updated · Standard formula, shown below

This guide shows you how to display a still image on an old analog television using an Arduino and a few common components. You’ll send a composite video signal from the Arduino’s pins, and with the right library and a simple circuit, your TV will show a black-and-white picture. No specialized video shield is required—just a resistor, a wire, and the TV’s composite or antenna input.

What You’ll Need

  • Arduino board (Uno, Nano, or similar)
  • Analog TV with composite (RCA) input, or one with an antenna input if you use a modulator
  • RCA cable or a male RCA connector
  • Breadboard and jumper wires
  • Resistor: 470 Ω (for most Arduinos, to protect the pin)
  • Optional: 75 Ω resistor for impedance matching (improves signal quality)
  • USB cable to program the Arduino
  • Computer with Arduino IDE installed

Step-by-Step

  1. Understand the signal: Analog TV uses a composite video signal with specific timing. The Arduino will generate this signal in software, using a timer interrupt to output the sync pulses and pixel data. The result is a black-and-white image with a resolution of about 128×96 pixels.
  2. Prepare the image: Choose a simple black-and-white image. Convert it to a format the Arduino can use—typically a byte array where each bit represents a pixel. You can use a tool like “Image2Code” (online) or write a script to convert a BMP or PNG to a C array. For a 128×96 image, you’ll need 128*96/8 = 1536 bytes. Keep the image simple (high contrast) for best results.
  3. Install the library: In the Arduino IDE, go to Sketch > Include Library > Manage Libraries. Search for “TVout” and install the library by “Tursi”. This library handles the video signal generation.
  4. Wire the circuit: Connect a wire from Arduino pin 9 (or pin 7 on some boards—check the library docs) to the center pin of the RCA connector. Connect a 470 Ω resistor in series with this wire (from the pin to the RCA center). Connect the RCA outer shield to the Arduino’s ground. If you have a 75 Ω resistor, connect it between the RCA center and ground (this is optional but improves signal quality).
  5. Connect to TV: Plug the RCA cable into the TV’s composite input (usually yellow). If your TV only has an antenna input, you’ll need an RF modulator that converts composite to channel 3/4. Set the TV to the correct input or channel.
  6. Write the sketch: Open a new sketch in Arduino IDE. Include the TVout library and the image header file (if you have one). Initialize the TV object, begin the video signal, and then use tv.bitmap() to draw the image. A basic example:
    #include <TVout.h>
    #include <video_graphics.h>
    TVout TV;
    
    void setup() {
      TV.begin(NTSC, 128, 96); // or PAL
      TV.bitmap(0, 0, myImage); // myImage is a byte array
    }
    
    void loop() {
      // nothing needed
    }

    Replace myImage with your image array.

  7. Upload and test: Connect the Arduino to your computer, select the correct board and port, and upload the sketch. You should see the image on the TV. If not, check the wiring and the TV input.

Common Mistakes

  • Wrong pin: The TVout library uses specific pins for video output. On the Uno, it’s pin 9 by default. Using another pin will not work.
  • Missing ground connection: The TV and Arduino must share a common ground. Without it, the signal will be noisy or absent.
  • Incorrect image format: The image array must be in the exact format expected by the library: each byte contains 8 pixels, with the most significant bit representing the leftmost pixel. If your conversion is off, the image will be garbled.
  • TV set to wrong input: Make sure the TV is on the correct composite input. Many TVs have multiple inputs; check the remote or the TV’s source button.
  • Using a high-resolution image: The Arduino has limited memory. A 128×96 image uses about 1.5 KB. Larger images may not fit in the Arduino’s RAM (Uno has 2 KB). Stick to the supported resolution.

Tips

  • Use a separate power supply: If the TV and Arduino are powered from different outlets, there might be a ground loop. Using the same power strip or a common ground helps.
  • Keep wires short: Long wires act as antennas and can pick up noise. Keep the video wire as short as possible.
  • Test with a simple pattern first: Use the library’s built-in test pattern (e.g., TV.fillScreen(WHITE)) to verify the circuit before displaying a complex image.
  • Use a regulated 5V supply: A stable power supply prevents glitches in the video signal. Avoid powering the Arduino from the TV’s USB port if it’s noisy.
  • Consider a video shield: If you need color or higher resolution, look into dedicated video shields that handle the signal in hardware.

Troubleshooting

  • No picture at all: Check the wiring: the video pin must go to the center of the RCA, ground to the shield. Verify the TV is on the correct input. Try a different RCA cable. Also, ensure the Arduino is running (LED blinks).
  • Flickering or rolling picture: This usually indicates a sync issue. Make sure you’re using the correct video standard (NTSC vs PAL) for your region. Also, check the resistor value—too high can weaken the signal.
  • Garbled image: The image data might be misaligned. Double-check the image conversion: the array must be in row-major order, and each row must be a multiple of 8 pixels. Also, ensure the image dimensions match the TV.begin() call.
  • Black and white only: This is expected—the TVout library only outputs monochrome. If you need color, you’ll need a different approach.
  • TV shows “No Signal”: The Arduino might not be outputting a signal. Check that the library is properly installed and that the sketch compiles. Try the test pattern code.

Frequently Asked Questions

Can I display a color image?

No, the TVout library only supports black-and-white (monochrome) output. To get color, you would need a more complex circuit or a dedicated video shield that generates color composite signals.

What is the maximum resolution I can use?

The TVout library supports up to 128×96 pixels on an NTSC TV. On PAL, you can go up to 160×100. However, the Arduino’s memory (2 KB on Uno) limits the image size. For a 128×96 image, you use about 1.5 KB, leaving little room for other data.

Why do I need a resistor?

The resistor protects the Arduino pin from overcurrent and also helps match the impedance of the TV input (75 Ω). The 470 Ω resistor is a safe value for most Arduinos. Without it, the pin could be damaged.

Can I use an Arduino Mega?

Yes, the TVout library works with the Mega. However, the pin for video output may be different—check the library documentation. The Mega has more memory, so you could display larger images if you modify the library.

How do I convert an image to a byte array?

You can use online tools like “Image2Code” or “Convert Image to C Array”. Upload your image, set the width and height, choose “Arduino” format, and download the header file. Alternatively, write a Python script using PIL to convert the image.

Can I display text as well?

Yes, the TVout library includes functions like tv.print() to display text. You can combine text and images on the same screen.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →