Building an N-gauge model railway – crying out for Arduino control!

I’m really getting into this blogging stuff. I realised that it doesn’t really have to do with our core business, just as long as its fun and I can justify that at least SOME of our customers will find it useful 🙂

Ever since a young age, I’ve been into model railways. I used to have a huge 18 foot by 9 foot OO gauge layout in the attic at my mum and dads house and I spent many hours getting everything looking nice. When I was about 16 I realised that there was a couple of things that were much better fun than model railways – Beer and Girls – so I sold it all.

Now that I am older, the novelty of beers has worn off and the “girls” have turned into just the one girl – my wife. In addition, we have a wee boy who is obsessed with trains and so I started to rekindle my interest in the hobby again.

I decided that the perfect scale to be workable with would be N gauge. Everything is about half the size of OO, so you can fit quite a complex layout in a very small space, say about 6 foot by 4 foot.

My first attempt was a disaster. I tried to make it too complicated. I had what was effectively 6 lanes of tracks, the inner track having a radius so tight that long locos couldn’t travel round it. I knew I wanted DCC (Digital Command and Control) control so that I could control more than one train on the same piece of track independently. I thought I also wanted to use Peco finescale code 55 track, with electrofrog points, for better realism.

But when it came to wiring up the points it was just a pain. What should have been a fun past-time turned into more of a chore. For example, to use a scissor crossover with DCC, I had to fit two microswitches to the turnout bars and at last count I had 22 wires soldered onto that one piece of track so I could swap polarity as the trains passed over.

I know there were many other ways I could have tackled this problem – an auto reverser module, for example, but by this point I had all the track pinned to the boards and I was having to desolder joins to get access to the back of the track. Bad planning.

I decided to rip it all up and start again. This time I was going to admit to myself that I wasn’t building a super realistic detailed model of a real railway – I was just building something that would give me and my Son lots of fun over the coming years.

I settled upon using the Kato Unitrack system. This has track already sitting on a piece of plastic moulded underlay – something that I would have never thought would look in any way good, but the Kato Track is fantastic looking in my opinion and very reasonably priced.

The other bonus of Kato Unitrack is that the points have the motors for electrical control already built in! This means that the KATO scissors crossover has only 2 wires coming out of it, instead of the 22 I had previously with the PECO setup.

I planned a simple layout that would give me three trains running at the same time using AnyRail 5 software – the trial version. With the trial you only get to lay 50 pieces of track, but by designing your layout in a few different sections, you can still make use of it.

Once I had the plan finalised, AnyRail gives you the complete shopping list of parts to buy. To get round my wife, I bought all the track in three smaller purchases, rather than altogether:). I bought all of my KATO parts from Keith Blanchard at because I could speak to him on the phone for advice and everything I needed was in stock at great prices.

So, to the build.. I took some step by step pictures. The build is nowhere yet near complete but I went from an empty attic to something my Son and I can play with and add to within about 3 weeks – not too bad.

photo7Pic 1. First thing was to build a base board. I used CLS for the legs and frame and then used 9mm MDF as the base. Building the frame securely is important to ensure that the baseboard won’t sag over time. I then painted the whole surface of the MDF with Solvent based green paint to protect the MDF from any water ingress from Paper mache etc at later stages – since MDF is fibre board it will swell up if wet. I put castors on each leg – doesn’t help with stability but makes it a dream to slide the baseboard around the attic so I can get access where the roof slopes. The baseboard is 1metre x 2.4metres.

photo77Pic 2. Using the Woodland Scenics range of terrain forming equipment, I placed risers where I had planned for track inclines.

photo777Pic 3. 9mm MDF pinned around back and edges of board. Starting to plan for a tunnel in the back quarter. Note that there are cutouts in the MDF so you can get your hand in to pull a derailed train out!

photo5555Pic 4. Using newspaper wads, dry but secured with tape, we bulked up the open spaces at the edge of the incline risers. Also, using polystyrene sheets, we created the retaining walls at the edge of the hill, where the mainline was going.

photo666Pic 5. This is the bit my son likes. Using rolls of wet plaster cloth, cover everything to creat a hard shell of terrain.

photo55Pic 7. Placing the main track loops into location, so we can start working on the tunnel

photo33Pic 8. Paper Wads on main Hill and tunnel

photo555Pic 9. Main hill plastered

photo11Pic 10. Branch line and bridge installed and track functionality “tested” 🙂

photo6Pic 11. Using Woodland Scenics Liquid Pigments and Scatter materials, we started to build the base colours on the hills sections of the branch line, to see how things would look.

photo5Pic 12. Started to add clump foliage to the hill section. White drips are just the PVA glue which dries clear.

photoPic 13. Overview of back section with clump foliage, home-made trees and scatter material. Back board also painted blue to provide a good separator from scenery to sky.

photo1Pic 14. View back along girder bridge, showing scissors crossover.

photo3Pic 15. One piece of track actually complete. This is how it should all look. I reckon the trees that my wife made by hand look awesome!

And that is as far as we have got, so far. The woodland scenic materials are great. As you scatter the grass on and add more and more detail it suddenly goes from looking terrible to looking real!.

