Jump to content

Hornby Elite connected to Arduino to transfer accessory addresses to control point (SG90-Servo)


Toon-833074

Recommended Posts

Dear All, sorry if I start my questions in a wrong chapter. I recently retired and started to build a, long time ago idea, model railroad. I started to use the Arduino to build a simple DCC module. It worked. Now I bought a Hornby Elite and together with using the LaisDCC decoders it still works great. At this moment I am testing to use the Arduino as a programmable controller to control my points (with the ArduinoDCC it works as well). For my point I use the SG90 Servo programmable for every angle. I looked at how the R8245 decoder is connected to the Program Track connections. I use the 6n137 optocoupler to connect the program track power with the Arduino (High Voltage - Low Voltage). When I program for example an acc address 23 using the H-Elite I see the command coming into my 6n137 circuit (led lights up during sending) but the address does not get to the point. Is there anybody who has any kind of experiences of this kind. Super thanks Toon

Link to comment
Share on other sites

R8245 is a Sapphire loco decoder and not suitable for use to power points. I presume you mean R8247 which is the Hornby acc decoder. The default output from this is a 100mS pulse, but this can be adjusted using CVs to give a longer pulse or a steady voltage. If you have the Version 2 acc decoder then the pulses can be configured to vary in number and to operate in various sequences. Servos are not supported.

I think what you are trying to do is use the NMRA accessory command from the Elite to tell your Arduino what to do to your point servo.

The output from the Elite Prog terminals is low potential and will not drive anything. This is a safety measure to protect against poor wiring.

The output from the Track terminals is full potential and can be in NMRA loco command or accessory command format.

You need to have a program (sketch) on your Arduino that converts the Elite command string output, pulse or steady to something your servos shield can use.

I am sorry I cannot be any more help than this but I don’t use servos.

Link to comment
Share on other sites

I have built an Arduino DCC monitor / packet analyser and am familiar with the opto isolator you are using. I am also familiar with the Arduino being used as a DCC Accessory Decoder. I have also used SG90 Servos on my layout but not in your scenario. So I have a basic appreciation of what you are trying to do.

The 'PROG' output of the Elite is dedicated to only provide 'Direct & Reg Mode' programming functions. It CAN NOT provide any DCC decoder operating commands. ALL operation commands are sent to the 'TRACK' output of the Elite. You need to feed the 'TRACK' output of the Elite into your Arduino Accessory Decoder. This will then route DCC Accessory Packets from the Elite at full power into your Arduino project.

EDIT: Rob posted whilst I was typing.

Link to comment
Share on other sites

Dear both,

1st of all super thanks for both your quick replies.

@96RAF, yes you did help me, super thanks, and yes I meant the R8247.

@Chrissaf, Thanks to explain to use the "Track" connection.

I will give this a try.

To get a better understanding of what I (a fully starting learning curve beginner) am trying to do, maybe I can direct you to some youtubes I am watching.

"Rudysmodelrailways" for me this persons is explaining in a very clear/understandable way and is helping to get people like me super enthousiast to make this "hobby" (spending more time than during my carier) an every day's job.

YouTube "Fun with Arduino 29 DCC Accessory Decoder" (LEDs)

YouTube "Fun with Arduino 30 DCC Accessory Decoder" (Servos)

I have downloaded the Demo version of "TrainController" to controle my layout.

Connected to the Hornby Elite All trains are perfectly running using the Traincontroller trottels.

Now I want to define a point with for example the address 22.

And if I test this point by switching on - off the actual point in my layout should switch.

YouTube "Traincontroller 03 Create a Switch Panel"

My big questions is:

Is this possible (I will let you know if the connection to the "Track" is working) or am I dreaming with too much info from the YouTube.

Again super thanks,

Have a nice weekend,

Best Regards,

Toon

Link to comment
Share on other sites

Just had a thought. It may be that you are not UK based. If that is the case, then maybe the site content is being blocked to you for some legal reason.

Link to comment
Share on other sites

Dear Chrissaf and 96RAF,

Super thanks for your new thoughts.

I tried to use a VPN and logged in via an address in London.

But this did not make any differences, for example:

Under “Hardware”

The Arduino Microcontrollers: 2x movie works OK.

Sensors: 2x videos works OK.

5. Introduction to URB system Interloc works OK.

Turntable small works OK.

DC stepper motors: work OK.

Stepper motor 28BYJ Not Working?

Power: Not Working.

And under “Applications most are also not working.

But there is enough to read,

Thanks, Toon

Link to comment
Share on other sites

Dear Chrissaf and 96RAF,

I am trying to understand the process how the controls get to the devices locomotives and accessories lights and SG90 servo’s.

For the locomotives I think I understand because I have all working;

The decoder from the locomotive is programmed through the Hornby Elite or in my case I did setup the locomotive decoders (LaisDCC) through a Arduino-DCC system and used the JMRI Decoder pro, because the programming went much easier and quicker.

The Locomotive decoder has all these setting in memory and any system can send commands to the decoder.

The locomotive control's go:

from for example the PC-TrainController

  • select an locomotive decoder address
  • and use the signals like lights / speed / forward / reverse etc

Through the Hornby Elte

The Hornby is needed because of the track power to the track is needed to transfer the power and signals to the locomotive

And the locomotive obeying all control commands.

Results locomotive is fully controlled by the PC-Traincontroller.

But how does this take place with the accessories?

I did run into the Acomora option.

I did see a serie of 5 YouTube videos, where is explained how to setup a Arduino UNO or a DCCNext box.

I did use an Arduino UNO and installed the MARDEC software.

I am able to configure several servos and all work using the MARDEC software on the Arduino.

But now it gets a bit unclear for me?

The Servo address is stored in the Arduino/Mardec unit?

The angle(s) are also stored in the Arduino/Mardec unit?

Now I create a point in the TrainController software with the same addresses used inside the Arduino/Mardec.

Q1:

Do I need the Hornby to get this command to the servo through the Arduino/Mardec unit using the “Track” output connected to the 6N137 and using the PIN-2 of the Arduino board?

Q2:

OR do I use a 2nd USB connection and use the “setup Digital System” EasyDCC option.

Note: when I press connect, I see communication on the Arduino/MARDEC.

But I cannot switch the servo’s when I use the operate Icon and click on the Point with the corresponding address for example 22

If you know what I am missing that would be very super.

Thanks in advance,

Toon

Link to comment
Share on other sites

I cannot provide you with the detailed level of support you require. Firstly, I have no experince of TrainController software nor the Mardec software you have mentioned. None of these systems are Hornby products which this forum is focused on.

In my opinion, you are more likely to get success using the connectivity described in your Q1 text section if I assume the Arduino device is configured as an 'Accessory Decoder' device.

Link to comment
Share on other sites

I cannot help with a detailed step by step either, but with any DCC set up using software such as iTrain, TrainController or Rail-master (RM), the software package is the graphic interface between you and the device generating the DCC command (the controller). The controller usually provides track power and also passes the commands to the track bus where it is picked up by the decoder be it a loco or accessory.

In your case the Elite is your loco controller and the Arduino is your servo controller.

NMRA specifies how the binary command string is assembled to let the controller send either a command for a loco or accessory. This is what your Arduino setup must emulate - the accessory command string.

As you can only have one controller connected to a bus then you will need two separate bus’, one for the track controlled by Elite and the other for the accessories controlled by Arduino. In that case you can have the additional interface by USB to the software package and this is exactly how RM works with twin controllers.

I presume TrainController can also be setup to run two controllers. I know Rocrail can.

If you approach the problem from these two sides you may get it sorted.

Sorry that I cannot help further with servos but either RogB or Rog(RJ) on the forum uses servos as I remember and may be able to offer some further advice.

Edit - to strike through Rog(RJ) - see his post below.

Link to comment
Share on other sites

Yes, I have used the MegaPoints control system for my servos on my previous two layouts and will again on my embryonic one - assuming I can remember how to put it all together from its current state of disassembly. It is a separate entity in terms of power and has a DCC connector so the controller [Elite in my case] can send commands via the bus.

Here is a link to the connector.

DCC Module – MegaPoints Controllers

R-

Link to comment
Share on other sites

Good morning Chrissaf,

Maybe my questions were not correct.

I have a Hornby Elite that is functioning very well.

This must be the centre of my railroads.

I am still looking what is the best way to use the servo's on my railways, because to my inexperienced mind they are "easy"to control and simple to be placed on the point.

I am testing the Traincontroller Demo software just because I could programm the Hornby Elite and this is working.

What Software would you advice?

May I ask you how you are using the 6n137 optocoupler with the Arduino DCC Accessory Decoder?

When I for example look at the link from 96RAF on the 1st page "Plans" (middle of the page) there is a bigger drawing of a plan with lights and 3x servo's.

Noot: 2x of the connections are wrong coloured. Servo A = OK Servo's B and C have the 5V and the Signal colours wrong swapped.

A little bit below this plan you have 3x URB units, I see that they use the SDA and SCL lines to connect the units.

What I do not see, maybe I am not looking good enough, or is explained somewhere else, How is the Track Power of the Hornby connected.

