Introduction: Enclosure for Your TTGO T-Display Project

Over Christmas break I began obsessing about how to put "It's a Wonderful Life" movie clips on a TTGO T-Display board. The TTGO T-Display is a really nice little Arduino compatible board with a tiny full color TFT LCD display (240 X 135 pixels), a dual core ESP32, up 16MB flash memory and a Lipo charger built in. You can get them off Amazon or Banggood or AliExpress. Depending on the sale, they will set you back anywhere from about $13 to $20.

https://www.banggood.com/TTGO-T-Display-ESP32-CP2104-CH340K-CH9102F-WiFi-bluetooth-Module-1_14-Inch-LCD-Development-Board-LILYGO-for-Arduino-products-that-work-with-official-Arduino-boards-p-1522925.html?cur_warehouse=CN&ID=6309998&utm_design=18&utm_email=1640645561_2332&utm_source=emarsys&utm_medium=Neworder171109&utm_campaign=trigger-order&utm_content=linux&sc_src=email_2675773&sc_eh=22b56abe6b91fc2b1&sc_llid=36343881&sc_lid=105229698&sc_uid=oZwnDido9u

https://www.aliexpress.com/item/33050667207.html?spm=a2g0o.cart.0.0.7c6b3c003hF32c&mp=1

Well I got the software running using the Arduino IDE and Bodmer's fantastic TFT_eSPI and Tjpg_Decoder libraries and some SPIFFs manipulation. (If there is enough interest, I will write that up also.) In fact, most of the software is based on Bodmer's SPIFF+JPG example program.

As part of that I designed this little retro TV housing that I thought might be of interest to others working with the TTGO T-Display. It is 5 pieces including two buttons. I have included the SolidWorks files also in case people would like to manipulate the design.

I designed it so that all parts will print flat with a minimum of support material. Note that I have two versions of the front face part. My printer had a very difficult time making the holes for the front buttons. I made a second version that printed small holes that I could then drill out to allow the buttons to fit well.

Supplies

For the housing itself, all you need is your trusty 3D printer. I printed my pieces with my Qidi X-Smart FDM printer. But this should work fine with an SLA printer also.

Note that the housing is meant to be glued together.

Step 1: Print It and Assemble

Not much here. Add the STLs to your favorite slicer and print them. NOTE: you will need two buttons. I used 100% infill because of the thin layers. I assembled as follows:

  1. Clean and lightly sand all parts. Do a dry fit to make sure all pieces fit together.
  2. Insert the TTGO T-Display into the middle part, USB-C port first. Take care that the reset button fits in the slot in the case. Gently push the board into place so that the LCD fits into the cut out for it flush. BE GENTLE! Scrape or sand inside ledges so that the board slips in with a minimum of friction. A spot of super glue on the antenna end of the T-Display will hold it nicely in place.
  3. Add the two buttons to the front piece. Now we glue the front piece to the part holding the T-Display. Put just enough superglue on the middle section to glue the front piece on but not enough to get on the LCD or buttons.
  4. Align the edges of the two parts and press and hold them so that the superglue sets up.
  5. Attach the Lipo battery to the back sie of the T-Display board. The one in the photo is a 200mAh version with a built in protection circuit. Make sure your circuit is working.
  6. Snap the back part on. You can hold it on with tape or when everything is working to your liking, a few drops of superglue to the lip and press it together.

AND FINALLY: One of the reasons for this, was this beautiful project video:

https://www.youtube.com/watch?v=zJxyTgLjIB8

https://www.reddit.com/r/esp32/comments/rhwjk0/i_made_an_esp32powered_christmas_ornament/

Here is the cheap SLA service that the author uses.

https://jlcpcb.com/3d-printing

Step 2: Software Discussion

It has been almost a year since I did this project and I am trying to reconstruct how I finally got the frames loaded and the program to run. This was all done under Arduino 1.8.15.

I believe the important part of the loading of the SPIFFS file was the selection of 16MB and the Rainmaker partition. See ArduinoSetUp.jpg. All of the 576 frames are 240x135 and average about 12000 bytes which is only around 7MB total, but there were things that blocked me from using more of the FLASH memory... which I don't recall right now.

I think the my problem lay in getting the partition of the FLASH memory correct that would allow me to use more data. This looks like an excellent tutorial on getting the partition size you need for storing image data:

https://iotespresso.com/how-to-set-partitions-in-esp32/

I may have altered my RainMaker partition definition to give me even more storage for image frames. I don't remember but this is worth looking into.

This is a good article about using SPIFFs for data storage:

https://randomnerdtutorials.com/install-esp32-filesystem-uploader-arduino-ide/

The above article will show you how to install the ESP32 Sketch Data Upload in your Arduino environment. You will use the Sketch Data Upload to install your image data onto the TTGO T-Display board. Another great video describing instally and using the Sketch Data Upload tool:

https://www.youtube.com/watch?v=ZwSQzpiaszo

This is an interesting discussion of SPIFFS versus LittleFS. LittleFS has higher performance but is more resource intensive. I think I would stick to SPIFFS for this kind of application given the number of image files required to show a video:

https://github.com/RalphBacon/203-SPIFFS-vs-LITTLEFS

"Espressif state: "SPIFFS is the original filesystem and is ideal for space and RAM constrained applications that utilize many small files and care about static and dynamic wear levelling and don’t need true directory support. Filesystem overhead on the flash is minimal as well.""

LittleFS add ~4KB per file versus SPIFFs which adds 256 bytes.

As I recall I started out with more JPG image frames then would fit (the Sketch Data Upload would fail). I would then delete a number of files from the end of the list and try again. I ended up with my last file being wl01726.jpg and set that as the terminating number in the Arduino program.

Note that the number of frames you can display (the length of the video clip) is directly related to the flash memory size on your TTGO T-DIsplay, the SPIFFS partition size and the video size chosen (you can use smaller than 240 x 135!).

Good luck and I hope this helps.

Step 3: Getting the Image Files

I used the program ShareX to create the video clip from "It's a Wonderful Life" and then the VLC media player program to create the 576 image JPG frames.

https://getsharex.com/

https://www.videolan.org/

The instructions for using VLC to clip frames to files can be found at:

https://www.youtube.com/watch?v=6dLFVXiM4QA

Change the file type to JPG (instead of PNG used in the video), set the size to 240 and 135 and I used every 3rd frame. Note the naming of the files. I used wlxxxxx.jpg and if you look at the Arduino INO file included, a lot of the program code in the loop section is just dedicated to creating the series of names of JPG files to load from SPIFFS to display.

Finally, there are a couple of alternative Tiny TV for sale now:

https://www.basicfun.com/ttvc/index.html

https://tinycircuits.com/products/tinytv-diy-kit

https://makezine.com/article/technology/arduino/tinycircuits-tiny-tv-2-is-a-teeny-televisual-triumph/

Anything Goes Contest 2021

Participated in the
Anything Goes Contest 2021