Thursday, December 19, 2013

Station Announcer running in a protoboard

I'm still waiting my Arduino UNO to arrive, but meanwhile I did some successful tests with a NANO.

If you followed my previous posts, I tested an MP3 shield for Arduino communicating via hardware serial:

And later, I ran a Loconet serial monitor also on Arduino to intercept the Loconet bus messages:

Now I joined both experiments and changed a bit the source code to play a different MP3 file assigned to each activated output. Each time an output is activated, I play the same MP3 file number. The speaker you see has been taken from an old computer:

I activate the output through Intellibox keyboard, but it also works activating an output from the computer.

Now I have to wait the Arduino UNO and the numpad, and make a clean source code. The goal is to activate a sound typing the sound number in the numpad or via Loconet assigning a digital output to each file.

I hope to post the final result soon!!!

Sunday, December 8, 2013

Station Announcer: Loconet Interface for Arduino

Let's go for the second part of the project: Loconet Interface for Arduino.

I found a very interesting page talking about a Loconet Shield for Arduino. It's (SPCoast, Railroading on the Southern Pacific Coast). They developed a shield for Arduino called LocoShield and wrote the needed libraries. In this page you can find all the information (electrical schema, Eagle files, Gerber files for fabrication...):

And it looks like this:

The software (Arduino libraries and examples) are published in the MRRwA Project SourceForge Project:

But unfortunately they don't produce the boards and nobody sells them, and the price to make just 5 or 10  is too expensive. Just if more people would be interested for a total production of 100 or more, then it would make sense. And I don't want to isolate my own boards because I never did it and I'm not skilled.

 Another problem I saw is the power source. Arduino and MP3 Shield need 5Vcc to function and I can't take them from Loconet wires, and there is no 5Vcc power source supply in my layout... or there is? If I well remember, Peter Giling boards (the ones I use in my layout) have a different Loconet connector with the common signals of loconet plus 5Vcc to feed directly his interface boards through the same Loconet wire. GCA101 is the Ethernet-Loconet interface plus 3Amp power source of 5Vcc to feed all loconet boards (GCA50). So I have it!!!

Then, it would be greate to feed also Arduino from here and avoid more wires and power sources. Looking closer to the GCA50 electrical schema, it's almost identical to LocoShield from the Loconet DB9 connectors to PIC. The board feeds the PIC16F873 with 5Vcc taken from the DB9 Loconet connector, and converts the Loconet signal to a PIC readable TTL serial, exactly what I need also for Arduino and what LocoShield does.

Then that's the right solution: using a GCA50 board without the PIC as a Loconet interface for Arduino. I only have to mount the electronic components of the board from the DB9 connectors to the PIC. And I take the serial RX/TX signals and the +5V and ground signals from here to Arduino. 

Just to test the idea, I took a GCA50 completed board and removed the PIC. Then I connected the RX/TX serial signals to pins 7 and 8 in Arduino (these are the pins used as soft serial by the LocoShield libraries):

I uploaded the Loconet Monitor program that comes with the Loconet libraries, and voilá!!! I can monitor all the traffic of the Loconet bus:

And now the job is almost finished. I can manage the MP3 shield through the hardware serial of Arduino, and read all the events of the Loconet Bus through a soft serial of pins 7 and 8.

In the next post, I'll show you everything integrated, running and playing the station sounds I want selecting an output in my Intellibox or my PC (Rocrail).

This post references and merits:

MRRWA (Model railroading with arduino):
Peter Giling boards:

Friday, December 6, 2013

Arduino Project: Station Announcer

I'm starting a new project, a "Station Announcer". The goal is to have a device able to play the station announces for the different trains arriving and departing to and from each track. I'm also very interested in Arduino, a very cheap and powerful programmable board that can be used to realize almost any imaginable invention.
Estoy empezando un nuevo proyecto: el "Anunciador de Estación". La finalidad es tener un dispositivo capaz de reproducir los anuncios de los diferentes trenes llegando y saliendo a cada via de la estación. También estoy muy interesado en Arduino, una placa programable muy barata y potente que puede usarse para realizar casi cualquier invento imaginable.

The main requisites for it are: Los principales requisitos son:

