{"id":717,"date":"2026-10-29T14:33:34","date_gmt":"2026-10-29T05:33:34","guid":{"rendered":"https:\/\/vandermeij.familyds.com\/wordpress\/?page_id=717"},"modified":"2026-10-29T20:28:27","modified_gmt":"2026-10-29T11:28:27","slug":"train-controller","status":"publish","type":"page","link":"https:\/\/vandermeij.familyds.com\/wordpress\/?page_id=717","title":{"rendered":"Train Controller"},"content":{"rendered":"<p><a href=\"https:\/\/vandermeij.familyds.com\/portal\/projects.html\">\u2190 Family Portal: Projects<\/a><\/p>\n<h2 dir=\"ltr\"><strong>Why I built it<\/strong><\/h2>\n<p dir=\"ltr\">This project began with a friend whose model railway layout had an outdated control system. I had an old Raspberry Pi on hand, so I used it to build a new controller.<\/p>\n<h2 dir=\"ltr\"><strong>The layout<\/strong><\/h2>\n<p dir=\"ltr\">The layout has two tracks, an inner and an outer main line. Each track has a station with two platforms, reached through a turnout (switch). Two trains can run on one track.<\/p>\n<h2 dir=\"ltr\"><strong>How the trains run<\/strong><\/h2>\n<p dir=\"ltr\">One train waits at the station until the other has arrived. The controller then waits for the turnout to switch and accelerates the waiting train to its maximum speed. When a train approaches a platform, it slows down and comes to a stop.<\/p>\n<h2 dir=\"ltr\"><strong>Identifying the trains<\/strong><\/h2>\n<p dir=\"ltr\">A scanner built into the track identifies each train. A sticker with a code (a barcode or a QR code, which I am still testing) is on the underside of the train, where there is little space between the wheels. The controller looks up the passing train\u2019s characteristics in a database, so each train behaves realistically.<\/p>\n<h2 dir=\"ltr\"><strong>Detecting the position<\/strong><\/h2>\n<p dir=\"ltr\">The position of a train, which is needed for slowing down and stopping, is detected with IR dots (infrared sensors).<\/p>\n<p>In this project: <a href=\"https:\/\/vandermeij.familyds.com\/wordpress\/?page_id=720\">Hardware<\/a>, <a href=\"https:\/\/vandermeij.familyds.com\/wordpress\/?page_id=722\">Software<\/a>, <a href=\"https:\/\/vandermeij.familyds.com\/wordpress\/?page_id=724\">Photos<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2190 Family Portal: Projects Why I built it This project began with a friend whose model railway layout had an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"disabled","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"disabled","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-717","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=717"}],"version-history":[{"count":6,"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/717\/revisions"}],"predecessor-version":[{"id":741,"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/717\/revisions\/741"}],"wp:attachment":[{"href":"https:\/\/vandermeij.familyds.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}