Jump to content

Arduino base station


Blue Pullman

Recommended Posts

I've recently bought an Arduino uno and used the free Downloads to make some working traffic lights and as I purchased a kit will also use the stepper motor included with the relay to have a go at point/signal/ crossing gate contro. 
my real question has anyone successfully used a uno or mega with a motor shield to make a base station and connect it to jmri? 
there are lots of you tube videos but they are generally old and sparse on bits of info. I've got the bits connected ok but struggling with knowing if I've uploaded the sketch

 

Link to comment
Share on other sites

Hi Blue Pullman - there is considerable effort being made in this area mostly centred in the USA. Forum rules prevent me from promoting the sites involved but if you wish to contact Forum Admin. and ask to make contact with me via e-mail I will be more than happy to help you connect to the right people. R-

Link to comment
Share on other sites

Google "rudysmodelrailway" there is a wealth of well presented Arduino DCC projects, including ready to run sketches.

 

I built his 'DCC Sniffer' project and produced a layman's guide to building it. My guide includes a detailed description of 'How to load (his) sketches' into the Arduino with 'step by step' screen shots. The same technique could be adapted to load your own downloaded sketches. Several forum members have used my 'layman's guide' to build their own 'DCC Sniffer'.

 

My guide can be downloaded here:

https://btcloud.bt.com/web/app/share/invite/1Kx0q9ITmw

Link to comment
Share on other sites

I have a DCC sniffer, as described by Chris, which was built for me by a friend, and it works fine. I have often thought that it would be possible to extend its usage as, for example, an accessory decoder. On my layout, I have 10 hidden sidings each of which has an isolated section of rail which can be switched on and off to provide a "stopping" area for trains arriving in the hidden siding. At the moment, I have implemented these by using 10 Peco point motors, each having a frog switcher unit mounted on top. These are operated by a couple of ADS accessory decoders - the older ones which don't have frog switching in-built. When a train is to depart from a hidden siding, its section is switched on by the program and when the loco is clear of the isolated section, the section is switched off again, ready for the return of the train. The only problem I have is that in a small percentage of times, the switch on does not work. Although the Peco point motor has thrown, the physical contact inside the switch fails. 

 

What I would like to do is replace these switches by micro relays activated by something like an Arduino. The relay, ideally, would be one which has the target switched off when no power is applied, and on when power is applied.

 

My main question about such a device is ....

 

Does the Arduino need to be connected to a computer via a USB cable for its operating power, or can it use the power coming in from the DCC supply like any other accessory decoder would?

 

Ray

Link to comment
Share on other sites

Does the Arduino need to be connected to a computer via a USB cable for its operating power, or can it use the power coming in from the DCC supply like any other accessory decoder would?

 

I'm no techie Ray - but I'd have thought not. The power to the Arduino is DC but I guess there might be a way with a clever bit of electronic wizardry. I did find this which may give you some inspiration. R-

Link to comment
Share on other sites

You would have to do what Hornby do inside their accessory module, Heljan do the same inside their turntable module. Pass the DCC signal through a bridge rectifier AC terminals, take DC output of the bridge rectifier connect to large capacitor and then connect this a 5 volt regulator. Does the Arduino take 5 volts or 12 volts, if 12 volts use a 12 volt regulator. Take your output from the 5 volt (LM7805) or 12 volt regulator(LM7812) and feed to Arduino. The only thing I would be concerned about is how much power does the Arduino take, because this has to come off your dcc bus and you might also need a heatsink on the regulator. You need a few extra capacitors but that is the basic idea.

Link to comment
Share on other sites

Hi Colin and All

the Arduino is fed with either 5 or 3.3 volts to get round this you can buy an add on board called a motor shield which fits over the arduino exactly, with a small cut in a track to stop it sending current to the main unit you can introduce say 18 volts without the cut only 12 volts. Both the arduino uno and shield can be bought for less than £10 from China genuine made in Italy units less than £30. the clever software incidentally called a sketch is loaded via a usb cable From a pc The combined units provide the correct dcc circuit married to the higher voltage to power the motor. I'm happy with the 12 volts as I only want to introduce a secondary single track on a dc layout  the unit is also capable of providing two outputs POM and a program track  

Back to my original quest. I've successfully downloaded the software (free public domain) and uploaded it but I'm not getting any output readings and was looking for help round that issue. I see two possible problems one being conflicting instructions on which pinholes to connect the jumper wires to or That I've only loaded part of the sketch As RAF says this is important to get just right and his excellent sniffer paper will be useful as a module to copy get the loading right. Hopefully when I've got that right running the jmri will fall in to place. Using a Raspberry Pi might be the solution to that and you can get them for £25 on that well known sales channel. I know I've now spent £55 why not buy a used unit ?  But that's way and I'm eager to add more skills before the virus gets me!!

Link to comment
Share on other sites

This post replaces the post by Blue Pullman where he used the Blue Button and duplicated his own long post in its entirety unecessarily, just to add the one line of text as an edit ... edit text reproduced below:

 

"Hi Colin just looked up the motor shield it incorporates a L298 chip and is a dual full bridge driver"

 

@Blue Pullman

You have a 10 minute 'post edit' window. You could have edited your original reply to add the text above as they were only 4 minutes apart

 

/media/tinymce_upload/e2836dbb8661b2e5cd21b11a21040a3b.jpg

 

To get the best out of this forum I suggest you read my TIPs page on using this forum to understand its non-standard quirks. TIP 6 might be of interest to you.

https://www.hornby.com/uk-en/forum/tips-on-using-the-forum/

.

Link to comment
Share on other sites

@bluepullman.

The way the Admin system works is you ask to be put in contact with someone. Admin sends them tour details and its down to them if they want to male return contact with you.

 

If you want to short circuit the Admin system, contact me from my linked website below and I will pass your contact details direct to Rog.

Rob

Link to comment
Share on other sites

  • 4 weeks later...

Heyy, I've seen your post here and google It. Found out a similar doubt that a maker already made. He's in in the process of installing dcc++ with Jmri and an Arduino mega with a standard, clone, motor shield. Check it out: https://www.trainboard.com/highball/index.php?threads/jmri-and-dcc-with-arduino-shield-configuration.117773/. And by the way, if you've just bought your new Arduino KIT, I recommend you acess my latest arduino project: como fazer um braço arduino. It's about a assembly tutorial that uses popsicle sitcks for the mechanical structure. Check it out by clicking on the link given above.

Hope I've helped with you doubt on if anyone had successfully used a uno or mega with a motor shield to make a base station and connect it to jmri.

See you!

Link to comment
Share on other sites

  • 2 months later...

Check out Little Wicket channel on YouTube. He ahs done lost with Arduinos including making a dCC controller servo control for points and semaphores and blcok detection all hooked up to JMRI.

I think an Arduino can be run from 12 volts as I remember reading it if fitted with it's own voltage regulator, a visit to the Arduino web-site would confirm this. I always use a  5 volt supply. There are plenty out there with USB A connectors, so you would just need the appropriate usb plug at the Arduino end.

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