The Deer Chaser - aka The Hosta Loop

Note: This feature has been retired (as of 2020), but it was an interesting project at the time, so I've kept this page around. The loop on top of the rock wall is now part of the newer mining loop that exists mostly in the expansion area added in 2020.

The deer left my hostas alone all summer in 2016, but then chewed them to the ground in the fall. So I decided on a deterrent: I would put a small loop right inside the hosta area, and have it motion triggered to light up, run, and make noise any time the deer showed up. Until the new track and controller were ready, I had to settle for fencing the hosta.

I make my living designing electronic control devices. So this seemed like a fun way to test our conventional electronics in an unconventional application. Here the controller is in the early stages of being wired and programmed.

There are a lot of wires hidden under the surface in the layout between the control box and the hosta area. There are motion sensors, track position sensors, lighting, and of course the track power. There is also a daylight sensor and a rain sensor. I bring my laptop out to the railroad layout any time something needs testing or the control program needs tweaking.

I used PVC 1x2 trim boards as the track base. They are rigid enough to hold shape well, yet just flexible enough to bend into a nice radius. I first saw this idea in an issue of Garden Railways magazine.

Upon sensing motion, the train runs, blows its whistle a couple of times around the track, makes chuff sounds, and also has a bell sound when slowing to stop. The locomotive always stops under the covered bridge to protect it when it rains. There is also a rain sensor connected to the controller to tell it not to run when raining (but it does still make noise as if running - sound system is independent of the actual locomotive). The track sensors not only tell the controller where the train is, but whether it is moving. If it gets derailed by a branch on the track, the controller will figure this out and light up the red alarm lamp just to the right of the covered bridge. And it will also send me a text message telling me there is a problem. Yep, my train controller even has a Verizon 4G LTE Internet connection. Are you laughing yet? I am.

The original plan to use a small porter for locomotive didn't work well - it was too small and didn't like the curves. I knew the trusty old Shay was good on curves and had this 2-truck Shay left over from my 4-truck conversion project.

I used aluminum track for the time being just because that's what i had a lot of on hand. I found that the motion sensors can't seem to tell the difference between wind in the trees and a warm body walking by - I need to find better quality sensors. They are supposedly infrared motion sensors. There shouldn't be much infrared in trees, so I obviously need better quality sensors. Because anything sets the sensors off, the train ran far too frequently. As a result, the aluminum tracks get dirty far too quickly. Aluminum is not good for track powered locos. Aluminum is good for battery powered locos (like all the others on the layout). I will be replacing the track with brass in the summer of 2018. In the meantime, the concept has proven functional. It needs fine tuning, and then the ultimate test: See what the trail camera has to say about success.


There is a ring of LED lights hidden on the inside perimeter of the track. The surprise is even more impressive when the deer show up at night. If they don't get scared off, I will at least nudge their noses while they eat until they get smart enough to just push the train off the track. We'll see what happens.

The control box pictured above is neatly hidden inside the Birchwood Pavilion, which I scratch built for the sole purpose of hiding the controls. But the building looks sort of cool and would be a nice addition even if it had no secret purpose.

The little gray shed in the middle of this photo is hiding a second smaller version of the same control system. This one also has motion sensors throughout the layout with the intent of warding off deer that might be tempted to walk around on the layout. Upon sensing motion, if it is nighttime, all of the wired buildings will light up. Either day or night, the sound system will play a ragtime song. The big rock next to the little shed is really an outdoor speaker. This controller is networked to the other one so I can monitor both via the 4G LTE Internet connection.

Update 2019


So how well does the deer chaser really work? Here's your answer thanks to a security camera... have a laugh...

A new family of deer that showed up this year seems to think our place is their home. I can walk up within 10 feet of the fawns before they back off or run into the woods. But they show great curiosity and I'm pretty sure I could get them eating out of my hand if I worked at it a bit.

I did replace the track with brass in 2018. But still, an unattended train is not totally reliable. I don't have the automatic "pick branches off the track" part worked out yet. The train was not in service in the above video, but it is pretty clear the deer don't care much about noise. Even if the train was running, it is programmed to run 3 loops, then pause, then run another loop once a minute. That plan would most likely not be effective at scaring these deer off. The only thing saving the hostas here is the fence.

The other problem I found is that the infrared motion sensors like to sense tree branches blowing in the wind. Apparently there is enough infrared light reflecting off the leaves from the sun to fool the sensors into thinking somebody or something big is walking by. So they ended up being people, deer, and windy day sensors, and the train wanted to run almost continuously.


Update 2021: The Hosta garden is getting repurposed as a farm as part of a major layout expansion project that started in 2020. Visit the Expansion page for more about that.