* Usable for both analog and digital layouts. Debe funcionar en ambos analógico y digital.
* Digital layouts using Loconet bus, and analog connecting a numeric keypad to choose the announce to play. En maquetas digitales comunicando por el bus Loconet, y en analogicas mediante un teclado numérico
* Cheap, and based on open standards. Barato, y basado en estándards.

So Arduino is a good base to start from. For those who knows nothing about Arduino, it's an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for anyone interested in creating interactive objects or environments. It's programmed in C language, through a very easy-to-use and simple interface.
Así pues Arduino es una muy buena base por la que empezar. Para aquellos que no conozcan Arduino, es una plataforma de prototipaje electrónico open-source basado en un hardware y software flexible y fácil de usar. Está enfocado a cualquiera interesado en crear objetos o entornos interactivos. Se programa en lenguaje C mediante una interface muy sencilla.

There are several version, from Ardunio Nano (1x4 cm) or Arduino UNO (with standard connectors to pile shields on it), to Arduino Mega with 4 serial ports, 54 I/O pins and 16 analog I/O. And people have developed expansion boards (shields) for almost everyting. There are ethernet, wi-fi or bluetooth shields, and others to control step motors, servo motors, relays... and finally sensors of all kinds (smoke, distance, rfid,...). It's just something crazy.
Hay distintas versones, desde el Ardunio Nano (1x4 cm) o Arduino UNO (con conectores estandard para apilar shields), hasta el Arduino Mega con 4 puertos serie, 54 E/S digitales y 16 E/S analógicas. Y hay tarjetas de expansión (shields) para casi todo. En comunicaciones, hay ethernet, wi-fi o bluetooth. Otros para controlar motores paso-a-paso, servomotores, relés... y finalmente sensores de todos los tipos (humo, distancia, rfid,...).

All information can be found here:

My first tests have begun with an Arduino Nano (7$) and a MP3 shield from Elechouse (21.5$). I'm still waiting my Arduino UNO development kit to arrive.

I've been testing the MP3 library, and it works perfect. The board can play music from a USB stick, a memory stick or the internal memory with 64Mg of space. That last one not very large but with a very fast access. The board can communicate through the serial port or through a soft serial in pins 7 and 8.
He estado testeando la libería MP3, y funciona perfectamente. La placa puede reproducir MP3 de un USB, un memory stock o de la memoria interna de 64 Mg. Esta última muy reducida, pero con un acceso muy rápido. Puede comunicar tanto por el puerto serie como a través del softserial asignado a los pins 7 y 8.

This is the first successful test, assigning an input to a mp3 file:

In next steps I'll work on the Loconet interface. En siguientes pasos, trabajaré sobre la interfaz Loconet.

Sunday, November 17, 2013

Funifira 2013

Funifira is a small exhibition done every year in the little town of Gelida, at 40 Km far away from Barcelona. Despite it isn't the biggest one, for me is the most funny and the only one where my couple and friends want to come. This is because it isn't related only to trains, but also to all kind of hobbies (slot cars, remote controlled ships, submarines, airplanes, helicopters, ...) and the best thing it's also a gastronomic exhibition where all restaurants and wine and cava cellars show their products. So it's a good place not only to see trains, layouts and modules but also to eat and drink good products at a reasonable price.

The name of "Funifira" comes from the funicular (called Funi colloquially) and "fira" which is the translation of exhibition.
Let me show you firs some photos from the module encounter, one of them digital:
Funifira es una pequeña feria que se hace cada año en la población de Gelida, a 40Km de Barcelona. Aunque no es una de las mas grandes, es para mi la mas divertida y a la que tanto mi pareja como amigos quieren venir. La feria no es únicamente de trenes, también hay representación de muchos otros hobbies (coches de Slot, control remoto de barcos y submarinos, aviones, helicópteros...) y lo mejor de todo, es también una exibición gastronómica donde los restaurantes y las bodegas de cava y vino ofrecen sus productos. Así pues es un buen sitio para ver no solo trenes, maquetas y módulos, también para comer y beber buenos productos y caldos a un precio razonable.

El nombre de "Funifira" viene del funicular de la población ("Funi") y "fira", que es feria en Catalán.

Os muestro a continuación algunas fotos del encuentro de módulos, uno de ellos en Digital:

A think that surprised me very much, a new module (still under construction) using Japanese buildings, and with the signs in Japanese.
Me sorprendió encontrar un nuevo módulo (todavía en construcción) que usaba edificios Japoneses, con los carteles también en Japonés:

