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
And it looks like this:
The software (Arduino libraries and examples) are published in the MRRwA Project SourceForge Project: http://sourceforge.net/projects/mrrwa/
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): http://sourceforge.net/projects/mrrwa
Peter Giling boards: http://www.phgiling.net