SMA12 - 17 Channel Configurable Multifunction $5 DCC Decoder For Servos

geoffb's picture

One of my earlier entries:  SMA10 – Build a 17-Function DCC Decoder for about $5 ( http://model-railroad-hobbyist.com/node/19070 ) generated a considerable amount of interest regarding the possible enhancement for controlling Servomotors (Servos). This is my next version of a 17 Channel Multifunction DCC Decoder based on a low cost $2.56 Arduino Pro Mini. This version supports configuring each of the 17 function pins for On/Off (LED/TTL) Control, or Configurable Blinking Control, or Configurable Servo Control, or Configurable Pairs Blinking Control. Yes, that does mean it can support 17 servos, each with rate, start point, and end point setting via DCC CV’s, per pin, as well as new LED configurable functions. Read On. Additional doc found here: http://model-railroad-hobbyist.com/node/19775 There is another decoder version added herein. Look for "New Decoder Version to Control Lighting Groups" in Page 12 of the Comments: http://model-railroad-hobbyist.com/node/19446?page=11   The most recent Update can be found here: SMA20 New Low Cost 17 Channel DCC Decoders with PC Boards & Dual Motor, LED, & Servo Control    http://model-railroad-hobbyist.com/node/24316

Comments

Jim at BSME's picture

PCB pictures

Al, you can follow the link in Sebastjan's post for pictures, the link is a little hidden in his text since it is just the word "here" three lines above the video.

I looked at the pictures to get the board size and figuring the matt he was working on was in cm I would say his board is about 4,5 x 7 cm  (since the US is only one of two countries that haven't adopted the metric system and for those readers that is approximately 1.75" x 2.75").

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
Al Brough's picture

I have had a look at the link

I have had a look at the link but on the site i cannot see the back of the printed PCB, I am very keen to start these myself!

~
Al Brough
Sydney, Australia
Fast Tracks, Digitrax & JMRI
Free-mo ZA

adafruit feedback servos

Hey. I resently got the uno starter kit from my 84 yr old father for xmas with the surprise of the motor shield and servo shield.....so im taking the time to follow adafruits learning tutorials....my question is can the servo shield work like your design as a stationary decoder??...and i see they have feedback servos. Can that function in the servo be used to tell us switch position?     I dont know the code yet. But if 0 degree is reached light green led for mainline.  180 degree read light red led for siding.  Can be also connected. Somehow to signal system saying switch made??   Adafruit showed a sensor set. Anyone seen those yet?  Could those be usefull??

Kevin

Modeling something to do with the Grand Trunk Western.

geoffb's picture

@Kevin re:Servo questions

Hi Kevin,

.my question is can the servo shield work like your design as a stationary decoder??

The servo shield usually just provides a convenient way of attaching 3 wire servo connectors to an Arduino processor. So, yes, the servo shield could be used as well as the Arduino Uno which usually has the same or a completely compatible processor as the Pro Mini. You will stiil have to build and attach the 6N137 optocoupler and its circuitry to connect to the DCC bus.

i see they have feedback servos. Can that function in the servo be used to tell us switch position?

Yes, but it would have to be connected to an "analog" pin and be read in as a value between 0 and 1023. Since the Arduino is already driving the servo itself (setting the servo position) it already knows what position it is in, or what position it is moving towards. So this may be a redundant feature. You may come up with another use, perhaps.

Have fun!  smiley

Best regards,

Geoff Bunza

Al Brough's picture

Thank you for sharing both

Thank you for sharing both the images and the gerbers Sebastjan! Keep up the good work everyone

~
Al Brough
Sydney, Australia
Fast Tracks, Digitrax & JMRI
Free-mo ZA

direct comms with this device

hi, currently coding some basic to directly talk with come of my dcc devices, the accessorys are a touch confusing

with the /4 in one byte and spare s in another byte, would this be controlled in a similar way

 

thanks jeff

geoffb's picture

@chod Re: direct comms

Hi chod (name?),

Sounds interesting. Are you saying you  are writing Basic programs to communicate with your Arduino-based decoders?

Is this a control or animation application? or something different all together?

Have fun! 

Best regards,

Geoff Bunza

Loconet Shield

Geoff,

I want to replace the front end of the 17 servo Arduino with loconet rj12 setup vs rail a/b connection.  Do you have or know where I can get a schematic for this?  Input is on pin 2 of the Arduino as before. How do I provide feedback to JMRI for instance to indicate switch position and can I use A5 output for that?  Assuming all of this is possible, could you point me to a code snippet to provide this?

Another issue I am having is the servos are being set on power up in the thrown position.  Changing the initial servo default orientation puts the switch in the closed position but when issuing the switch close command, the servo goes to thrown and back to closed position rapidly.  Electrically and physically I can get the initial setup correct by the orientation of the servo/switch, but thrown is closed and vice versa from loconet. Any help would be appreciated.

Learning to code is proceeding very slowly.

Thanks,

Don

geoffb's picture

@Don re:Loconet

Hi Don,

Connection to the loconet for a decoder interface has been reported before. Best way to find it might be to search using the cusom google search box for MRH in the top right corner of most MRH pages. I don't use Digitrax's Loconet in this manner and i don't support it either. Also check the Arduini Yahoo Group. There are many knowledgeable people there that are Loconet hackers I am not a JMRI developer, nor do I code to interface to it. LIkewise, I again refer you to the Arduini Yahoo Group as a possible source of help. Typically, decoders do not transmit much of anything back to a DCC base station at all in normal operations.

Decoders usually do not retain more than their CV settings from power up to power up, and both DCC base stations and decoders assume Functions are off at power on. That is why the decoder comes up to its "known" power on state. JMRI has a Jython script people use to initialize track switches, and much anything else for that matter, when they want their layout to power on to a set of conditions specific to their layout. Look for the JMRI script examples and tutorials for a starting point.

'Hope that's enough to point you in the right direction. Have fun!  smiley

Best regards,

Geoff Bunza

Geoff

Very quick response as usual. Thanks for the info, I will look into it.

Don


>> Posts index


Journals/Blogs

Recent Blog posts: