I used Claude code to help me automate my model train layout
retained text
Basically the title. I have a PhD in astrophysics so not afraid of a technical problem but haven’t touched electronics since my undergrad physics lab, so I had this fun idea but didn’t really know where to start. Decided to see how well Claude could do and I used Claude (some fable before it got removed from the lowest tier account as well as opus) to research all the parts I needed to buy + put together detailed instructions on how to wire everything up. Then I had Claude code iterate with me on programming the ESP32 “brain” that controls everything to design the software. The ESP32 generates its own WiFi and serves a simple webpage Claude designed that controls the trains. I can drive them manually from there, or also enable “auto” mode and it executes a script we wrote that sends the freight train around, detects when it enters the siding, stops it, then sends the passenger train around to do the same thing, and repeats ad nauseam. Pretty fun little project for me that Claude turned from complicated overwhelming problem to basically a slightly more advanced LEGO kit. I had to manually correct a few things (both in parts and software) but by and large it did an amazing job. The code is very specific to my use case but if people want it and/or the parts list happy to provide! My train layout is still a work in progress but loosely modeled on the “Winter Park Express” ski train that I take to ski every winter in Denver.
document fetched 2026-09-04 00:47 · canonical https://reddit.com/r/ClaudeCode/comments/1w6dzcn/i_used_claude_code_to_help_me_automate_my_model