This layout is crying out for an Arduino control system. Having all the locos and points DCC controlled means that every item has its own address that can receive commands. Roy, our tech guru has already built a wireless DCC controller for the system. The next stage is to program a few Arduino UNOs, so that myself and my son can sit back and watch the points switch and the trains starting and stopping at the station by magic. If I can get Roy to stop playing with his Raspberry Pi for long enough to get the code written!


Image | Posted on by | 3 Comments

SparkFuns Big Dome Pushbutton Connection Guide

We have had a few people phoning us up here at Proto-PIC asking us how to wire up the Big Dome Pushbutton from SparkFun Electronics switches we sell.

These switches are 100mm in diameter and have a lovely big dome to bash when you want to make the switch.

I have seen them on BBCs “The Voice”.. oops, I mean my WIFE has seen them on BBCs “The Voice” and then shouted me through from another room, where I was doing manly things, to confirm that they were indeed using our big dome switches on that programme I never watch.

When we were asked how to connect them up, we thought “its only a switch, how complicated can it be?” but it actually took three of us and lots of quick schematic sketching to get it to work nicely. The diode tester and the continuity tester on our multimeter both appeared to be giving us results that just didn’t seem physically possible!

So we thought it would be a VERY good idea to get a video done, showing a bit about the pushbutton and how to connect them up, so that the LED inside illuminates when you press the switch and whatever you want to switch on..does.

Apologies for the overuse of the word ehhhhh.. when I am doing the video. With no script and a slight panic that I wasn’t fully understanding a ‘simple’ switch caused my brain to falter 🙂

We also sketched a quick schematic, so you can see how the wiring works :

BigDome Pushbutton

Hope this helps you out.


We are an Authorised SparkFun Electronics Distributor in the UK. Check out our full range of SparkFun Products.

Image | Posted on by | 1 Comment

RAF Leuchars 65th Annual Airshow (and the last one!)

Okay, so i know this is nothing to do with electronics, but here at Proto-PIC we do occasionally get to spend some time with our loved ones.

Last weekend, my time was spent attending the 65th Annual Airshow at RAF Leuchars, just outside St.Andrews – not too far away from the RelChron/Proto-PIC HQ in Kirkcaldy. This year is sadly the last as very soon the RAF will leave Leuchars and the Army will take over the base. Now apparently, they are planning on keeping up the annual show tradition with an display of their own, but in my opinion (apart from the fact you wont get a craned neck from looking up all day) it will not have the same effect as the amazing “Red Arrows” display team throwing their ‘planes about at incredible speeds whilst keeping the wingtips within 5 feet of each other!

It was quite a nice day (if you are scottish – quite cold if you are not!) and we were bussed into the Airbase. The sheer number of people there was astounding. The show started at 10am – we were there at 10am, so at what time did the other 10,000 people in front of us arrive? We headed straight for the end of the Airfield – via an Harrier flight simulator, which was nice – where we knew we would get a good view and noise from the awesome Eurofighter Typhoon doing its thing.

We were instantly treated to a flyby by a squadron of F4 Phantoms, which will always be a personal favourite of mine. I think there is something beautiful about the sleek lines of that craft and i had several miniature versions when i was younger.

When arrived at our chosen position and setup our camp chairs, my father reminded me to put on the ear defenders we had brought along for my son. I thought he was just being over protective of his Grandson – i was wrong – at that moment the Eurofighters started rolling along the runway towards us. I just couldnt believe the noise, that is one loud aeroplane.

A couple of  photos of the Eurofighter in the air

IMG_8418IMG_8426IMG_8440 IMG_8442 IMG_8445

Next was the Red Arrows display team, one man down due to a bad accident last year, but absolutely amazing nonetheless.

IMG_8494 IMG_8495 IMG_8501 IMG_8502

The end of the show spectacle was a fantastic flyover by a WWII Lancaster bomber, A Spitfire and a Hurricane:

IMG_8575 IMG_8576

All in all a fantastic day.  This was my first time at the Leuchars Airshow and sadly it will be my last – i didnt realise what  a great day it was until the final one!


Video | Posted on by | Tagged , | 4 Comments

Soldering Tutorial

This is a short tutorial on how to solder – with an example of BAD soldering.

Video | Posted on by | Tagged , , , | Leave a comment

Colour Changing Fibre Optic Scarfs – With wireless Colour Control


Need to use wireless communication to transfer or control arduino or any other micro-controller (With a UART). Then use the WIXEL Wireless controller. This is an example of a project to communicate via colour scarfs.

Posted in Uncategorized | 2 Comments

12v Vacuum Pump

Need to create a vacuum, then use this easy to use pump :

Needing a very modest 12V at 1 Amp Supply this pump can be included in many projects,

with a small 40mm x 65mm x 90mm footprint, it can fit easily into small enclosures if required.


Posted in Uncategorized | Tagged , | Leave a comment

RFID based Bird Logger

A customer asked for help on designing an RFID based Logger to log bird visits to various locations, in the log he required the date, time and serial number of the RFID attached to the birds. We started with an Arduino UNO, a Real Time Clock module and a RFID reader.  We added a SD Shield to log the data to & built the prototype. Have a look at the video :


Posted in Uncategorized | Leave a comment