All Aboard the IoT: Internet of Trains!
An ESP32-C3 turned a boring toy train into a Matter-enabled IoT device that can be controlled with Home Assistant.
Electronic engineering isn’t all about math, physics, circuit design, and soldering — it’s also a lot of fun. And what better way to have fun than to hack away at toys to give them cool new capabilities that we could only dream of when we were playing with them as children. Take Zoltan Balazs’ IoT train, for instance. Anyone can turn on the lights with their smart home system, but only Balazs can get a toy choo-choo chugging along with a tap or a voice command.
As a starting point, Balazs picked up a cheap — and definitely not smart — toy train. An ESP32-C3-DevkitM-1 board was then used to get some control over it. A MOSFET was wired between the train’s power supply and motor, with a GPIO pin of the ESP32-C3 controlling the flow of current. A CR123A rechargeable battery powers the development board, and the hardware was all stuck on top of the train. That alone was enough to start and stop the train on command, but a means of controlling this action remotely was still needed.
Since the ESP32-C3 is a Matter-compatible microcontroller, and since Matter is the coolest way to connect IoT devices these days, Balazs used this capability to connect it to an existing Home Assistant setup. And with that arrangement, the train can be started and stopped in any number of ways, even when Balazs is away from home.
This is quite a simple project, even for a beginner, so if you are looking for a way to level up your skills, or just create a really interesting display piece, this might be exactly what you are looking for. Be sure to check out the full project write-up for more details.
R&D, creativity, and building the next big thing you never knew you wanted are my specialties.