Mini Retro TV

by 陳亮 in Circuits > Arduino

34037 Views, 152 Favorites, 0 Comments

Mini Retro TV

DSCN0615副本.JPG
Mini Retro TV Demo

This instructables show how to make a mini retro TV.

Note:

This TV cannot receive analog TV broadcast signal but can play mini video tape (micro SD card).

Supplies

Below list only provide the searching keyword and product image, you may buy the components with your familiar shop:

Previous PoC

DSC03810.jpg

This project is base on the previous PoC project: Play Video With ESP32, you may find more basic details there.

CRT Attributes

Retro TV display with a Cathode-ray tube (CRT). It is a big vacuum glass tube that emit electron beams to a phosphorescent screen to display image. It makes retro TV have some attributes:

  • Aspect ratio nearly like a square (actually a circle)
  • Rounded corner
  • Thick and bulky

So I selected a 7:6 rounded corner LCD to build this mini retro TV.

Thanks to the bulky case, I can squeeze all the sophisticated components in it.

Ref.:

https://en.wikipedia.org/wiki/Cathode-ray_tube

Analog TV Format Standard

There are various analog TV video standard, I will refer the first well known digitalize format (VCD) as a reference. VCD NTSC format is 240p (240 horizontal lines) with around 30 frames per second (fps). So this project target is playing 240p video in 30 fps.

The broadcast audio sample rate is 44.1 or 48 KHz single channel, since most video source on the web is in 44.1 KHz so I selected 44.1 KHz to avoid unnecessary sample rate conversion distortion.

Ref.:

https://en.wikipedia.org/wiki/Video_CD

https://www.thebroadcastbridge.com/content/entry/11502/broadcast-for-it-part-15-digital-audio

Case Design

螢幕截圖 2022-06-02 18.01.02.png
  • A grey rounded corner screen frame on the LCD make it looks more like a CRT screen
  • Front panel right side is a MicroSD card slot imitate a video tape slot
  • Front panel no room fit a speaker so I put the full range audio speaker at the bottom
  • The ESP32 dev board mounted at the top
  • Left side reserved room for LCD breakout wires
  • Back panel has the USB port and power switch
  • Retro TV also have a signature long shaped legs, so this design also built 3 legs to support the TV. Limited by 3D printing 45 degree rule, I cannot make it too long but I think it is enough to present this signature.

I have uploaded the design to Fusion 360: https://a360.co/3zdd511

3D Printing

Download and 3D print all parts at Thingiverse: https://www.thingiverse.com/thing:5400343

Software Preparation

Arduino IDE

Download and install Arduino IDE latest 1.x version if you are not yet do it:

https://www.arduino.cc/en/main/software

ESP32 support

Please follow the Arduino-ESP32 install guide to add ESP32 support if not yet do it.

Arduino_GFX Library

Open Arduino IDE Library Manager by select "Tools" menu -> "Manager Libraries...". Search "GFX for various displays" and press "install" button.

You may refer my previous instructables for more information about Arduino_GFX.

JPEGDEC

Open Arduino IDE Library Manager by select "Tools" menu -> "Manager Libraries...". Search "JPEGDEC" and press "install" button.

arduino-libhelix

This project use Helix decoder for playing AAC or MP3 audio. Download and import the arduino-libhelix library to Arduino IDE:

https://github.com/pschatzmann/arduino-libhelix.git

You may refer to Arduino Documentation for the details on how to import library to Arduino IDE

Software Desgin

IMG_2567.jpg

ESP32 have 2 cores and run on top of FreeRTOS, so it can run multitask simultaneously.

Playing video is heavy loading for a microcontroller, so it should well planning the processing power allocation. After subsequent testing, the most heavy loading is the MJPEG decoding, so this task dedicate Core 0 to do the job. All other processes run on Core 1:

  • Read audio file
  • Decode audio
  • Enqueue decoded audio to I2S
  • Read video file
  • Draw decoded video to display

Upload Program

The program can upload at the early stage even before connect the components. So you can check is it work for each component connection.

  • Download the MiniTV source code at GitHub: https://github.com/moononournation/MiniTV.git
  • Open "MJPEG_2task_Audio_1task.ino" in Arduino IDE
  • Connect TTGO T7 dev board
  • Select Tools Menu -> Board -> ESP32 Arduino -> ESP32 Dev Module
  • Select Tools Menu -> PSRAM -> Disabled
  • Select Tools Menu -> Port -> [select the port dev board connect]
  • Press Upload Button
  • Wait compile and upload success

Convert Video

Prepare a video you want to play in the mini retro TV and convert to MJPEG video and AAC audio. Below script assume source video is "input.mp4":

ffmpeg -i input.mp4 -vf "fps=30,scale=-1:240:flags=lanczos,crop=288:in_h:(in_w-288)/2:0" -q:v 11 288_30fps.mjpeg
ffmpeg -i input.mp4 -ar 44100 -ac 1 -ab 24k -filter:a loudnorm -filter:a "volume=-5dB" 44100.aac

FFmpeg: https://ffmpeg.org

