Jump to content
  • entries
  • comments
  • views

St Petrock goes AC

Mike Kippax



A couple of friends have encouraged me to post this, an extract from my blog stpetrock.blogspot.com.  I hope some of you find it interesting.


Once upon a long time ago I was privileged to be a regular operator on Peter Denny's famous Buckingham model railway. My station for the best part of 37 years was Grandborough Junction, where one of my important jobs was to communicate with the signal box up the line at Quainton Road... except that there wasn't a Quainton Road on the model!  To simulate this station, Peter built an amazing electro-mechanical computer that ran the timetable, controlled the clock, set points in the storage sidings and communicated with the 'up' block instrument at Grandborough.



Hitherto, the 'Quainton Road' storage sidings had been operated by Peter's youngest son Crispin, but sons don't stay at home for ever. The computer that replaced him was therefore known as the Automatic Crispin. Peter wrote an article about it for the Railway Modeller and I well remember the title  - "Buckingham Goes AC".

It will therefore come as little surprise to friends and followers of the St Petrock saga that my station should also have a computer to simulate the signal box up the line. However, time and technology move on, so rather than building it from plywood and Meccano, I've used a Raspberry Pi single-board computer. In honour of its illustrious ancestry, though, it too is known as the Automatic Crispin.




Mine has a slightly simpler job to do as I don't have points on my storage sidings, but I did want it to display operational notes and the timetable for the St Petrock operator.

My first task was to learn how to instruct the Raspberry Pi to perform to my wishes, so I spent several weeks teaching myself Python, then writing a program.  Here's a little bit of the code that checks the St Petrock bell button and trip rail near the storage sidings, and displays the 'hours' value. It would probably turn expert programmers to drink, but it works and I'm actually rather proud of it.

def get_button_push(after_push_time):
    GPIO.output(12, GPIO.HIGH)
    while True:
        if (GPIO.input(20) == GPIO.HIGH):
            GPIO.output(12, GPIO.LOW)
def get_storage_exit():
    while True:
        if (GPIO.input(16) == GPIO.HIGH):

def display_clock(hour,clockhr,minute):
    if (minute == 0):
        rect = Rectangle(Point(377,10), Point(417,50))
    if (clockhr)>9:
        txt = Text(Point(397,30),clockhr)
        txt = Text(Point(407,30),clockhr)




The screen is an Elecrow 5 inch LCD display that plugs directly into the Raspberry Pi and sits on top of it. Here's a close-up.  You'll see that the operator has a couple of instructions to carry out before train working No.2 can depart for Tregarrick North at 6.40am.




Now the M7 has been attached to its auto coaches and waits at platform 2. A light beneath the bell-push reminds the operator that the clock has stopped  – trains at St Petrock never run late! After checking that the rotating storage sidings are set to road 5, the operator presses the bell once (call attention). The signalman at Sladesbridge responds with one beat on the bell.


The St Petrock signalman (or frequently signalwoman) sets the points, then pulls off signals 15 (platform starter) and 12 (advanced starter). The Gas Street crossing keeper also obediently opens the gates.







St Petrock now rings '3 pause 1' – 'Is line clear for a stopping passenger train?' Sladesbridge responds by turning the block instrument to 'LINE CLEAR' (green).  The M7 then sets off with its train.




As the train passes the signal box, the signalman observes that it has a tail lamp (and therefore hasn't left its tail behind) and rings 2 bells (ding...ding... train entering section). Sladesbridge turns the block instrument to 'TRAIN ON LINE' (red).



As the train enters the storage sidings it crosses this trip point (two breaks in the nearside rail) that momentarily energise a relay, instructing the Automatic Crispin to ring '2 pause 1' (train out of section).




The clock restarts and the Gas Street crossing gates close once more. The sequence is complete.



  • Like 2
  • Craftsmanship/clever 6


Recommended Comments

Great stuff... I visited Peter Denny and the Buckingham Branch Lines a few times and marvelled at the automatic Crispin amongst many other aspects of a remarkable model railway.  I have a Pi sitting in its box waiting for inspiration to outweigh trepidation - your AC at St Petrock might well prove decisive in getting it in to service.  So far (at Swan Hill) I've spent hours wiring relays and switches just to shuffle four controllers between 4 sections of the layout and get 11 sets of points to repsond to switches in the signal box so I'm having a holiday from wires and solder tags for a while but I will follow developments at St Petrock with interest!


Share this comment

Link to comment

csvt: The bell is electronic, using a speaker and an edited 'bell' sound that I found on the Internet. I think it was a Tibetan cow bell (!) but it sounds just right.


kitpw: Please contact me if you'd like any help in programming the Pi. I taught myself Python using Sams 'Teach Yourself Python Programming', but still needed to search the Internet for answers to other things I needed, such as the graphics and getting the Pi to auto-run on power-up. 

Share this comment

Link to comment

The (non-operational) Automatic Crispin was displayed at ExpoEm in 2016.

The manual version, in the form of Crispin himself, was also present for the occasion.

I have some photographs somewhere...

Share this comment

Link to comment

Mike - thanks for the offer on the Pi and Python.  I reckon it will be a few months before I get to tackle the signalling and what follows, namely an 'Automatic Crispin'.  In the meantime, I'd better get a copy of 'Teach Yourself Python'  and see what I make of it!


Share this comment

Link to comment

Gordon: There was a maze of wires under the Buckingham baseboards; what some were there for, nobody knew! This photo of a small part of the 'maze', taking during the unhappy task of dissembling the railway, may amuse you. I reckon Tony Gee deserves a medal for getting it all running again. 


I haven't spoken to Tony for ages. Does anyone know whether he eventually restored the AC to working order?



  • Like 1

Share this comment

Link to comment

Hi Mike, you have inspired me to purchase a Raspberry Pi. I also got the Sams book. I think its going to take some digesting. Managed to get it to boot up though so some progress!


Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.