MAKER: Chen Liang / Translation: Qu Wu
This mini retro television is very compact and cute. Will it become your new desk pet? It cannot receive analog television broadcast signals, but it can play video tapes through a micro SD card. You can prepare several sets of SD cards to play your favorite shows.
This project is an improvement based on my previous project “Building a Video Player with ESP32”. More details on the construction can be viewed by clicking the link!https://www.instructables.com/Play-Video-With-ESP32/
Building Ideas
1. CRT Attributes This retro television has a cathode ray tube (CRT) display. It is a large vacuum glass tube that emits an electron beam onto a phosphorescent screen to display images.
Thus, this retro television has some special attributes: the aspect ratio is square (but actually round), the display is rounded, and the casing is thick and heavy.
Finally, I chose a 7:6 rounded LCD to create this mini retro television.
The thick and heavy casing can accommodate all the complex components. More details can be viewed by clicking the link. https://en.wikipedia.org/wiki/Cathode-ray_tube
2. Standards for Analog Television Formats In reality, there are many standards for analog television video, I chose a well-known digital format (VCD) as a reference. The VCD NTSC format is 240p (240 horizontal lines) and approximately 30 frames per second (fps). So this project plays 240p video at 30 fps.
The broadcast audio sample rate is 44.1 or 48 KHz mono. Since most video sources on the internet are 44.1 KHz, I chose 44.1 KHz to avoid unnecessary sample rate conversion distortion.
More details can be viewed by clicking the link. https://en.wikipedia.org/wiki/Video_CD https://www.thebroadcastbridge.com/content/entry/11502/broadcast-for-it-part-15-digital-audio
Designing the Shell
As shown in the picture, the gray rounded screen frame on the LCD makes it look more like a CRT screen.
On the right side of the front panel is the MicroSD card slot and the analog tape slot. There is no space to install speakers on the front panel, so I placed a full-range audio speaker at the bottom. The ESP32 development board is installed on the top, with space reserved for LCD wiring on the left side, and the back panel has a USB port and a power switch.
The iconic bottom support of the retro television design includes 3 built-in legs to support the TV. Due to the 45-degree rule of 3D printing, they cannot be too long.
Design documents and 3D printing files can be downloaded from the project file library https://make.quwj.com/project/443
Fusion 360: https://a360.co/3zdd511 https://www.thingiverse.com/thing:5400343
Software Part
1. Software Library Please download and install Arduino IDE: https://www.arduino.cc/en/main/software
For ESP32 support, please follow the Arduino-ESP32 installation guide to add ESP32 support. https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
The Arduino_GFX library can be installed by selecting Tools -> Menu -> Library Manager in the Arduino IDE. Search for “GFX for Various Displays” and then install it.
For more information on Arduino_GFX, please click the link to view. https://www.instructables.com/ArduinoGFX/
JPEGDEC can be installed by selecting Tools -> Menu -> Library Manager in the Arduino IDE. Search for “JPEGDEC” and install it.
The arduino-libhelix project uses Helix decoder to play AAC or MP3 audio. Download the arduino-libhelix library and import it into Arduino IDE: https://github.com/pschatzmann/arduino-libhelix.git
For how to import libraries into Arduino IDE, please click the link to view. https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries
2. Software Design
ESP32 is dual-core and can run on FreeRTOS, so it can run multiple tasks simultaneously. https://www.freertos.org/
Playing video is a relatively heavy load for microcontrollers, so it needs to allocate its processing power well. After subsequent tests, the heaviest load is MJPEG decoding, so this task is dedicated to Core 0.
All other processes run on Core 1, including: reading audio files, decoding audio, queuing decoded audio to I2S, reading video files, and drawing the decoded video display.
3. Burning the Program The program can be uploaded before connecting the components. Therefore, you can check whether it is suitable for each component connection. The entire process is:
Download the MiniTV source code from GitHub: https://github.com/moononournation/MiniTV.git
Open MJPEG_2task_Audio_1task.ino in Arduino IDE, connect the TTGO T7 development board, select Tools -> Board -> ESP32 Arduino -> ESP32 Development Module, select Tools -> PSRAM -> Disable, select Tools -> Port -> [Select Port for Board Connection], press the upload button, and finally wait for the compilation upload to succeed.
4. Converting Video Prepare the video to be played, then convert it to MJPEG video and AAC audio. The script assumes the 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.mjpegffmpeg -i input.mp4 -ar 44100 -ac 1 -ab 24k -filter:a loudnorm -filter:a "volume=-5dB" 44100.aac
FFmpeg: https://ffmpeg.org/
Points to note: The display resolution is 280 x 240, as the MJPEG format favors sizes divisible by 16, so it can be expanded to 288 x 240. You can adjust the volume by changing the “-5dB” value.
Processing the MicroSD Card
1. MicroSD Card Instructions In previous posts, the speed of SD cards running on ESP32 has been tested, and the ESP32 can only read SD cards at a speed of about 2MB per second. MicroSD is rated at four classes and can meet the requirements. Faster cards do not help improve performance.
Specific details can be viewed in another project. https://www.instructables.com/Select-SD-Interface-for-ESP32/
2. SD Card Connection
Previously, I found that the ESP32 SD_MMC 4-bit mode reads SD card data the fastest. However, with the latest version of the Arduino-ESP32 SD_MMC library, it has become very unstable and incompatible with most SD cards. Therefore, this project reverted to the standard Arduino-compatible SD library.
Adjusting Audio Gain Level Settings (Optional)
The rated power of the 24 mm full-range audio speaker is 2-4W, and the MAX98357 audio board can support up to 3.2W output, so the speaker can output the maximum gain setting of the audio board.But we need to reasonably set the volume of the television. I think setting it to a 3dB gain level would be better.
Power Distribution
The TTGO T7 development board can be powered via USB or connected to a lithium battery for wireless power, so other components can draw power from the development board.
However, the development board only has one 3v3 pin header, so it needs a small pin separator to create power pins.
Battery Power Supply (Optional)
The TTGO T7 development board can have a built-in lithium battery holder for Lipo charging. Therefore, you can add a Lipo that can be mounted below the development board in the television. Theoretically, a 600mAh Lipo can last about 1-2 hours. The video above shows the battery can play for 44 minutes without any issues.
Micro SD Card Insertion Switch (Optional)
Adding a Micro SD card insertion switch requires some soldering skills.
Most micro SD card slot breakout boards cannot disconnect the insertion detection switch, so you need to disconnect it manually. Then connect it to the TTGO T7 power switch. This way, as soon as you insert or remove the micro SD card, the television will automatically turn on or off.
Last century, when we put rental discs into the VCR, we could watch movies on the sofa. So I designed this optional Micro SD card insertion switch to recreate that feeling (exposing my age).
Connection Method
As shown in the picture, the connection method.
TTGO T7 ESP32 ST7789 LCD MAX98357 Audio SD Card Slot============= ========== ============== ============VCC -> VCC -> VCC -> VCCGND -> GND -> GND -> GNDGPIO 4 -> MISOGPIO 5 -> CSGPIO 13 -> CSGPIO 14 -> SCKGPIO 15 -> MOSIGPIO 18 -> CLKGPIO 22 -> BLKGPIO 23 -> SDAGPIO 25 -> BCLK/SCLKGPIO 26 -> LRCLK/LRCKGPIO 27 -> DCGPIO 32 -> DOUTGPIO 33 -> RST
If you want to try using SD_MMC, the SD card MISO needs to connect to GPIO2, but remember to disconnect GPIO2 when uploading the program.
If the audio output is too noisy, it may be that the 3v3 power supply is not enough for MAX98357, consider changing the MAX98357 power supply to 5v.
Specific details can refer to: https://github.com/LilyGO/ESP32-MINI-32-V1.3
Assembly
As shown in the picture, the internal wiring is very complex. This project not only mimics the appearance of a retro television but also imitates the clumsy wiring inside.
It can be imagined that this retro television is not light. This 1.69-inch mini television weighs 78g. Proportionally, a 25-inch television would weigh 252 kg. It is much heavier than a real CRT television! Moreover, the real CRT television does not have a built-in battery.
I really like the appearance of the Apple iMac Flower Power series CRT devices, so I copied these floral patterns onto my mini retro television. Isn’t it very pleasing to the eye?
The code used in the project can be downloaded from the project file library: https://make.quwj.com/project/443
via instructables.com/Mini-Retro-TV/
The links in the text can be clicked to read the original text at the end
More exciting content