Note:

  • The display resolution is 280 x 240, but MJPEG format love the dimension that can divided by 16, so it is extended to 288 x 240.
  • You can adjust the audio volume by alter the "-5dB" value

MicroSD Card Requirements

IMG_2650.jpg

As previous benchmark test, ESP32 read SD card only can reach around 2MB per seconds. Recently most cheap MicroSD already rated at class 4 and can meet the requirement. Faster card cannot help improve the performance. The above cards I bought 10 in bulk and below USD1 each, it rated class 4 and tested no frame drop in 30 fps.

Ref.:

https://www.instructables.com/Select-SD-Interface-for-ESP32/

SD Card Connection

IMG_2341.jpg

Previously, I found ESP32 SD_MMC 4-bit mode is fastest for reading SD card data. However, with latest Arduino-ESP32 version, the SD_MMC library become very unstable and cannot compatible with most SD card. So this project is fall back to standard Arduino compatible SD library instead.

Optional: Adjust Audio Gain Level Setting

螢幕截圖 2022-05-31 08.20.08.png
DSCN0620.JPG
DSCN0621.JPG

The 24 mm full range audio speaker is rated 2-4 W and the MAX98357 audio board support up to 3.2 W output, so the speaker should capable output the audio board maximum gain setting. But we will not expect this tiny screen TV speak too loud, so I think setting to 3 dB gain level should be better.

Power Splitter

DSCN0372.JPG
DSCN0373.JPG
DSCN0374.JPG

TTGO T7 dev board can power up by USB and also can connect Lipo Battery for the unplugged power, so all other components can draw the power from the dev board.

But the dev board only have one 3v3 pin header, so it requires a little pin splitter replicate the power pins.

Optional: Battery Powered

Mini Retro TV battery powered play 44 minutes video stress test

TTGO T7 dev board have built-in Lipo battery socket, it can charge the Lipo and powered by the Lipo. You may add a Lipo in the TV that can fit under the dev board. Theoretically, a 600 mAh Lipo can last around 1-2 hours. the above video show the battery can play 44 minutes without any problems.

Optional: Micro SD Card Insert Switch

DSCN0616.JPG
DSCN0618.JPG
DSCN0619.JPG

This is an advance tricks and require some soldering skills.

Most micro SD card slot breakout board not broke out the insert detect switch, so you need break it out yourself. Then connect it to the TTGO T7 power switch. So that once you insert the micro SD card, the TV auto power on and turned off when you took out the card.

Seamless User Experience

I remember in last century, when I insert a video tape into the Video Tape Recorder/player (VCR), the VCR auto turned on and auto play if it is a read only tape (most likely rent from video rental shop). If it is a VCR TV combo appliance, the TV also auto turned on. That means once you rent a movie and back home, the only action you new to do is put the tape into the VCR TV combo. Then you can enjoy the movie in sofa.

This is the most seamless user experience I can enjoy in last century, but I cannot make it in 21 century ( ˘︹˘ )

So I designed this optional "Micro SD Card Insert Switch".

Connection Summary

IMG_2592.jpg
Mini Retro TV wire connection

Here are the connection summary:

TTGO T7 ESP32   ST7789 LCD   MAX98357 Audio   SD Card Slot
============= ========== ============== ============
VCC -> VCC -> VCC -> VCC
GND -> GND -> GND -> GND
GPIO 4 -> MISO
GPIO 5 -> CS
GPIO 13 -> CS
GPIO 14 -> SCK
GPIO 15 -> MOSI
GPIO 18 -> CLK
GPIO 22 -> BLK
GPIO 23 -> SDA
GPIO 25 -> BCLK/SCLK
GPIO 26 -> LRCLK/LRCK
GPIO 27 -> DC
GPIO 32 -> DOUT
GPIO 33 -> RST

Note:

  • SD card MISO requires connect to GPIO 2 if you want to try using SD_MMC, but remember disconnect GPIO 2 while uploading program.
  • If the audio output too much noise, it may caused by the 3v3 power source not enough for the MAX98357, you may consider change the MAX98357 power source to 5v.

Ref.:

https://github.com/LilyGO/ESP32-MINI-32-V1.3

Assembly

Mini Retro TV assembly steps

Imitate Clumsy Wires Inside

132040=25907-chassis1.jpg
DSCN0634.JPG

This project not only imitate a retro TV outside, it is also imitate the clumsy wires inside :P

Ref.:

https://www.radios-tv.co.uk/wp-content/uploads/wpforo/attachments/93/132040=25907-chassis1.jpg

Imitate Bulky Weight

IMG_2655.jpg

This 1.69" Mini TV 78 g in weight. In proportion, a 25" size will become: (25" / 1.69") ^ 3 * 0.078 kg ~= 252 kg. It weigh much more that a real CRT TV!!!!

Note:

Real CRT TV does not have built-in battery.

Enjoy!

DSCN0613.JPG

It's times to play!

Optional: Flower Power

DSCN0639.JPG
DSCN0638.JPG

The most beautiful CRT device I ever seen is Apple iMac Flower Power series. So I also want this Mini Retro TV decorate in flower pattern. That's why I print the case with matte white PLA material.