Train Scene Decoration



This instructables show how to use a tiny screen dev device build a train scene decoration that have moving window views.
Supplies
日本の車窓から
The trawin.com is a special site of scenery from Japanese railway train windows. It just likes travel in Japan while viewing. How about if you can looping the video on your desk? It is even better if adding a Japanese theme frame on it!
The Japanese animated fantasy film 《Spirited away》, 千と千尋の神隠し, is one of my favor animation. This project will use this theme as an example. You can simply use your favor theme instead.
Playing Train Window View
A desktop decoration will not playing sound normally, so a dev board that can play MJPEG file is good enough.
The video in train.com is around 1 hours, it requires a microSD card to store the sub-gigabytes size MJPEG file.
Waveshare ESP32-C6-LCD-1.47 is a tiny dev board that have a high resolution (172x320) screen, at the same time it built-in a microSD card slot. It is very suitable for this project.
Software Preparation
Arduino IDE
Download and install Arduino IDE latest 1.x version if not yet:
https://www.arduino.cc/en/software
Arduino-ESP32
Follow installation step to add Arduino-ESP32 support if not yet:
https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
Arduino_GFX Library
Open Arduino IDE Library Manager by selecting "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.
Dev Device Pins
Open Arduino IDE Library Manager by selecting "Tools" menu -> "Manager Libraries...". Search "Dev Device Pins" and press "install" button.
JPEGDEC
Open Arduino IDE Library Manager by selecting "Tools" menu -> "Manager Libraries...". Search "JPEGDEC" and press "install" button.
Prepare MJPEG File
After you selected and grab the train window video to local, you need convert it to MJPEG file.
Here are the sample convert command:
Since my theme have a higher window, so I first resize it a little bit bigger that the screen, then crop the upper part.
Ref.:
Source Code
Please download the MiniTV source code at GitHub:
Program

- Open MJPEG_callback.ino in Arduino IDE
- Set the board parameters as above picture
- Press Upload button and wait compile and upload finish
Test Play

Copy the prepared MJPEG file to microSD card and plugin to the dev board to test play.
Print Theme Picture

The screen viewable size is around 32mm x 17mm. The theme picture should have a train window a little bit small than this.
Cutout Window

After print out the theme, use art knife cutout the window. If it is too small to cutout all details, keep some blue sky details on it is ok.
Assembly

I use a tiny acrylic stand to support the picture. This stand also can help me fix the screen behind the window, but as show in the video, it needs some patching first.
Optional Power Pins

My selected acrylic stand is too tiny, it cannot hide the USB plug behind it. So I soldering the 5V power pin headers, so I can hide the power wire behind the stand.
Enjoy!

Now you just like traveling in Japan while you sit at the desk.
Note:
If you search "Train Window View", you can find more railway video in other countries. Then you can have more combination, e.g. Harry Potter train scene in a London train, The Girl On The Train, or even Spider man at Forest Hills...