And my 2nd Q. is How is the command signal(s) handled in the sketches?

If you switch a point by using (TrainController or from the software you are using) the software, How is this effecting the for example the Servo-B in the layout?

Maybe you have some links (videos with voice) for complete drawing where I can buil;d my knowledge with.

Again super thanks for your time and help.

Toon

Link to comment
Share on other sites

Dear Chrissaf,

Re-reading my txt, I asked again a wrong question.

I understand where the Track Power is connected.

I wanted to ask How is the command signals that are superimpose on the Track power (at least that is I believe it is working) handled in the sketches?

Sorry for my not 1st english txt.

Thanks,

Toon

Link to comment
Share on other sites

This links to another DCC servo controller and there are several links on the page, by looking at the manual it will explain how it works direct from the controller.

Servo Controller (train-tech.com)

Although seen controlling a road crossing it also talks about using loco and accessory and manual control methods.

Using this or the Mega Points device will make your Arduino (and TrainController software if not needed for other things) redundant.

You will also only need one power bus - Elite to the track. Elite will send accessory commands and the device above will make this into a servo command.

Link to comment
Share on other sites

May I ask you how you are using the 6n137 opto-coupler with the Arduino DCC Accessory Decoder?

 

 

I did state in my previous reply that I was using an Arduino [with the 6n137 opto-isolator] as a DCC monitor analyser [this is also a Rudy's Arduino project]. I am not using an Arduino as an Accessory Decoder nor a Controller. I also stated that although I use SG90 Servos, I don't use them in your scenario. In other words I am not using my SG90 servos to operate points, they are not being controlled by an Arduino either.

I am not familiar with the Train Controller or specific Arduino sketches you are using, so as I said earlier I have exhausted my ability to resolve your issues.

I am aware that Rudy has documented an Arduino based 'Accessory Decoder' but it is not clear from your posts as to whether this is the Arduino project your are building as you keep mentioning Mardec software which I have never heard of.

In principle, the Rudy Arduino based 'Accessory Decoder' is not a controller, the terminology is important to appreciate here. A controller generates DCC commands to operate something. An 'Accessory Decoder' receives DCC commands from a Controller and then implements the DCC command instruction.

The following section is just based upon assumptions and guesswork as I am not at all clear on exactly what you have built with your Arduino.

There is some confusion as to whether your Arduino project is an 'Accessory Decoder' or a 'Controller'. If it is an 'Accessory Decoder' then it receives DCC command packets from the Elite controller using the NMRA Accessory Packet format via the 'TRACK' output of the Elite. The 'Accessory Decoder' sketch then translates those Accessory Packet commands into an action i.e in your case operate a Servo left or operate a Servo right.

If your Arduino project is a 'Controller' then it probably shouldn't be physically connected to the Elite at all, but instead be controlled by TrainController as a separate controller interface. Thus the TrainController talks to the Elite to control locomotive decoders, and TrainController talks to the Arduino Controller to operate accessories such as your Servos.

As I have already stated, I have exhausted my ability to assist you further as your project has gone beyond my previous basic Arduino experience.

Link to comment
Share on other sites

Dear ALL, I apriciate all your comments very much. As I mentioned before I am in a very early learning stage.

Sorry for all my mis-used wordings like controller and decoder.

@Chrissaf, Thanks for your clear explanations.

I will work on the links/info I got.

I will keep you posted on how things are developing.

Again super thanks for all your inputs,

Best Regards,

Toon

Link to comment
Share on other sites

Hi Guys,

Now I understand why you did not understand my questions/problems connecting through the Hornby Elite.

I just recieved an ordered ArCoMoRa decoder box.

https://www.arcomora.com/dccnext/

And it is too simple to not understand the process.

A good 16 channel-decoder (incl 16 Servo's) for only EUR 10,- as a DIY package or around EUR 30,- as a complete ready to use box.

  • Using the TrainController software on the PC.(make sure that you configure all Train and accessory addresses on the Hornby Elite com port in "setup")
  • Connect to the Hornby Elite via the USB.
  • Connect the Hornby Elite "Track Power" to the DCC input of the ArCoMoRa.
  • Connect the ArCoMoRa Servo power on a separate 5V power-supply.

note: before connecting - Program the ArCoMoRa via the smal USB via the MarDec software. You have to disconnect this small USB before you connect the ArCoMoRa decoder to your layout.

You can use the link on a previous post, it is all very well explained.

I'll be busy for some time to have it all inplemented because I do not have the track ready yet.

If you need some help, please let me know.

Have a lot of Train fun.

Thanks again for all ideas and help.

Toon

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
  • Create New...