Sunday, February 22, 2026

Still Struggling with the Signalling Panel

You do not have to be Einstein to guess I have continued my work on the Signalling logic for my future layout’s signal panel over the last week.  I had plans for implementing SPAD detection.  I can do it on a couple of signals, but not on all of them.  So I might back off on that thought for some time.

During the week, I installed a second Arduino UNO to attach 11 Infra-red Detectors to.  These are for the Branchline and the Dual Gauge line signals.  These IR detectors were installed into a piece of cardboard (just like the 10 other IR Detectors for the UP and DOWN Lines and the Siding lead lines) and were wired up back to the new Arduino UNO and the UNO was added to my I2C bus inside the panel. These detectors were all tested and work well.  That allowed me to then move onto the logic for the Branch Line and the Bidirectional Dual Gauge Line.  The Branch line signalling is relatively short – just three signals but it is also Bi-directional.  This means that an UP train will not effect the signal on the DOWN and vice versa, however the IR detectors will still light up to show where the trains are on the layout.

Now I have fixed up the branch line logic, and I have implemented all the Dual Gauge logic.  I have strenuously tested all the shunt movements, and cancelling the shunt movements via resetting the switches, or changing the points underneath the train and everything gives the correct results. 

From my point of view I think there is just one bug remaining, and maybe one item that is causing me some minor inconvenience.  I think the DOWN Dual Gauge logic is working perfectly, but the UP Dual Gauge logic has one signal that clears to yellow too early and my brain is currently fried a bit too much to see the cause.  I will have a good look at it tonight, or if that fails, tomorrow.  When this is fixed, I think the signalling logic will be about 98% done.   I have also installed the logic to determine if we have an UP or a DOWN train on the Dual Gauge.  But now thinking about it, I might have to dive back in and look at the UP and DOWN logic in regards to signals at 'Hold'.  This code to set and release these signals must execute regardless of an Up or DOWN train running.

The logic inconvenience can be fixed later if I don’t like it.  Basically I have some reversed logic in one of my panel switch implementations, e.g. I test certain logic tests in a different order, and thus it does not send a message to the LCD screen until a second switch is also set.  Everything works here though. 

So it is possible that on Wednesday when I have a free house with the boss out, I can roll out my 1:1 scale 8m long track diagrams onto the floor, throw around some points and some flex track and do some more detailed design work on the various layout module lengths and widths and where the modules all overlap etc., as there are modules that end up side by side, as well as end to end. 

On last Saturday (yesterday) we had our first monthly NMRA meeting for the year and I gave a talk on our trip to Rosehill Exhibition last year.  I also took along my signalling panel in the hope that at least one of the two QR Train Controllers in our group, could give me some feedback on my signal panel.  Things like the messages I give on the LCD panel, and other comments about the panel.  But the two slackos did not turn up.  I spoke about the panel at Show and Tell and gave a few demos during various breaks in the day.   I found a couple of issues during this testing.  A wire broke in transit and I found a bug in my Down Main Shunt Logic.  Both of these were fixed last night.  I will be adding a whole lot of signage to the panel over the next few days as well, to make it more understandable or self explanatory to the operator.

Sunday, February 15, 2026

More Signal Panel Progress

I have been ‘head down’ and ‘bum up’ coding in my Arduino driven Signalman’s panel for my future exhibition layout.  I’ve jumped head first in and fixed the scrolling of the LCD display on my panel.  I made the variables I was using to control the messages to be displayed on the LCD screen global and now I do not have to pass anything to the function that will do the actual scrolling.  That fixed my issue.  I still get some ghost entries not scrolling off occasionally, but I will identify what causes them and fix them in the future.  Given that my LCD screen scrolling seemed to be working as expected, I then started to offload lots of other messages into the LCD panel.  I added messages like when a signal is set to hold, or when a shunt move is given a signal approval.  Then when the signal goes back to stop, the cancelling of that shunt move signal is also causing a message to be sent to the LCD.  I think this will give the Signaller a better understanding of what he is doing, through positive reinforcement.  I also fixed a bug from last Sunday where Signal U2 after having its Hold status released, it just sent the signal through yellow and then green, instead of remaining at red if a train had just passed that location and was in the section ahead.  That would cause an issue if it continued.  I realised that I had not set a particular flag when I re-wrote that section of code used for signal U2.  One small change by setting the flag and the signal logic resumed working like a bought one.  Occasionally I get signal U1 being orphaned on a red signal after having its HOLD status released.  But it is a timing issue.  If I then set the signal again back to Hold and then release it again, the signal comes back and the aspect is correctly set.  I think I can live with that one little hiccup.  It may even be a design feature!

