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.

Sunday, December 8, 2013

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 www.scuba.net (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...): http://www.scuba.net/wiki/index.php/LocoShield

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).

Friday, December 6, 2013

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.

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.