Xmas 2021 (The Prep At Least)

2021, December 05    

As most who know me are aware, this time of year is something that I don't celebrate (and haven't since I was a child). With that said, I'm not against the celebration of Christmas/Xmas, it's just not something I get much enjoyment out of. However, seeing other people enjoy themselves is always nice, especially if you are a contributing factor. To aid in this, I started last year putting out a decoration display to try and bring some happiness to those in the area. This year is no exception, and has actually taken a lot more effort (but has definitely been worth it!).

To make this year interesting (and in fairness to beat last year) I spent some time thinking about what I could do different that might be something new for people to see. It was actually during a trip to York and seeing a display in a shop window that gave me the idea. One of the things that I have never seen on a household display this time of year is an outdoor train on a large track. By this I don't mean your typical Hornby, but something a bit larger and a bit more interactive. After some searching I managed to find a kids ride-on train from eBay that looked the part and should work well. It's designed to be used on pavement/tarmac, however with some modification it should be able to run on a makeshift track.

As with everything in life (especially projects I decide to take on), additional complexities always come out of the woodwork to make things more challenging. First was that of the track itself, and making something the train could actually use repeatedly without breaking/causing a jump off the tracks. For this, 50 meters of right-angle aluminium were needed (as well as some wood for mini sleepers). Then comes trying to make it so the train can charge at certain points of the track, but in a safe fashion that doesn't pose a risk to anyone/any animal that might touch them. Some low voltage low current DC to the rescue, charging the train while at the depot (which also needed to be made).

The internals then posed the next set of challenges. The train itself has multiple interfaces for the rider to use, which would all need to be mapped to some form of controller. A Raspberry Pi and relay control board were chosen for this as there would clearly be programming involved and trying to debug C isn't something I would have time for. Figuring out the wiring controls became the next challenge, as circuits for the motors weren't as simple as you would expect (due to a combination of forward/reverse capability combined with turbo mode). One voltmeter and some time later, the wiring was correctly mapped and connected to the relay controller.

Programming the device is a challenge in itself, as with multiple relays to control, a required schedule, manual controls, and a decent form of logging, it wasn't an easy feat. Add to this an additional challenge of trying to integrate a small camera into the front of the train to see everything it goes past (i.e., train-cam), and the many headaches that come with trying to get a stable video stream out of the camera and over the built-in WiFi, and you start to see how the headaches grow...

Tracking the distance travelled, and determining when to stop/change direction was by far the biggest source of headaches within the project. The plan: use the magnetic contact sensors to indicate when the train has passed a trip-point on either the left or right side, and change accordingly. The result, many evenings lost over a period of weeks trying to determine why despite different sensors and different wiring methods, false-trips are incredibly frequent (but not all of the time), and software debounce doesn't work as a solution. The issues around this and the time spent are enough to test even those with a wealth of patience. On the day of the decorations going live the only remaining sensor worked fine the entire time, while the day after things broke for seemingly no reason. In the end, thanks to foam padding at each end of the track, I had to resort to timed forward/reverse travel as the sensor became too unreliable.

Despite all of the late nights, the headaches, the frustration, and even the tears at one point, the end result was worth it. As I sit in the living room (including when writing this), I hear both parents and children being amazed by the train. I've spoken to a few of the visitors who have asked about how it was made, how long it took, what it does etc, and while it's nice to have those questions, it doesn't compare to that of the hearing the children saying 'hello Santa', 'here comes Santa again', and 'I want to see the train again'. Knowing that even for one day, its a happy childhood memory that hopefully lasts for them, and in some cases may inspire them later in life to build something of their own, means I achieved what I set out to do :-)

Xmas Decorations 2021

Train Cam 2021