Shin-Yukari
  • Blog
  • Layout Description
  • Track Plan
  • LED Controller
  • Who am I?
  • Blog
  • Layout Description
  • Track Plan
  • LED Controller
  • Who am I?

​新ユーカリ駅

shin-yUkari station

N-gauge Japanese-style Model Train
​nゲージ鉄道模型

MODI Building (5)

12/1/2026

0 Comments

 
Next is the main display of the MODI building. I designed that part years ago and decided at that time to use a Raspberry Pi to drive the (relatively larger) 240x320 2.2” display. The advantage of using a Raspberry Pi is that they are much more powerful than microcontrollers like Arduinos. They can play mp4 / h.264 video at 30fps using very standard software. However, so far, I have avoided them in buildings because, as they are “full-fledged computers” running Linux, they need to be properly shut down before cutting the power off. This is annoying. On the layout, I have a main on-off switch and I want to be able to switch the power off at any time.

I have quickly tested an ESP32-based Arduino with that same display and I managed to make it work at 12fps (using the jpegdec library). The difference with 30fps is really noticeable. In addition, I’d have to add an external SD card module to store the video.

So I came back to the Raspberry Pi and found a solution to the shutdown issue: Make a Read-Only Raspberry Pi with the new Raspberry Pi Overlay File System. Read the details here: https://learn.adafruit.com/read-only-raspberry-pi/overview
Recent Raspberry Pi OS releases have an option to put the /boot partition (where the kernel image and other critical files reside) in a read-only mode. If software installed on this system only performs reading and playback operations, then we can just unplug the system when done without risk of corrupting the operating system’s files on the SD card. This is exactly what I need here.

This is a description of the setup I use in the MODI building
  • Raspberry Pi Zero W (the newest Raspberry Pi Zero 2 W would of course be even better) in headless mode (no keyboard / no monitor), access using SSH over WiFi only
  • 2.2” ILI9341-based TFT display, resolution 320x240
  • Raspberry Pi OS 3 / Kernel 4.19.118 based on Debian 10 Buster
  • mplayer software playing standard mp4 h.264 video files
  • Note: That solution is based on the obsolete fbtft_device, which is not supported on newer kernels. I’ll have to find a new driver in the future in order to support the latest revisions of the Raspberry Pi OS
  • “Vertical” video files are mostly found on TikTok, then cropped / resized using handbrake (https://handbrake.fr)

The Raspberry Pi (and the display) are powered by a local step-down DC-DC Buck Converter (https://www.aliexpress.com/item/1005007494413893.html), which provides a stable 5V power supply from the layout’s 12V supply.
Picture
Fitting the display to the frame of the building is a challenge. I have unglued the display from its control PCB (red in the photo below), but the flat cable connecting both is short and fragile. The display can only be placed a few millimetres (less than 10) from the PCB. I made rough 3D models of the display and its control PCB so that I could design a suitable slot for a display in the building’s frame. The control PCB is glued right behind the display, and the Raspberry Pi is attached to the other side of the building.
0 Comments



Leave a Reply.

    Categories

    All
    3D Printing
    Buildings
    DCC
    Electronics
    Kato
    Portram
    Rocrail
    Scenery
    Tomix
    Tomytec
    Tomytec Bus System

    Latest recap videos

    Archives

    January 2026
    December 2025
    November 2025
    September 2025
    August 2025
    July 2025
    May 2025
    January 2025
    December 2024
    September 2024
    August 2024
    April 2024
    March 2024
    February 2024
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    January 2021
    September 2020
    August 2020
    July 2020
    June 2020
    April 2020
    March 2020
    February 2020
    January 2020
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    October 2017
    July 2017
    November 2016
    October 2016
    August 2016
    March 2016
    September 2015

    RSS Feed

Powered by Create your own unique website with customizable templates.