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

...

Turnout indication and signaling outputs would be the next step, though these elements could be driven by using the turnout position itself and the polarity of the frog as a relay [using electro frogs,of course]

Having the indicator wires coming right off the decoder would clean up wiring, though.  But again, you may not have to give up a function for each LED indicator.  Control wire receives 0, lED goes Red; Control Wire receives 1, LED goes Green.

The big question here is, if I have a three position [yellow], how do I get the half step? [Stop the servo half way].  I have a 3 position semaphore, for example, it has that middle yellow position and it is tricky getting that middle position.

Very slick decoder, it's definitely going to improve work with signaling!

---------------------------------------------------------------------------------------------------------

Benny's Index or Somewhere Chasing Rabbits

geoffb's picture

@ Benny 3 Position Semaphore

Hi Benny,

The 3 Position Semaphore is relatively easy to set, like the stop and start positions of the servo are set now. One would create a third CV to control the middle position. Each CV is a number from 1 180. In the case of the servos I use, about 26 to 140 sets the maximum swing, so somewhere near 83 is likely the midpoint of travel.

What I would like to know is how would you like to select each of the 3 blade positions? Perhaps with 3 functions per semaphore? Say F10, F11,and F12? Is this acceptable? Do you have another way one might do it?

Thanks for your ideas.

Best regards,

Geoff Bunza

 

...

That would be a very simple method of setting blade position, giving it its own button/command prompt - my preference, of course.  Granted, most people I'd talked to consider signaling to be an automatic function, whereas the system does the work automatically.

---------------------------------------------------------------------------------------------------------

Benny's Index or Somewhere Chasing Rabbits

barr_ceo's picture

There was quite a bit of discussion

There was quite a bit of discussion about servo/semaphore control of three position signals on one of the newsgroups several years ago. IIRC the preferred method at that time was to use a single function and have it cycle through the three positions - red-yellow-green, red-yellow-green. This would make it easier for a "signal tower operator" to run signals with a throttle. With more memory available now, though, that may be a moot point. I believe the desired adjustments were:

Max Point, Min Point, Center Point, Speed, rebound/bounce (especially useful for crossing gates) and light functions Off, On, Alternate Flashing, and flash rate.

Given the space that seems to be available for programming in this, I'd suggest a "random flash rate"  and "random duty cycle" also, suitable for anything from a flickering campfire to a welder's torch.

-----

Read my Journal / Blog...

Freelanced N scale Class I, T-Trak,

Digitrax & JMRI   NRail   T-Trak Standards   

T-Trak Wiki   My T-Trak Wiki Pages

John C H's picture

Push button and LED on one I/O pin

Geoff

I have Tam Valley Depot servo control boards on my layout. Studying the boards and reading all of Duncan's information, leads me to believe that the system that they use is one I/O pin does double duty of sensing the switch and driving the LED by switching back and forth between input to output. Granted, they use a PIC but an Arduino should still be able to control 8 servos, 8 LEDs and sense 8 buttons. I haven't done it yet but certainly think it is feasible. 

John Houghton

Collingwood, Ontario

 Canada 

HVT Dave's picture

LocoNet on the Arduino Pro Mini

Geoff’s thread about the 17-function decoder has inspired me to learn about the Arduino.  The first application I have for the Pro Mini is on a test roadway for my Faller cars.  The road is built inside a circular HO and N scale test track and is currently powered by a Tam Valley Quad-pic.  On more than one occasion I have inadvertently reprogrammed the Quad-pic while programming a loco so connecting to LocoNet rather than the DCC track power is very appealing.

While waiting for my Arduino Pro Mini(s) (only ordered six) to arrive from China I have put together the following circuit diagram.  It shows typical connections for input/output.

EDIT: Corrected a resistor value.

The schematic and PCB design for a LocoNet shield compatible with an Arduino Uno is available on the SPCoast website.  http://scuba.net/wiki/index.php/LocoShield  (the website appears to be down at the moment so you may have to try back later).   The code is available at http://sourceforge.net/projects/mrrwa/    I have redrawn the schematic to work with the Arduino Pro Mini.  It requires a comparator, an NPN transistor and some resistors.

I have chosen the LocoNet shield because 1- I have LocoNet and 2- it eliminates encoding the commands in the command station and decoding them at the Arduino, and 3- the biggie, it will provide feedback to JMRI. The test road uses servos, Hall Effect Sensors for detection, switches and LEDs.  One of the LEDs connected to pin 10 illuminates when the output is Hi and the other when the output is Lo.  On the control panel that will show which route is active.  This feature would also be useful for alternating flashing lights such as at a crossing.

The Arduino has so many possibilities.   I will keep you posted on my progress.

Dave

 

Dave

geoffb's picture

@barr_ceo

Hi,

Thanks for the info and suggestions-- very good! More to consider.

Best Regards,

Geoff

geoffb's picture

@John re: Pushbutton

Hi John,

Thanks. I had forgotten about that old trick. That will save a pin... very good indeed,

and completely do-able on the Pro Mini.

 

Best Regards,

Geoff

 

geoffb's picture

@Dave Re: Loconet

Hi Dave,

While not everyone uses Loconet (I do), I'd love to see you write-up your results and post it in the forum. I think others would enjoy seeing your work too.

Best regards,

Geoff

 

Arduino Expansion

John,

In some applications the I/O pins on the ATmega328 (Pro Mini) can be multiplexed, but for home brew projects usually not worth the hassle especially when off the shelf expansion solutions are available. Using only two of the Pro Mini's I/O pins (A4, A5) the Adafruit 16-Channel 12-bit PWM/Servo Shield - I2C interface would be one example (If the cost is to high you can build this circuit on a bread board for about $5). These designs are expandable, and still using only two pins similar I2C boards can be built to support various additional I/O functions (eg. http://SX1509 16 Output I/O Expander Breakout). The supporting software is free.

If you really need to push the I/O it would probably be easier to use one of the other Arduino platforms such as the Arduino Leonardo with twenty I/O pins or really pushing it with the Arduino MEGA with 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs. The Arduino versions of these boards can be moderately expensive, but I have seen clones go for ¼ of the list (similar to the Chinese Mini Pros).

Or just use additional Mini Pros.

 

Ken K


>> Posts index


Journals/Blogs

Recent Blog posts: