This is the source for my Raspberry pi powered christmas village.
Some pieces I used in the construction apart from the obvious.
I used these great UL certified jumpers to share ground or power pins and for easy cross connect
https://www.amazon.com/gp/product/B08W3QXN9B/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1
Here is the module I used to power the train, if you look in the repo it uses PWM to adjust speed.
https://www.amazon.com/gp/product/B014KMHSW6/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1
Here are the proximity sensors I will be using, you can see in the code I wire them up, but they are currently unused, plan to have them detect where the train is at on the track so the "stop at station" button works.
https://www.amazon.com/gp/product/B07FJLMLVZ/ref=ppx_yo_dt_b_asin_title_o06_s01?ie=UTF8&psc=1
You can see the full completed project from this reddit post: