Infineon Team
Published © MIT

Autonomous Model Train with PSOC™ 6 and MicroPython

Model train controlled through the rails? - Lame! Why not make it autonomous with an onboard microcontroller? That's just what we did!

IntermediateFull instructions provided12 hours379
Autonomous Model Train with PSOC™ 6 and MicroPython

Things used in this project

Hardware components

PSOC™ 6 AI Evaluation Kit (CY8CKIT-062S2-AI)
Infineon PSOC™ 6 AI Evaluation Kit (CY8CKIT-062S2-AI)
×1
Infineon PSOC™ 6 Wi-Fi BT Prototyping Kit
×1
H-BRIDGE KIT 2GO
Infineon H-BRIDGE KIT 2GO
×1
S2GO HALL TLE4964-3M
Infineon S2GO HALL TLE4964-3M
https://www.infineon.com/cms/en/product/evaluation-boards/s2go_hall_tle4964-3m/#
×1
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
×1
Bogie drive, H0
https://shop.ferro-train.com/hallingShop/Article/ANT-ALX-240-H0
×1
Carrying bogie type ALX, H0, wheelbase 24 mm
https://shop.ferro-train.com/hallingShop/Article/MDG-ALX-240-H0
×2
Curved Track R1/30°, 6 pcs
https://www.conrad.de/de/p/h0-piko-a-gleis-55211-gebogenes-gleis-6-st-219680.html
×2
Straight Track G 239
https://www.conrad.de/de/p/h0-piko-a-gleis-55200-gerades-gleis-239-07-mm-6-st-219677.html
×1

Software apps and online services

MicroPython
MicroPython
You will need the MicroPython fork for the PSOC 6

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
We used a printer capable of printing 4 colors.
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

S-Bahn Front Body

To be printed in 3-4 colors:
red basis
white doors
opt. grey windows (or black)
black for the rest

S-Bahn Back Body

To be printed in 3-4 colors:
red basis
white doors
opt. grey windows (or black)
black for the rest

S-Bahn Roof

For 2-3 colored printing:
red basis
black top surface and boxes
opt. grey distinction between top surface and the boxes

Hall Sensor Spacer

Spacer for the hall sensor. To be glued (e.g. double sided tape) to the underside of the model train body. Then the hall sensor can be clued/taped to the spacer.

Station

Station model with the LCD display holder.

Station Sign Stand

The stand to hold the station signs.

Station Sign Deisenhofen

Station Sign Furth

Station Sign Taufkirchen

Station Sign Unterhaching

Campeon (Top Right)

4-colored print:
green basis
blue water
marble white buildings
marble creamy roads/ground

Campeon (Bottom Right)

4-colored print:
green basis
blue water
marble white buildings
marble creamy roads/ground

Campeon (Bottom Left)

4-colored print:
green basis
blue water
marble white buildings
marble creamy roads/ground

Campeon (Top Left)

4-colored print:
green basis
blue water
marble white buildings
marble creamy roads/ground

Schematics

Model train schematic

Station schematic

Code

Code

This repository contains all the required code - for the server as well as the model controller and station controller.

Credits

Infineon Team
127 projects • 201 followers
Hands-on projects, tutorials, and code for sensors, MCUs, connectivity, security, power, and IoT. Follow for new builds and ideas.

Comments