This week I completed a project that I probably started about 10 years ago. This was when I made a couple of HO Scale 6.5m x 6.5m garages in styrene, but these models were fitted with a garage door that could open and close. These were tilt-a-door models. I included a servo at the back of a garage, hidden by a wall and then ran a cotton connection from the servo to the tilt-a-door mechanism. So these models just sat on the shelf in the train shed for a very long time.
So this week, I bit the bullet and started to get into working on servo control from an Arduino. I first got a servo working directly from an Arduino UNO. So I then connected the Arduino to my garage Arduino and after adjusting the throw of the hidden Arduino, I could get the tilt-a-door on the garage model going up and down. Next step was to reconfigure the wiring to/from the Arduino so that I could install a push button inline so that would control the opening and closing of the garage door via a press of the push button. So some quick changes to the Arduino code and it was working. The code would wait until a press on a certain pin in the Arduino – in my case pin 8 and the door would open. It would then wait again for another button press on the same pin and the garage door would close. I took this working garage door opening model to yesterday's ‘Show and Tell’ at our local NMRA meeting. I got a couple of nods from the audience. I was happy.
However, during the week, the main task that I was trying to master was to incorporate servo control from the Arduino via a PCA9685 16 port expansion module. I tried it about 50 times. I could not work out why this was not working. I was bamboozled. So on Friday I rang up my Arduino mentor - Bob, and asked if he could bring a spare PCA9685 16 port expansion module from his collection to Saturday’s NMRA Meeting. I thought that the only reason I could not get the servo to work via the expansion port, is that my expansion module must have been bung. If I proved that by using Bob’s spare module that it worked, then I'd order a few more of the 16-port expansion modules online to replace my bad one and then have a spare nearby. So on Saturday morning I was sitting in the audience of the NMRA meeting with my PCA9685 port expander sitting on my lap, and I just happened to read the bottom side of the PCA9685 expansion module. It said that if using servos, then the power had to be supplied via the V+ pin. Oh firetruck! I had not powered the V+ pin on the PCA9685 expansion module. Now I have 7 of these expansion modules working in the internal logic of my Signalman's Panel. But these are used only to control LEDs. However, all of these were powered by the Alternate Power plugs on the module. This powered the V+ pin, but doesn’t use the V+ pin. My testing with LEDs on the expansion module in question did not need the alternate power plugs used, but the LEDs still worked on the module.
So at half time in the Brisbane Lions and Hawthorn AFL game on TV later that evening, I reloaded the code into my Arduino to run the servo via the PCA9685 16 port expansion module, but this time with an extra cable from the 5V pin on the Arduino to the V+ pin on the module. Guess what? The bloody thing worked. Damn Dork! I did advise all the attendees at the NMRA meeting that I might have worked out why my Arduino testing was having an issue controlling the servo via the expansion port module. I did get a few laughs. I also got a few jokes throughout the meeting about powering the V+ pin. We really need to separate Clinton, Greg and PK at future NMRA meetings. Note to Div 1 Superintendent – separate those bozos! When I told them that, they all laughed. Given that one of them is a teacher you would think he would know better.
So now I just need to get some MERG servo components to fit underneath another test module and I will incorporate a servo that will actually change a point on this new test module, controlled and interlocked from my Signalman's Panel. Hopefully my mate has placed the order from MERG in the UK. I’d expect that in 2 or 3 weeks it might arrive.
I have an Operations Session scheduled for this coming Sunday, so this week I will be cleaning up the train shed and cleaning the track and testing everything in preparation.