There was also a NEX train running (the one going from Narita Airport to Tokyo), but I couldn't find the owner to search if there was another Japanese modeller:
También había un tren NEX (el que va del aeropuerto de Narita a Tokyo), pero no pude encontrar el dueño para ver si había por ahí otro ferromodelista Japonés:

There were also many exhibitors. I stopped in front of this one who has a lot of decoration articles:
Había también muchos estands, paré en frente de éste que tenía muchos artículos de decoración:

And the best thing to complement a morning with trains, eating and drinking!!
Y lo mejor para complementar una mañana de trenes, comer y beber!!

Buying the ticket for wine tasting, you get for free the wine glass with the logo engraved:
Comprando el tiquet para degustar los vinos, te regalan la copa con el logo de la feria grabado:

And to finish, a ride in the Funi (this day is for free) before coming back home:
Y para acabar, coger el Funi (es gratis este día) antes de regresar a casa:

Sunday, November 10, 2013

"Saló del Manga" exhibition

Sorry for another post not directly related to trains, but related to Japanese culture. Last week was the "Saló del Manga" exhibition in Barcelona, an awesome, crazy and big event where people from all Spain and abroad come to see.

This year has grown more than ever, it was done in Montjuic Exhibition Centre. That's one of the biggest places in Barcelona for exhibitions. Also the Motor Show, Comic, Sonimag Photo & Multimedia and many more take place in this area. And some days there was a 5 hours queue to access, so I heard for next year they are searching even a bigger place.

I'm not an "otaku" or a big Manga fan, despite I like it. It's a big Japanese phenomenon and the "entrance" for many people to know Japan and its language and culture, but it's also a bit sad when you know people stuck on it and they really think everybody in Japan practice "cosplay" every weekend and nobody reads something different there.

Anyway, a funny exhibition and a lot of interesting people there.

There are a lot of stands selling all kind of merchandising. Be careful because prices are inflated in some exhibitors because they know people come ready to spend money from places where manga shops don't exist and these kind of goods are difficult to find. If your really plan to buy there check everywhere and wait until the last day when you can negotiate some discounts, but with the risk that big deals have disappeared.

And if you really want to find good deals, search in during some weeks before the event. Many people sell their old collections, figures or DVD to buy new stuff in "Saló del Manga".

Next one is the exhibitor I never miss: CineAsia ( They have a huge catalog of Asian films and all the new stuff, Spanish or original versions.

Take a look always around you, some "cosplay" are really amazing:

There's also place for Japanese sports and other cultural aspects, like the Kimono Club of Barcelona ( dressing people in this traditional way:

It's also possible to get signatures from famous singers, writers, cartoonists or manga producers like Daisuke Nishio, the Director's assistant of Dr. Slump in 1982 or later in Dragon Ball Z:

And finally, why not to have a funny picture with your favorite character???

Some of the stuff I bought there, I really recommend you Kenshin film!!!!

I'll wait for next year to have new films and books!!!!!

Saturday, October 12, 2013

Tomytec Station A

I needed a small rural station for my layout, and decided to buy Tomytec Station A.

It's a nice kit already painted and weathered, nice detailed. There is no need of glue to mount.

All pieces assemble perfectly. I just used glue to fix better fences and small details.

For lighting, I took my fantastic Chinese book of SMD led and resistors that I bought in ebay for no more of 30€. There are thousands of resistors of all values and also a great range of capacitors. Leds are from LedBaron, also in Ebay. It's a bundle of sunny, golden and super golden white leds, plus some red and two-tone red/green.   

I also have special brass strips to mount led and resistor. These strips are really handy and you can bend them to fix it in any position.

After measuring the needed length of the strip, I made a small cut to place the resistor on it.

With a very thin tin wire prepare the place for SMD components:

About SMD leds, they seem very hard to solder because they are really small. But the only difficult thing is not to loose them. I always need more than planned because one of them falls in the floor or gets lost under the junk of my table. Under the SMD led there is always an arrow, it shows the polarity:

And finally that's the mounted led strip:

And the final results in the Tomytec Station A:

I'll add some aluminium foil next to the lights because is's too visible through the walls, but nothing else to add. A nice and easy kit.