At this point in time I have two messages that are not being displayed on the LCD panel.  I think I am setting them correctly in the code.  So I will look into that a bit more next week.  I jumped in further and moved onto signal D2, and worked on its code.  I then moved to the two of the three signals on the Dual Gauge line that can be set to Hold.  I will install my next slave Arduino to handle the signals on the branch line and the dual gauge next week.  I will get this working before I start looking at any Dual Gauge IR Signals.  Then I will get the Dual Gauge Up signals working before I do the DG Down signals. I continued along the coding path on Wednesday and I feel that I now have the DG held switches for DG2 and DG4 working.  It allows shunting into the sidings so I’m happy.  

On Wednesday evening I think I mastered the DOWN held signal at D2.  I can now shunt to the UP main.  However, I was perplexed why my shunt switch on the panel could not get the D2 shunt signal to light.  I traced it back to a solder joint had broken.  So I resoldered that jumper wire and it worked.  I was very happy.  I noticed that one signal DG5 also stopped working.  So I jiggled some wires and all in now good.  However, signal SS1, the standard gauge shunt signal from the siding to the Dual Gauge did not work.  I was thinking that I will have to investigate that further.  Also at that stage I have not yet tested a train leaving the standard gauge.  I noticed that the SS1 signal went out maybe on Wednesday morning.

So while on my morning walk on Thursday, the old grey matter was thinking about my Signal SS1.  I realised that on Wednesday when I finally started to get signals DG2 and DG4 to respond to signal aspects.  The signal at one end of the board would light, but the track detection circuit LED at the other end also came on.  It was then that I realised that I needed to swap the addresses of my Dual Gauge Up and Dual Gauge Down expansion boards.  I did this and thought nothing further as it then brought the track detection LEDs and the signals back into sync.  However, it did not click that the SS1 signal was extinguished following this move.  So while on the walk, my brain was wandering and it turned to signal SS1.  It was at that point, I realised that the Red and Yellow LED addresses which used to be on the UP Board at ports 12 and 13, where now on the DOWN Board at those same addresses.  The code in my Signal logic, still had them setting LEDs on and off on the UP Board.  So on Thursday afternoon, I changed the code to move the addresses in the code to the DOWN board and wouldn’t you know it, after compiling the code and sending it to the Arduino, the SS1 signal now turned back on.   The plan for the rest of Thursday was to write the code for making the SS1 signal work for a standard gauge train leaving the siding.  That was to be followed by the Branch signals, then DG3 for trains stopping movements into DG4 when a train is entering or leaving the dual gauge line into the standard gauge sidings.  

So all the code for the Branch signals was written and tested and apart from one message not appearing on the LCD screen, I can shunt from the branch to the UP Main, and exit to the DOWN Main and head north.  It is now also working like a bought one.  I took it to the Club on Saturday and showed it off.  I got plenty of questions and lots were interested. 

Saturday evening I started assembling all the wiring for my second slave Arduino for the next lot of IR detectors to be installed.  Then on Sunday after another purchase at JAYCAR, I found and fixed a few cosmetic errors in my signalling logic.  Some signal aspects were not cancelling when I turned off their activation switch on the panel.  But as I was doing these changes, my memory utilisation in my Arduino continued creeping up.  It got to over 6200 bytes.  That caused a warning message to be issued by the IDE compiler, that the Arduino could become unstable due to lack of free memory.  I did some research and found out how to reduce this usage.  Basically every Serial.print statement e.g. Serial.print(“blah blah”) for debugging and programming tracking purposes, was changed to a Serial.print(F(”blah blah”)) and my memory usage reduced down to 2373 bytes.  I was amazed! 

I had a basic test of the program on Sunday afternoon and of the items implemented about 95% are working as designed.  I know of a couple of small improvements around SPAD detection.  I display this SPAD message every time around the logic loop, instead of just once while the IR Signal detection LED is lit.  I’m just too lazy to code that change in the first 8 places in the code today.  I also have the RED aspect on DG7 lights intermittently.  Its address is pin 9 in the DGBoardDOWN,  But I do not know when I activate it in the code.  So I have just referenced the wrong board or wrong address somewhere, but my brain is so fried I cannot find it.  But I will. 

Progress is good and satisfying.

Sunday, February 8, 2026

Still doing Signalling and a Clinics Day

I spent time on Monday reviewing my wiring in my Signalman's panel.  I had wired up 10 IR detectors to an Arduino UNO, which I moved from my Arduino MEGA.  I found that I had wired about 2 or 3 IR detectors back the front.  So that was fixed, and now my slave Arduino UNO was powering up and seemed to be working.  I then did some work on the main Arduino MEGA.  I was wondering about power draw again.  I started looking for a 6V or a 9V power supply in lieu of my current 12V power supply in case I am overloading the voltage regulators on the MEGA board, when it must drop that voltage down to 5V.  It seemed that my current MEGA had bit the dust and was not allowing my computer to link to it and upload a new version of its program from the Arduino IDE.  I then did a google search to see if you could repair the Arduino.  Someone was offering $89 to just look at an item’s board.   Well I could buy 4 more MEGAs on eBay for that price.  I looked on Ali Express and I ordered 3 more spare MEGA boards for about $17 total - delivered.  It looks like I need to throw that MEGA away and install my current spare board.  Thus the need for some more spares in the back pocket.

