Skip to main content

Hello;

 
I am considering automating my holiday layout and would really appreciate a sanity check. Its just a couple of loops controlled conventionally: (http://www.youtube.com/watch?v=TR3p-7sgGQ8).
 
My assumptions are that I could drive the automation with an Arduino setup (I am a software developer). The Arduino board would probably need a DCS TIU to control track voltage. It could connect to the TIU serially but I'm not sure how to find the instruction set to send to the TIU?
 
Hopefully the TIU could power each loop using the existing MTH brick + CW80. Next step would be to look at adding an AIU for switch control which would also require additional instructions from Arduino over the serial TIU connection.
 
Any advise, experience or information before purchasing all the hardware would be greatly appreciated.
 
Thanks,
John 
Original Post

Replies sorted oldest to newest

Since the interface to the TIU is not documented, that will involve some heavy lifting.

 

The TMCC instruction set for computer interface is documented in the Lionel publication Trainmaster Complete Guide to Command Control so it may be a better candidate for automation.  For that you'd need the following equipment.

 

Lionel TMCC Command Base, Two Lionel PowerMasters, and You'd probably also want a Lionel CAB1 Remote

 

If you have a Legacy system available, you can use the same command set and a pair of TPC300 or TPC400 units instead of the PowerMasters.

 

I really don't quite understand why you think a TIU is going to be an integral part of your "conventional command control" operation.

 

If you want to have some home-brewed, computer-like device control track voltage, I expect there's a much simpler way to do so then having it control a TIU, which is essentially another computer. Just have it directly raise and lower track voltage, and ring the bell and blow the horn/whistle.

Last edited by Barry Broskowitz

What exactly are you trying to automate? 

 

If you can't find an off-the-shelf Arduino triac shield to give you AC voltage control, you can use inexpensive diodes in conjunction with relay modules (about $2 per channel on eBay) to step the track voltage. If you are a programmer it shouldn't be hard to create a binary relay ladder to give, say, ~1V steps which is probably more resolution than you need for a Christmas layout.

 

Do you need feedback to change modes when trains reach particular points?

Thanks for the replies. Gunrunnerjohn confirmed one of my main concerns about the undocumented TIU interface. RJR hit on another in that I have no experience building voltage regulation circuitry and don't want to add another set of unknowns. The TIU also looked tempting since it has 2 variable outputs and I am only looking to drive 2 loops.

 

To Stans point, I would start with the simple outer loop and just have the train pull in an out of the station on every 3rd pass. So I would be learning to use the Arduino to control track voltage and work with position sensors. Then add bell and whistle effects to learn those commands. Then take what I have learned to the inner line and add switch controls next. Diodes, relay modules and binary relay ladders are a long way from the web code I usually write in Java, C++ and various other languages or even the assembly code from my early mainframe days. I'm willing to give anything a shot if I can get a reasonable understanding of whats involved before I jump in.

 

Thanks,
John

If the lack of documentation nixes the DCS/TIU approach, you might want to re-post in the Electrical Forum to access more viewpoint.
 
Originally Posted by gunrunnerjohn:

Great idea Stan, here's one Arduino module that will control the power: http://www.inmojo.com/store/in...mer-module-lite-v.2/

 

What's curious about this triac module is in the Q&A what appears to be the seller says the module only works to control AC voltages above 100V...in other words wall-outlet voltages.  If that's the case, I'd look elsewhere; plus, $40 per channel plus shipping seems somewhat spendy (IMO).

 

But for what you're trying to do, a controllable triac module is conceptually what you want.  The track voltage controllers you're presently using are triac modules with buttons and knobs to manually change the on-off switching times of a triac.  So voltage is controlled by changing the % of time that the triac passes through the AC voltage.  The whistle/bell are fired by increasing the % of time that the triac passes the positive/negative half of the AC voltage relative to the negative/positive half.  If you're a web code programmer, you'll need to bone up on, say, interrupt handlers and other real-time code methods since triac events must run exactly synchronized to the line frequency - 60 times per second at minimum.

 

Someone has probably already done this but a potential hack is to use MTH's 50-1012 remote control and lock-on (which is essentially a triac module) shown as the right 2 items in the photo below.  $60 MSRP and maybe half that used on eBay.  You would need to emulate the infrared control codes that are sent to the receiver (the item on lower right of photo) but this is something any Arduino could do driving an infrared LED on a digital output line.

 

 mth lock on

The diode method of reducing AC track voltage is described by contributor Dale H here.  With relays driven by Arduino digital output lines you can select which tap or reduced voltage is applied to the track. As you get above a few selectable voltages, it becomes more practical to use a binary ladder to switch in combinations of voltage drops.  Say you have SPDT relays which either pass or drop 1V, 2V, and 4V.  With just 3 digital output lines driving 3 relays you can select from 8 voltages.  Additionally, relays can be used to insert more diodes in one direction or the other to offset the polarity of the AC signal and thereby fire the whistle or bell.  Suitable diodes are, say, 25 cents a piece.  Here's an eBay photo of a 4 channel relay module that's less than $2 per channel.

 4channelspdt

 

For sensing position of a train, some of the guys will suggest using the isolated outer rail method.  The track type you are using can make this method easy or a hassle. One simple alternative for a fixed configuration like yours is to simply put a magnet on the bottom of the locomotive and a magnetic reed switch on/under the track.  A magnet/switch would run about $1.  If you put a locomotive magnet/switch on the left side of the track and a caboose (or end of train) magnet/switch on the right side of the track, you can sense when the entire consist passed by. This method could also sense direction of travel which would allow you to detect and reverse a backward running train if your conventional reversing unit does not have the ability to lock direction in forward.

 

Attachments

Images (2)
  • 4channelspdt
  • mth lock on

Great info Stan. The 50-1013 lockon approach allows me to focus on the Arduino control aspect while using a command set that should be simpler than learning the underlying electrical signal details.

 

My nature is generally to build from scratch and enjoy the details but in this case it may be smarter to crawl before walking. I think this sounds promising enough to go look for a couple of lockons and maybe I can use one remote to "capture" the IR signals I'll need to generate.

 

Thanks,
John

agreed gunrunnerjohn. A powermaster for each loop could do what I want but my understanding is that the cab 1 remote communicates directly to the powermaster at 26.75mhz. Not sure how to mimic that signal. Also the powermasters are available while the 50-1013's are looking less so. Not sure which way to go yet, but I appreciate the input and I'll keep researching.

 

Thanks,

John 

Well, not a powermaster, you need to use the TPC as it talks to the command base.

 

Truthfully, the Legacy PowerMaster looks like a real good bet with the TMCC command base.  Documented interface for the TMCC commands, and the Legacy Powermaster receives track commands so it doesn't have the RF dependency like the old PowerMaster.

 

A pair of Legacy PowerMasters and the TMCC command base (or Legacy system) would do the trick here, and you could be working on the actual program right away, not decoding IR signals and trying to interface to that.  Also, the 50-1013 unit all receive the IR signal, there is no "channel", so you'd also have to be careful about placement and directing the IR signal only to one of them.  Finally, they don't have the same power handling capacity of the Legacy Powermasters.

 

For a system that has expansion capability, and will be far more reliable, I'd go with the Legacy Powermasters and either TMCC or Legacy.

 

I absolutely agree with GRJ about the value of documentation and hence how you spend your programming time and money.  But to keep the dialog going which may stimulate other ideas/methods...

 

Here's a photo of the guts of the 50-1013 track lock-on.  One possible advantage is size.  You could remove the track-specific connections on the right side and directly wire to your track.  You could aim the IR LED emulator right at the IR detector in a way that isolates each 50-1013 receiver (for your multiple tracks).  In such a case you wouldn't have to drive the LEDs as hard since you only need to send the signal a few inches or so.  In theory, but only for a hard-core hardware hacker, you could remove the IR detector chip and simply wire right into the IR detector output line and you wouldn't need to mess with generating IR (though you'd still need to decode the magic protocol).

 

 ogr cc

 

