DCC Controller or Interface.

Hi there everyone let me first start by introducing myself and what I can do and or know. My name is Nathan James I am an 18 Year Old Male from the "Sunny" United Kingdom :P I have always been interested in electronics and programming since I got my first computer aged 5. Of course at that age I had no idea what it was or how it worked I just liked messing around on paint and eventually went on to learn how to install onto a computer. Yes this is simple but I was 5 :) Ever since I got a computer it sparked my passion for everything computers I was learning all I could as I grew up about computers and by 8 years old I was scripting for games and making mods for the very popular GTA San Andreas. After many years passed however I got out of the epidemic of computers for a year as my cousin was always Xbox mad and never had a newer PC of my own. Following from that however I got my very own gaming pc from my uncle and at the time it was the dogsbo***x to me and you now days however it is absolute rubbish anyway how did I get into an Arduino and wanting to program my own stuff ? Well that is simple once I was hooked I couldn't stop I wrote basic scripts at the time for games to make trainers or other simple stuff which now I wouldn't know where to start because following learning there became a family issue my uncle developed cancer so for the following past 2-3 years from age 12 I was always around him helping out and just hanging out because we didn't know when he was going to pass. Anyway this set me back from learning because he is way more important to me that free time hobbies etc so I forgot everything I had learnt and had to start a fresh this was when I got into hacking. Now hacking you might look down on huh ? well I actually wanted to learn to hack for a reason and that is I aspire to get a job in pen testing industries testing for governments and large companies. Aged 16 I left school as you do in the UK and went to college to learn a few main areas of key interest. 1 was to learn networking the modern day standard of it anyway. 2 Was programming such as the 4 key areas been hardware and software development and hardware and software programming. In college during networking we learned alot to do with hacking and pen testing and also how to re program server stations or program CPU's to perform different functions. Another key area of mine was Game design and dev I wanted to take out level design etc. So leading this where did Arduino come in ? well I have always know about Arduino and lately Raspberry PI came out but the color of the PCB funny enough put me off the green PCB reminded me of the old el cheapo PC motherboards. So here it comes I went to Maplins hoping to find a Logic IC with I/O and a programming board to program them. Why do I want this ? Well I also have a model railway and it is controlled by DCC if you dont know DCC just google it, in basics each train has a decoder in which you can program a custom Address to it and other Control Variables. Say I give my first train Address #0001 then in the dcc system I would push Loco select then key in the address of the loco I want to control and so forth pressing enter on the system allows me to control that locomotive only. The pros of dcc are that you can run multiple trains on one piece of track or one layout without been limited to one train per track and one controller per track. So what do I want to achieve from all of this ? Well JMRI (JavaModelRailroadInterface) Is a free piece of software for controlling DCC equipped trains from your computer but you need an interface to convert the signals to correct DCC signals for the trains to understand. So my main question is if anyone has done this before how can I do it ? I want to select my locomotive in JMRI e.g: loco 0001 and then set it to go forward. The JMRI would send data out the usb on the correct com for the Arduino UNO and the Arduino UNO would be the interface between the PC and the actual Layout itself basically converting the signals from the pc to the correct DCC signals for the trains. Power is not an issue as I know you can use a ready made DCC booster from the signal outputs of the Arduino to amplify it to enough Volts and Amps to run the trains.

So hey everyone sorry for the long ramblings and all DCC ideas welcome I would love to get my layout controlled by a PC and Arduino and I know there are cheap easy alternatives such as a Sprog 3 its a DCC interface for use with JMRI but I want to make my own with Arduino and plus Sprog 3 is £60 where as Arduino is £24 giving me 2 DCC systems if I can get it working for the price of one :)

Google 'MERG', the Model Electronics Railway Group. They're into DCC in a big way and may be able to help you. I don't know how much Arduino stuff they know, though.

Henry_Best: Google 'MERG', the Model Electronics Railway Group. They're into DCC in a big way and may be able to help you. I don't know how much Arduino stuff they know, though.

