Sunday, January 15, 2017

New header for our modules' standard

Happy New Year everybody!!! This is my first post of 2017

We are ready to publish the revision 3 of our modular norms. Remember in the top horizontal menu, under "Modules" option, you will find always all the posts and the last version of the norms once approved.

A big change in this new version refers to the header construction and shape. Our adopted header was the same from the EuroN norm:

EuroN header (ClubNCaldes v.1)

Everybody told us that the squared hole (the one on the right side) was never used. In the original EuroN norms that hole is to pass two hidden tracks to cross under the modules. But if even having the tracks in sight sometimes is difficult to adjust them, having them hidden looks like it can cause many headaches and train derailments in a zone that you cannot see and has difficult accessibility. So we decided to get rid of it and center and enlarge the existing rounded hole that we use to pass the wires and connect one module to the other, and as a handle to move the module.

At the same time one of the club members had the idea to make a reversible module, so you can flip it and interchange North and South sides with no problems. Another friend wanted to make a staging yard of 6 tracks, but having a kind of norm or guide for it and to place the tracks. In this way any staging yard module (with 6 tracks) can be joined to the one from any other club member as everything has been constructed under the same norm.

These are the reasons to design a new header, fully compatible with EuroN and our previous header norm, but having the holes to place the metallic gauge in three different positions. The two outside positions allow to place 4 tracks so that the module is symmetric and North and Sound sides are interchangeable. A center position of the gauge allows to place two extra tracks centered in the module.

ClubNCaldes header v.3 (compatible EuroN)

I will upload the last norm version soon, as it contains more detailed information and step-by-step instructions to build the different Loconet modules using Arduino.

Sunday, December 4, 2016

PSX DenshaDeGo Loconet controller

In my last trip to Japan I found an old PSX "Densha De Go" Japanese controller. This is a controller simulating a train cab and used with that train simulator game, very popular in Japan.

I don't remember if I found it in a BookOff second hand store or in Mr Potato, Last one is a very famous retro gaming shop in the heart of Akihabara district in Tokyo.

My idea was to use the controller to move trains in my layout, and to accomplish that I would use an Arduino acting as interface between the PSX controller and my Loconet network.

Let's check the hardware needed:

1 x Arduino UNO. (Another Arduino version is also possible)
1 x Loconet shield. As always that you want to interface Arduino and Loconet, you need a Loconet shield. You can build it your own, or buy it directly to the Rocrail guys. The item code is GCA185 and here you have all the information about it and the electrical schemes if you want to build it by your own:
1 x Sensor Shield v5. This is not strictly needed, but makes it easier to connect wires and build the prototype before soldering everything in place. You can have it from ebay for 2$
You will need also some Dupont female to female jumper wires for easy connecting and testing of the prototype.


Plug the Loconet shield GCA185 on top of Arduino UNO, and Sensor shield on top of GCA185. Then you have to connect the pins of the PSX joystic to the following Arduino pins if you want to use directly the Arduino sketch I'm providing later on in this post:

PSX pin 1 (DATA) to Arduino PIN 12
PSX pin 2 (COMMAND) to Arduino PIN 11
PSX pin 4 (GND) to Arduino GND pin
PSX pin 5 (VCC) to Arduino +5V pin
PSX pin 6 (ATT) to Arduino PIN 10
PSX pin 7 (CLOCK) to Arduino PIN 13

You can check in this page all information about PSX controller, also how to identify which is the pin number 1 of the connector:

Here you have an image of my temporary connections of the PSX connector and the Arduino Sensor shield for further clarification:


Finally, you need to compile and upload the following sketch into the Arduino board:

To be able to compile the sketch you need to add two libraries to the Arduino environment:

MRRWA Loconet library:
PSX library:

The first one is the library in charge of Loconet communications. You have many examples included in the library. I used of them, Loconet Throttle, as basis for making the current sketch. The example turns the Arduino in a Loconet Throttle receiving the commands through the serial monitor. You only need to change it a little bit to use any device connected to Arduino. In my case I changed it to use a PSX controller, but you can connect a potentiometer, a LCD display and a keypad or anything you imagine to build your personalized throttle.

The second one is a library written by Kevin Ahrendt and based on the PSX communication protocol analysis from Andrew J McCubbin. I also had to do some reverse engineering as this controller is not like the normal ones. And I found the brake throttle is not working properly, some times it is sending strange values. That's why you will find in the sketch some weird code to skip strange values that my controller sends some times. But if it works with my broken controller, I guess it will also work properly with a good one.

If you have any question just comment under the post or open an issue in the GitHub repository. If it works well and you try it, you can also comment.  :P

Saturday, November 26, 2016

First exhibition of ClubNCaldes

Last weekend we did our first N scale module exhibition. It was held in a small town called Sant Fost de Capcentelles, near Barcelona, by the shopkeepers association. This year they choose the slogan "Don't miss the train! Buy in San Fost,  local business". And they asked us to mount our modular layout during the whole weekend.

We were lucky to have a 14 meters long room to mount the layout, as it is exactly the total length of our modules together as we still don't have any curve module. We only had time to make two loops and eight straight ones, and now we have to produce more headers to build more modules. We plan to build some curved ones and a big train station.

The assembly and set up of the modules was pretty fast, it only took us 2 hours to have all them assembled and ready to run trains. There was no problem in the track alignment between modules, and trains ran in a very smooth way between modules. That was the first time we were mounting all our modules together, so the system is proved to be reliable.

It took a bit longer to have the digital part and Rocrail up and running as some modules were not tested and needed to be configured properly. The truth is in the last two weeks all of us had to finish many things and were quite stressed finding were to buy the skirt, how to fix it, installing the electronics in some modules, preparing the Rocrail plan, .....

But, I still don't know how, everything was ready and trains were able to run in automatic mode when the mayoress of Sant Fost came to open the exhibition:

The event was well attended and each of the members had also many visits from friends and familiars who never before had the chance to view the results of our hobby. During all this time I had my modules upside down, pending of decoration, and it was almost impossible to access the garage where I spent so many hours building them.

The digital system has been proved also to be reliable and easy to manage. All of us were able to use our tablet or smartphone to manage trains, lights or accessories of the whole layout. And even our youngest club member managed alone all the traffic with no problems. And everything built by us, only using Arduinos and Open Hardware and Open Software.

Here you can see a couple of videos, one of them recorded with an on-board camera:

We really spend a fantastic weekend, we are looking forward to organize a bigger train exhibition soon, with more modules for sure.

We want to thank this opportunity we had to San Fost mayoress, the Shopkeepers Associacition, and specially to Juan, the most active member of the club who prepared the complete event.

Thanks Juan!!!!