I'm pretty sure you can easily find code to decode the IR protocol to pick off the specific patterns/protocol for Whistle, Bell, Voltage Up, Voltage Down, etc..  I assume with the TMCC protocol that you can directly set voltage.  With the 50-1013 method you'd need to keep track of where you are and send multiple increment or decrement commands to set a particular voltage.  Of course you'd probably use the increment/decrement approach anyway to smoothly accelerate/decelerate the engine.

 

I suppose another hacker's delight would be to open up the IR transmitter and emulate push-button switch closures with the Arduino.  So you'd use something like a 25 cent opto-isolator to electrically close each switch as needed requiring 1 Arduino digital output line per button.  This would mean no need to decode the protocol as you are operating at the push button level.  Very crude indeed but we're just talking! 

 

I saw what appears to be a MTH Z-controller in your video for one of your loops.  I initially thought why not just have your Arduino mechanically push (with a solenoid) the DIRECTION, WHISTLE, or BELL buttons and turn the voltage knob (with a servo motor).  Again, very crude but then this is a discussion forum.

 

So if part of the enjoyment of the hobby is to fiddle with Arduinos to control electro-mechanical devices at the signal level, then the 50-1013 approach could be a fun project.

Attachments

Images (1)
  • ogr cc

I am having second thoughts about the Lionel approach due to this video: http://www.youtube.com/watch?v=gEVHZLeJdzQ

 

It indicates that the TMCC base is only there to generate digital commands to the track. All the voltage and DC offset commands performed by the powermaster are received via a 26.75mhz signal that I would have to mimic. There doesn't seem to be another way to interface with the powermaster for conventional controls. So that would eliminate either TMCC or Legacy base (the legacy bridge transmits 26.75 as well).

 

I really appreciate the servo comment. I flew giant scale RC planes for many years and have a basement full of equipment. I actually started the whole Arduino thing thinking of a way to leverage that hardware. Kind of a solution looking for a problem. Then I thought of automating the train layout and it has really peaked my interest. If options like the powermaster or 1013 don't work out then I could go with manual linkages but it feels like I'm just one step away from building an anamatronic engineer dressed like an elf

 

Thanks,

John 

John

 

If all you want to do is have a conventional locomotive make a station stop I would recommend an old Lionel 132 station and a section of insulated track.

 

If you want more sophisticated automatic control of trains and switches I would suggest a TIU, AIU and so you could use their ability to play back a recoded operating session.

 

If you really want full layout automation contact my brother Dave for full PC layout control with DCS.

 

My original goal was software automation, so I enjoy exploring all options but will ultimately pass on the more mechanical ones.

 

Arduino sketches still look like the place to start but the sophistication seen in Dave's video makes me wonder if a Raspberry Pi can replace the PC and interface with the Arduino. I can now see what my long term goals will be when I can move beyond my simple conventional holiday setup. Still thinking long term, the 2014 MTH catalog shows mobile devices replacing dedicate remotes. That seems like a future I want to be aligned with in addition to automation.

 

So back to short term, the lockon discussed above would work but it will be hard to find. The Lionel equipment discussed above would also work but I am hesitant to invest in the Lionel equipment when the DCS TIU would support both my automation (interface definition TBD) and mobile device interests. I may need to give this some more think time before I act. And I really appreciate the existence of this community to have such an exchange of ideas.

 

Thanks,
John

Nice impressive video Ted posted. I can pretty much do the same things with just relays and timers running conventional. No computers or DCS or TMCC.  Adjustments are made with dials and a few switches,no need for a computer to be hooked in to make changes. Too bad DCS does not have an input for a positioning system and it has to be done with external software. A occupancy block detection system could have  been done easily with outside insulated rails and resistors with the system measuring 5 to 15 MA signals. This is the way meters have operated the last 40 years or so. The advantage of the conventional approach is that I can run any manufacturers loco and am not constrained by one system. For display layouts a $100 Williams engine with a rectifier works flawlessly.

 

Dale H

I can pretty much do the same things with just relays and timers running conventional. No computers or DCS or TMCC. 

 

Right Dale, right!

 

There certainly are some fun things that can be done with traditional detection driving relays and timers.  But when you use track detection to input occupancy data into a PC running a software program with sophisticated logic that can send commands to locomotives that themselves have on board microprocessors with very sophisticated controls to reconcile performance feedback with commanded actions the possibilities expand exponentially.

 

The great thing about digital automation is that vastly expanded possibilities come at a relatively modest increase in cost over implementing detection to drive the automation of a few actions with relays and timers.  Making changes becomes easier too.  Redrawing something on a screen is easier than filling old holes and drilling new ones to mount hardware.  That is why you won't often see a traditional CTC machine in a railroad dispatching center any more.  For controlling a complex railroad, real or model, the digital approach offers more control for less time and less money. 

 

Ted

 

I was certified and schooled to set up and used Allen Bradley logic controllers in the 1990s. Using a computer reminds me too much of work,real work I used to do and get paid for it. I know the power and potential of such devices. I really do not want to plug a PC into my layout,too much like work. I watched your video and can do most everything you showed with relays and timers, except maybe dim the lights. Actually I could do that to if I took precautions with the 120 volts.

 

I worked on and used PLCs to run and set up industrial automation for many years. While I admire your work and accomplishments I find doing automation with DCS or TMCC whatever, rather crude, cumbersome and limiting,even compared to technology when I retired in 2001, as well as very expensive.  No doubt it has many advantages but such a narrow approach system would would not survive in an industrial automation setting. If it were an open, standard universal system available to private developers it would be light years ahead of where it is now. It could have had the positioning system built in with the design running with one CPU, rather than a computer in each engine which does not communicate with the other engine. It simply is just not an integrated system. Having a computer in each engine is not needed and really a waste of money and only complicates things. Give me an accurate reliable positioning system and slave boards in the locos and I will run the whole thing a lot better and cheaper than how it is done now with one CPU.

 

Until the train makers make a universal,reliable,state of the art system with a built in positioning system,I will stick with relays and timers and not limit myself to 1 system or brand of train. I have an open mind,and maybe when I see that,I will switch over. To each his own, just my opinion,not at all a criticism.

 

Dale H

Last edited by Dale H

John,

Look at the post by Professor Chaos, in this thread:

 

https://ogrforum.ogaugerr.com/t...62#18605835781136162

 

Dale,

I know what you mean – I started with the 5TI PLC for industrial controls in the 1970’s, and ended designing uP-based systems from scratch for dedicated controls. In 1989-91 I had an HO layout 100% computer controlled (Compaq 8086 with a whopping 10MB hard disc drive!) and it was a dream to show the layout in operation to guests.

 

Now I want to have my present layout computer controlled as well, but the proprietary DCS protocol and incompatibility of DCS with Legacy makes the task difficult. Nevertheless, I am forging ahead with the Arduino route.

 

Ted,

After several emails back and forth with Dave earlier this year about this very subject, I have been unable to reach him since May. Could you do me a favor and find out if he has not been receiving my emails, or perhaps these have gone to his spam folder?

 

Thanks!

 

Alex

Hi guys,

 

Alex, you have mail! 

 

Dale,  there's a good deal more going on with the automation system than you may have noticed in the video, which is to be expected because the video just gives a small taste of what is possible with this system.

 

The system is not limited to a single manufacturer's hardware.  In fact, we have taken a system integration approach using the best available hardware from multiple manufacturers.  We operate DCS, TMCC, Legacy (in TMCC mode), and DCC engines simultaneously.  Neither Lionel nor MTH (at the moment) have detection hardware on the market, but numerous DCC manufacturers, such as NCE, Digitrax, RR-CirKits, etc., offer a variety of detection hardware.  Our system opens up DCS to seamlessly integrate with all these options. It is also possible to integrate conventional engines using TPC's or PowerMasters, but this so radically limits your possibilities for locomotive control and increases wiring complexity that no one to date has selected this option.

 

We have a couple Allen Bradley PLC's around the layout running discrete automated features, such as an operating coal tipple.  We also integrate the Crestron lighting and outlet controls, PriCom DreamPlayer audio controls, Arduino micro controllers, and of course the on-board intelligence of PS2/3, TMCC Railsounds, Legacy, ERR, TAS, and SoundTraxx Tsunami decoders.  Distributing the processing power around the layout actually makes the total package far LESS complicated than a system relying on a single central processor.  For instance, track power on the NWTL can be turned on/off form a wall mount button near the entrance, the DCS remote, the PC, or any mobile devices.  The Crestron system actually controls the power outlets, but thanks to the distributed processing capabilities it only requires a single AIU accessory port to integrate all the other control options.  Duplicating just this one feature with relays or even a PLC would require dozens of wires running thousands of feet around the layout.  You're probably well aware that industrial automation systems have moved towards this same distributed processing approach in the last two decades.  This technology has now come down in price to where we model railroaders can take advantage to expand our operating horizons.

 