Hi there Thanks I know about MERG but didnt know if they would know about arduino I have seen some projects but all were very basic command stations etc. I need to make my arduino an interface basically like the SPROG 3 but I will try contact MERG maybe and see what they know. Cheers

There is a very good thread on the RMWeb forum about Arduino and DCC with code. This is a current thread so you should be able to ask questions. And if you search I think you will find other relevant threads.

http://www.rmweb.co.uk/community/index.php?/topic/78578-dcc-controlled-peco-turntable-project/

...R

Hey thanks for the link ! I am a member of RM and never thought to check there :) I have bought a second UNO and a breadboard to test on :) my projects are arduino DCC and the spare board will be used as a signal controller so if it detects voltage on an input the output will start a sequence of red light then when the voltage is removed it will go yellow and back green etc.

Okay got myself a DCC library but have no idea where to start :( all I want to do is send signals from my pc via a pc program like Rocrail or JMRI and then have my baby arduino convert them to dcc packets for the trains to get controlled I will use a booster for the powering of the trains as arduino is ofcourse only 5v out

I confess I didn't read your long original post carefully and I assumed you wanted to create an Arduino device that would decode DCC signals rather than a device that would create them.

I'm afraid I have no idea what DCC signals are like as DCC is history and battery powered radio control BPR/C is the way forward. See for example http://freerails.com/view_forum.php?id=45. Sorry, I couldn't resist :)

I presume there is a document on the web somewhere that defines the DCC system.

...R

Haha its okay :slight_smile: at least you now know my anticipations :). Yeah I need something that can generate the signals from JMRI so i push function one for loco 1 and and it tell that loco to start the engine as a standard DCC controller would. The reason I havent bought sprog yet is so I can make myself build my own and then market them for less than a SPROG maybe or alongside SPROG.
If you know alot about Arduino programming I would appreciate it if you could possibly help me figure out what order to put my DCC Library in as I have a DCC Library to use just dont know how to order it all to generate DCC Signals from computer commands.

nathan9117: Haha its okay :) at least you now know my anticipations :). Yeah I need something that can generate the signals from JMRI so i push function one for loco 1 and and it tell that loco to start the engine as a standard DCC controller would.

What you need to know is the signal(s) your Arduino would have to send to the track to accomplish that. Until you know that, we're all going to be guessing in the dark.

nathan9117: Haha its okay :) at least you now know my anticipations :). Yeah I need something that can generate the signals from JMRI so i push function one for loco 1 and and it tell that loco to start the engine as a standard DCC controller would. The reason I havent bought sprog yet is so I can make myself build my own and then market them for less than a SPROG maybe or alongside SPROG. If you know alot about Arduino programming I would appreciate it if you could possibly help me figure out what order to put my DCC Library in as I have a DCC Library to use just dont know how to order it all to generate DCC Signals from computer commands.

Are you going to share the profits with us? (But not the costs, thank you).

...R

Robin2: DCC is history and battery powered radio control BPR/C is the way forward.

It just might be, but for that one seven-letter word starting with "B". :D

Paul__B: It just might be, but for that one seven-letter word starting with "B". :D

I'm intrigued, but I don't understand.

I presume you mean "Battery"?

I have 3 N-Gauge locos that run on batteries and I am converting a 4th.

...R

Well I got an arduino library with DCC Producing signals but it was a test code so it only controlled a DCC train on a set number like programmed address 03 or whatever I typed into the program then uplaoded. It is controlled via a pot and switch on the arduino so it is a start as it is outputting DCC signals but I want to add a keypad and a screen and rotary knob to make it into a full functioning DCC command station. I also am making an arduino quad copter with my 2nd arduino in the meantime :) gps controlled from my pc etc.

Since my earlier posts here I got involved in a DCC decoder project in RMWeb here. It's in Post #33. I'm not sure if it is of ant interest.

Can you post the code you are using now, or a link to it. If the code is long it is easier if you add it as an attachment. If you are using a DCC library please post a link to where that comes from also.

Adding the options you mention should not be too difficult.

...R

Hi Robin I will link you with all the details once I am home from work :) sorry for the late reply I have been too busy working 3 jobs :D LOVVEE IT :( not.