On Tuesday morning I bit the bullet and swapped out my bung Arduino MEGA for my spare one.  It fired up first time.  I then decided after reading that the input voltage should be 7-12V on the Arduino, to not get the 6V power supply and settled for the 9V version.  I used by NMRA account code and saved $4 on that one item.  I have saved this year’s membership fees already through these discounts for sure.  While replacing the Arduino MEGA, I managed to displace a few wires that I had jerry rigged for testing the IR detectors.  I also had the top of the panel come falling down on me and that dislodged a few more wires.  So after finding them, normal services were quickly resumed.  It must have been just like QR on Tuesday as there was an intermittent signalling fault on the network out near PK’s place.  I think he had a hand in its cause.

We had our Tuesday Nighter’s get together at Geoff’s place on Tuesday evening and it was good to see 10 of us turn up.  Geoff asked people to bring what they were working on.  I brought along my Signalman’s panel.  I borrowed some of Geoff’s electrons and turned it on and gave an overview of how it operates.

I went into town on Wednesday to pay up my Lotto debt.  I chose to split the travel with bus then train, just to look at what has changed over the new year network shutdown.  Well I can advise that there is new track laid through the new platform at Yeerongpilly.  However, it is not connected at either end and there is no overhead wires above it.  There is also significant progress in Clapham Yards for the new train staging facility.  So there is some progress.

I had been trying to write some Arduino code that will track messages on my LCD screen, and after about 5 seconds of being displayed, the message will scroll off.  The code is basically working, but when I try to test it with multiple messages, after a while it gets confused and the messages do not scroll.  This has me perplexed, as the logic is simple as.  I will resume this logic testing next week.  I also have identified a few gremlins in my UP code.  But I can't put my hand on the exact circumstances that are occurring for me to track it down conclusively.  I will continue investigating.  

Saturday was the NMRA Clinics day opened up to 16 members.  We had some people pull out at the last minute for various reasons, but we had a great day.  It kicked off with my doing some terraforming on a small foam block about 30cm x 25cm.  This for shaped and then plaster encrusted tissues were laid over the foam.  This was left to dry while the attendees then made a single telegraph pole and then with the rest of their wooden stick offcuts were made into split post fencing.  The wooden items were stained in my ink pad ink and methylated spirits.  Then the attendees had a lunch break.  It is planned that these items will be used in day two of the clinic, which will occur on the 28th of this month.  We will paint the scenery block, and then add dirts, sands and scatters to bring it to life.  We might get some rocks and other detail items.  So telegraph pole and the split post fencing will also be added.  After lunch the attendees were split into two groups and we had one group making a tree while the other group made a signal relay box in styrene.  Following afternoon tea, the two groups swapped over and did the other session.  These were also well received and the attendees will also add these items to their scenery block on the 28th.  They also have more styrene and tree clinics on that day as well.

Jonathan showing the crew how the tree making is done.

Some of Jonathan's trees on display

Follow these steps and you get a tree like the one on the right.

Next garage has the styrene team working on their signal relay hut.

Sunday, February 1, 2026

More Thinking About Arduinos Controlling Signals

This week I struggled to get motivated to do any modelling.  However, eventually I started doing some work with my Arduino UNOs connecting a couple of them together over an I2C bus with one reading IR detectors and the other flashing LEDs based on what IR detectors were detected on the first Arduino.  That seemed to work.  I was amazed I got it working quite easily.  This Arduino UNO will have 10 IR detectors attached to it, and it will talk to my Arduino MEGA which will run the signalling system.

Today I moved the Arduino UNO that will read my future IR detectors from the test bench into the Signalman’s Control Panel and then rewired everything.  When I started up the System, it seems I had some low voltage on my controlling Arduino MEGA and it did not seem to be firing up.  Last night it was running before I did any changes to the system.  I just need to trace back what I might have touched and try and ‘unchange it’.  I can’t seem to see anything conclusive as yet.  I have full power into the system from my power supply.

Earlier this week I was also called onto do a presentation at the upcoming February meeting of our NMRA Division.  Luckily, I had started the framework for another presentation.  So that presentation was completed this morning with the help of a couple of photos from PK.  At the same time I started the basis of another presentation that is about my Signalman's Control Panel.  But that will be quite some time before that is useable and thus the presentation will be ready.  Apparently I am also assisting a number of NMRA members to build a small Diorama next weekend and in another 3 weeks.  So yesterday I spent a bit of time putting a few things in a box to take to next weekend's clinics day.  It has been designed for up to 16 paid attendees, and at last count we have 12 nominations.  That is great.