There are numerous features that are easy to execute in our automation packages that are not practical with relay controls.  One small example is limiting train movements based on permissions.  I mention this briefly in the video.  On the NWTL we have a small representation of Leadville, CO, with dual gauge O/On3 track.  The grade up to Leadville is 4% and features 21 inch radius curves.  The automation system assigns a particular locomotive(s) to each train, but certain locomotives are restricted from operating on the Leadville sub-division.  If you attempt to dispatch a Challenger or Northern into Leadville the computer returns an error message and won't allow the movement.  This type of "filtering" is easy with PC automation that tracks specific trains, but is not practical (nearly impossible) with relays or even a PLC.  Other such features include location based activation of Labor/Drift chuffing, Rev up/ Rev down, passenger announcements, pantograph operation.  Even accessories that are traditionally controlled by relays become easier and less expensive to integrate on an existing layout.  Once occupancy detection is in place there's no need to add ITAD's or new insulated rails to activate a crossing gate.  Just power the accessory and wire it to an open AIU or ASC port.  The AIU or ASC port can then be operated by the PC when a train is detected.  You can even refine the activation of the crossing gate so that a parked train short of the crossing will allow the gate to open, but close the gate when it starts to move; all without purchasing additional hardware.

 

Relays can do a lot of cool things on a model railroad, but they have their limits and full blown automation isn't for everybody.  When you want to take your operational controls to the next level, PC based automation and system integration can not only do more, in the long run it does it for less money and with less installation time.  Programming the software may seem like "work" to some, but it's easier work than crawling under the layout!

Last edited by Dave Hikel

Dave

 

Thanks for your nice reply. The level of automation really depends on what you want to accomplish and how far you want to take it. I witnessed transitions between electronic technologies. In some cases the older technologies worked better and were actually cheaper to implement. And the new technologies certainly had growing pains. Obviously PLCs have advantages for complex tasks,but few layouts are large enough to utilize these advantages.

 

I would like to know what sensors you are using to detect train position and how you ID which train is on which block. 

 

As far as crawling under my layout,I rarely do that once it is wired,unless there is a bad connection or something.. Most everything under them is wires and train things stored. Most adjustment are made with a few dials topside. 

 

Dale H

update;

 

I've taken some time to familiarize myself with Arduino and various sensor options. I decided to go with latching hall sensors for track position and replicate my layout on a breadboard. Next I wrote and tested all the code.

 

So now its time to revisit the command topic. Staying conventional is looking like too much trouble. I don't really want to do the mechanical servo thing, I'll have interface trouble if I go the DCS TIU route, the older powermasters only talk 26.75mhz and if I go with 2 of the newer legacy powermasters I'll still need a TMCC base and I'm not completely sure about the end result.

 

It might actually be simpler and possibly cheaper to just convert my 2 engines to TMCC and just have my Arduino command 1 TMCC base while the layout is powered by my existing transformers. I checked some previous threads about the conversion (found a Hogwarts Express example but not one for the MTH Chessie) and it seems rather straight forward unless I'm missing something.

 

Does that sound like a reasonable conclusion?

 

Thanks,
John

Originally Posted by John2290:

It might actually be simpler and possibly cheaper to just convert my 2 engines to TMCC and just have my Arduino command 1 TMCC base while the layout is powered by my existing transformers

 

...

 

Does that sound like a reasonable conclusion?

Nothing like trying to hit a moving target given the name of this thread.  Obviously if you're willing to upgrade engines to command control and put Rasp Pi on the table then the sky's the limit.

 

But to the original project of your modular Christmas layout using a basic Arduino and conventional engines, I think a few relays and some diodes is all you need - less than $20 in out-of-pocket cost and it might be up and running by this Christmas.  You would surely be able to re-use a multi-channel relay module in some future automation project.

 

Since you don't have any command control engines yet (a key differentiation with most of the OGR audience), wait and see what unfolds in the next year or two. Sending RS-232 or even USB serial commands to a $100+ black-box that uses a proprietary modulation scheme to co-mingle commands with a fixed AC voltage seems like yesterday's technology - in my opinion of course.

I couldn't agree with Stan's last paragraph more. That is what is causing me to waffle on choosing what will sit between the Arduino and the track. What I don't understand is the statement "few relays and some diodes is all you need - less than $20 in out-of-pocket". Can you elaborate for this software guy who is comfortable assembling circuitry but not designing it please? I'm certainly game to give it a shot.

 

Thanks,

John 

Hi Guys and gals.

 

The topic was layout animation for CONVENTIONAL controls. I run only conventional. I have made a few circuits for people to automate DCS somewhat. I am building my second layout,they are mostly automated and run themselves. The new one has 6 loops. 4 of the loops dog bone and run through a wall and back. There are 3 trains on each of 4 loops. They run one at a time from a staging area and do not collide. A 5th loop has a passing siding where 2 trains run in each direction. They go through a wall and intersect a trolley line. The trolley waits for the train if it is there. There are soft stop and start circuits. Upon start the train starts at low voltage,and accelerates in 10 steps. The bell rings and shuts off,then after it gets going the whistle blows in a pattern. Long,long,short and long. The trains stop and start and also stage at intervals. I live near railroad tracks and trains come and go and there are intervals of silence. I try to emulate this effect.  I have rarely ever seen a bunch of real trains following each other at the same speed on each others tail or saw them continually. 

 

I run the trains one per loop to avoid competing sound systems. As it is up to 4 trains can run at once. This is a lot of racket.. All this is powered with 2 PWZWs,2 LWs,a KW for accessories and a Lionel 180W brick which works the relays.  I use a 12 volt garden type transformers for lighting. I can make trains do stops randomly or all the time by turning a switch depending on preference.

 

I do not sell anything except occasionally I make circuits for people and furnish parts at cost for people interested. I have done some PB type circuits and donated them to charity organizations for display such as the Ronald Mcdonald house. Kids push a button and stuff happens. I once also had a pinball and coin op business and repaired such devices. So I am familiar with relays and timers,but I am not an engineer or electronic expert. This is a hobby and I do not make a dime off of it. I have no book or software to sell. Not knocking people who do,I am retired and done with anything that resembles work. 

 

Most everything I do is on my blog free for the taking for anyone who wants to use it. Most any automation can be done with relays and timers. Many circuits are shown on my blog. They can be combined to do most any automation. Time is probably the least modeled and neglected area in our hobby. The Ardino is interesting and has potential if you want to involve a computer. I made it up as a reference because people ask the same questions over and over. There are many other informative post there as well,the link is in my signature..  The Arduino is interesting and has potential if you want to involve a computer. Not knocking that either if you need complex logic or how others do things. Relays and timers work for me,simple,cheap and reliable. They work on any make engine,PW and up. No need to spend $200+ per engine to upgrade constantly changing system. 

 

http://www.jcstudiosinc.com/Bl...tegoryMain?catId=426

 

Dale H

Originally Posted by John2290:

What I don't understand is the statement "few relays and some diodes is all you need - less than $20 in out-of-pocket". Can you elaborate for this software guy who is comfortable assembling circuitry but not designing it please?

 

It might looking something like this:

 

ogr-arduino-cc

 

It's that mess of diodes that can be off-putting.  Obviously specific components values and exact interconnection points must be identified but it's "just" a whole bunch of diodes (10-20 or so) that are switched in/out in various combinations using relays.  Diodes are maybe 25 cents each (less than 10 cents on eBay) and relay modules appear to be less than $2 per channel if you buy one with 4 or 8 channels on it on eBay.  That's where the "less than $20" comes from.

 

Dale's write-ups describe what the relays would be controlling.  As you add (via relay) diode-pairs between the bricks and the track, you lower the AC voltage in fixed decrements.  The size of the fixed decrements is proportional to the number of diode-pairs the selected relay inserts (or un-inserts).  A diode-pair is just two diodes back-to-back with opposite polarity as depicted in photo with silver-bands on the opposite ends.  If rather than diode-pair, you insert (via relay) just a diode, it will pass only one polarity of the AC.  That is how you'd command whistle or bell with a relay.

 

