The high speed opto-couplers came in this weekend. That meant it was getting time to try connect the Arduino to DCC and make it work as a function- and/or servo decoder.
A big thanks goes to the people behind the site mynabay since they had made available the software needed to ‘collect’ the DCC commands from the rails.
What I added is software that operates maximum 6 servos, while at the same time all other Arduino pins can be used as digital outputs, to switch functions.
Given the low price of an Arduino as compared to a ‘real’ DCC servo or -function decoder board this is highly cost effective way of switching your junctions and controlling other functions.
More info plus the download link for that software will be available soon on the software page.
Hi Rudy,
Excellent videos on how to use the Mynabay software together with your tuning code. Great stuff.
Any advice on max distance from Arduino to the servo and the wire gauge to use?
Thanks
Peter
LikeLike
I have one on my layout that is 3 feet long and it still works OK, but the general advice is it is best to place an extra Arduino if needed to keep the servo wires around 1 or 2 feet.
LikeLike
Hi again Rudy,
My optocoupler arrived today, so I’m all set. Just 1 question. How large is your layout, and have you had any issues with voltage drop from the Arduino output to the most distant point/turnout.?. Wondering if I need to use lower AWG wire gauge to reach 20 feet.
Thanks
Peter in Canada
LikeLike
Hi Rudy, can you confirm that there I no issue with the current load due to the servos when actuating turnouts?
I’ve heard that thi works for unloaded servos, but that with a real load , the current spikes and can damage the arduino. Comments.
Peter
LikeLike
The Arduino on board power supply canfeed one servo. As soon as you want to control more servos, always use an external 5V power supply that candeliver enough current. Connect the power supply GND to the Arduino GND.
LikeLike
Hi Rudy , i’m wondering you’ve ever published a diagram showing the placement of the optocoupler and other components on stripboard ?.
LikeLike
I haven’t. If you start with the optocoupler and just place the R’s and the LED around it (I placed them vertical) then you’re already done.
LikeLike
Hi Rudy,
I also intend to use the Arduino in combination with the new Daisy II central from Uhlenbrock on a TT-scale railway.
Is it possible to publish the electronic diagram on the breadboard that contains the optocoupler and how it is connected to the Arduino?
Thanks in advance.
NicoTT
LikeLike
Nico, all info is on the sofware page.
LikeLike
Hi Rudy
http://www.aliexpress.com/wholesale?catId=4099&initiative_id=AS_20150106142321&SearchText=arduino+optocoupler
I see what you saying now, 1 Optocoupler circuit to run up 12 servos on each Arduino
The Arduino 0ptocoupler from Aliexpress could i use one of these
thanks for help
Roger
LikeLike
Roger, the items from the link you sent are relais with optical isolation. That’s not what we need here. Try to find a 6n137 optocoupler, or one with similar timing specifications (rising and falling edges in the tens nanoseconds area).
LikeLike
Thanks Rudy
A O.K I do that
Roger
LikeLike
Hi Rodger.
Don’t know if you are in the uk.
I got these from ebay. Search item number 371154577600.
Their shop is shut until the 12th. They arrived within 2 days just before Christmas.
David Hi
LikeLike
Hi Rudy
I been studying your DCC SERVO as usual great Video
the high speed Optocoupler you are using is pretty straight forward with a breadboard
as for making a fixed unit for running 12 Servo would the Arduino Optocouplers you can buy from
Alliexpress where you can buy 2.4 6.8 12 16 units all on a circuit for 3 to 8 dollers be a good idea
Or are they not high speed optocouplers
Any input from you will be helpful
thanks
Roger Newton
LikeLike
Hi Roger,
I’m not sure if I understand what your plans are with regard to those opto-couplers? Of course I’m not going to use the breadboard with the definitive layout, I’m going to solder the 4 components on a small piece ‘experiment’ pcb, that has the standard holes.
Only one opto-coupler circuit is needed, the output signal of which can be fed to all the Arduino’s. Unless you plan to have your Arduino’s spread out over the layout at large distances from each other. In that case it would be advisable to have a local opto-coupler circuit with each Arduino.
Then still I don’t see what would be the use of a 12 or 16 fold opto-coupler circuit like you mention? Maybe if you can send the link then I can understand better what you mean?
LikeLike
Fantastic. Just what i have been looking for and will start putting together tomorrow
LikeLike
Spent a day trying to get it to work. Next day, rebuilt it on a new breadboard. WORKED. Rebuilt it on old breadboard, nothing! New breadboard, perfect again.
LikeLike
thank you
LikeLike
Hi Rudy,
I’m getting the following error msg when trying to upload.Can you help me.
In file included from DCC_Monitor.pde:1:0:
C:\Users\Chaminda\Documents\Arduino\libraries\DCC_Decoder/DCC_Decoder.h:131:11: error: ‘prog_char’ does not name a type
const prog_char* ResultString(byte resultCode);
^
Error compiling.
LikeLike
Error message sounds like it is something in the mynaby software. I can’t reproduce same error. Please (re-)check if everything is installed as shown in the video. If it is, but still does not work, try downloading the mynabay labrary from their website, place it in your library folder and see if it works standalone, without errors. Then try the RB-DCC software, it should find and use that library without errors.
LikeLike
The code is available now via this link.
LikeLike
Hi Rudy, this is fantastic.Thank you for sharing.I have spent hell a lot of money for ECOS detector unit.So this will help everyone to save money.Thank you very much for sharing.Hope you’ll make available the software for this as well.
Chaminda from Sri Lanka
LikeLike
This looks like an excellent concept and I would be very interested in trying this out once I have the time to get my head around arduino 🙂
LikeLike
Yeah thats great.
Ever since I have started to “play” with the arduino, I thought that it must be possible to decode the DC singal and have a fully field-programmable DCC decoder for e.g. servos or whatever function I want to program.
I am very very intetested to see the code for what you are showing in that video.
Kind Regards,
Martin (Germany)
LikeLike
Hi Martin,
I’ll post the code here in a few days. Want to add some software to tune the servo’s min and max angles and to invert rotation, while you’re working under the table.
LikeLike