As mentioned earlier, N relays can select from 2^N voltages (rather than just N voltages) which can come in handy.  For a Christmas layout, I'd think you might be able to get by with only a handful of voltage (speed) selections rather than continuously variable as you might get by commanding a triac-like controller.  There may be a suitable triac module out there or a DIY kit, but for expediency, simplicity, cost, etc.. the diode/relay method proposed early on should do the trick.

 

Attachments

Images (1)
  • ogr-arduino-cc

So here is a progress update to share. The mock-up seen in the picture (also at https://lh4.googleusercontent....kuF7M=w216-h162-p-no) is working now.

 

I was able to retain conventional trains with the diode approach and still have all the flexibility of software control. The Arduino C++ code is tested for a much more complicated layout (via breadboard) but the hardware mock-up is currently operating only the outer loop so I can test that side of things. Mostly its a success. There are 2 nagging issues in that I can't get the horn to activate and the hall sensors seem to be very sensitive to having their signal wires run near just about anything that generates a field. I'll have to isolate the hall sensor wires better before I continue and I'm beginning to suspect the horn issue has something to do with the CW80 that is feeding it.

 

Thanks to the group for all the feedback.

 

 ArduinoForConventional

Originally Posted by John2290:

So here is a progress update to share. The mock-up seen in the picture (also at https://lh4.googleusercontent....kuF7M=w216-h162-p-no) is working now.

 

** Check your link.  I think the "...." characters got pasted into the URL rather than the complete address.

 

I was able to retain conventional trains with the diode approach and still have all the flexibility of software control.

 

** Not sure what you mean by "retain".  So are you controlling speed and if so what/how many speed steps did you implement??

 

The Arduino C++ code is tested for a much more complicated layout (via breadboard) but the hardware mock-up is currently operating only the outer loop so I can test that side of things. Mostly its a success. There are 2 nagging issues in that I can't get the horn to activate

 

** Presumably you have a DMM.  If you measure the track voltage using the DMM's DC mode, what does it read when you turn horn on and off?

 

and the hall sensors seem to be very sensitive to having their signal wires run near just about anything that generates a field. I'll have to isolate the hall sensor wires better

 

** What specific component are you using?  If it's "that" sensitive makes me wonder if you have an open-collector output sensor with an inadequate pull-up resistor on the Arduino input?  When you say anything that generates a field, I assume you can't just wave a magnet near the wires and trip the input?  Hall sensors should have a reasonable amount of hysteresis so this one should be fairly easy to track down.

 

before I continue and I'm beginning to suspect the horn issue has something to do with the CW80 that is feeding it.

 

Thanks to the group for all the feedback.

 

 ArduinoForConventional

 

Hi, I'll try to address Stan's questions:

The forum posting changed the long G+ link when I pasted it, but it really isn't necessary since the picture at the bottom of the post is that same one from G+.

 

I said "retain" conventional because that was always my goal even though earlier in this thread I began to wonder if I needed Arduino to talk TMCC or DCS. Now that the Arduino can control the diode sets, I know that this layout will stay conventional as I hoped.

 

I found 4 speeds to be fine for this application and that part is working very nicely.

 

I was using a DMM while testing the Bell and Horn. I tried the horn while jumping from 1 to 10 diodes with no luck. That is why I don't have a specific DC reading to share because there were 10 variations. The Bell works fine when jumping either 4 or 5 diodes. I settled on 5.

 

The latching hall sensors are ATS177. I also tested with US1881 on the breadboard and both worked fine. They also work fine after wiring into the layout and I pass magnets (or cars) over them to simulate train motion. But once the track voltage comes up there are random readings that I think are induced by other adjacent wiring. Its just a guess and that is what I'll be looking at next.

 

The sensors are wired such that looking at the "front" gives a left pin receiving 5v from the Arduino pin #3 set to max (255), center is ground and right feeds the Arduino pin being read (digital read returns either 0 or 1 based on the last magnet pole to be sensed). Feeding the sensors from a pwm pin also gave me a good way for the program to reset them when desired. And it kept the fixed 5v pin free to feed the relay board.

 

You can see I still have a few things to tackle but the list is only a fraction of what it was when I started this thread. So far so good.

 

Thanks,

John

 

 

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×