Geoff Bunza geoffb

Because of the interest in this project (Details can be found here: https://forum.mrhmag.com/post/sma12-17-channel-configurable-multifunction-5-dcc-decoder-for-servos-12198051 ) more example decoder variations have been added and some start up timing problems have been fixed. The new libraries and examples can be downloaded from here (Updated November 26, 2016):

http://mrhpub.com/files/users/geoffbfiles/new-dual-multifunction-decoderv5_4.zip

Please see:

SMA20 New Low Cost 17 Channel DCC Decoders & Dual Motor,LED, & Servo Control Updated: 6 Ftns/Pin & New Features
for the latest update information.

Installation is the same as described previously. Delete your previous version, replace it with the new one, and load in onto your decoder. Below is a brief description of how I’ve built my new boards followed by a detailed working example for a 7 servo 10 LED configuration that may help people configure their own versions for their particular modeling needs. Also, now check the fourth comment page for the accessory decoder version.  Have at it!

Decoder.jpg 

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Kevin Rowbotham

Compiled Info?

Hi Andrew,

To the best of my knowledge these blogs are the only place to get the information.

You need to start with an earlier blog...this project evolved so much that new discussions were needed so there is more than one thread to follow to get the whole picture.

Check out SMA10 - Build a 17 function dcc decoder for about $5

I do agree that it would be great to have all of the decoder stuff in one place.  I wish MRH would approach Geoff about a book or enriched PDF or even TMTV quality video...I would buy it!

I'm sure Geoff will chime in before long...he may be a little busy right now since he has several clinics to do at the Portland Show in about ten days.

~Kevin

Appreciating Modeling In All Scales but majoring in HO!

Not everybody likes me, luckily not everybody matters.

Reply 0
conrailandrew

Thanks, Kevin!

Thanks, Kevin!

​Ontario Midland Railroad (and Conrail) in N scale, with Digitrax DCC and Code 55 handlaid track.
Reply 0
Geoff Bunza geoffb

@Andrew re:Compiled info?

Hi Andrew,

Kevin quite correctly responded as I'm up to my eyeballs right now getting ready for the NMRA convention here in my home town.

As you probably already noticed, this has become immensely popular and has provoked over 18 variations at modelers requests from around the world with several more variation requests in the queue, most of which are covered in the following blog entries (including comments) in chronological order:

SMA10 – Build a 17-Function DCC Decoder for about $5  http://model-railroad-hobbyist.com/node/19070

SMA12 - 17 Channel Configurable Multifunction $5 DCC Decoder For Servos  http://model-railroad-hobbyist.com/node/19446

SMA 13 - Update to the 17 Pin Configurable Multi Function Decoder / Accessory Decoder Version Added  http://model-railroad-hobbyist.com/node/19775

SMA15: New Dual Acessory-Multifunctionl 17 Channel Configurable DCC Decoders for about $5 with Configurable Servo Support  http://model-railroad-hobbyist.com/node/20739

Scale Model Animation 18: DCC Control for Random Building Lighting  http://model-railroad-hobbyist.com/node/23026

Here is the schematic you were looking for:

derSmall.jpg 

The parts list was covered in SMA12. The CV set was covered a couple of times, try SMA13 & SMA15.

The basic sketch can be downloaded here: http://home.comcast.net/~gbglacier/Articles/New-Dual-MULTIFunction-Decoder.zip

I fully recognize that this information would serve the model community better if it were rebuilt into a tutorial, book, set of articles or whatever. My personal priorities are to what I have already committed to do, which will absorb much of my tme until mid September. You are welcome to make recommendations to Joe F at MRH, and I will hopefully see him at the NMRA convention in 1 1/2 weeks, so I'll ask if he's interested.

There are lots of great ideas in the blog comments from many modelers, so I think it might be somewhat useful to work your way through the discussions.

Have Fun, Andrew, and let us know how you do. 

Best regards,

Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Geoff Bunza geoffb

@Kevin

Hi Kevin,

Thanks for giving Andrew a pointer!  With regard to:

Quote:

I do agree that it would be great to have all of the decoder stuff in one place.  I wish MRH would approach Geoff about a book or enriched PDF or even TMTV quality video...I would buy it!

I hope to see Joe and Don at the convention, and I'll ask them what they think. Thanks for the encouragement.

Have fun! 

Best regards,

Geoff

 

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Kevin Rowbotham

@Geoff

Hi Geoff,

You are very welcome.  I am always happy to help a fellow hobbyist in whatever way I can.

Please do speak to Joe about the possibility of doing more with your blogs.  If I know Joe, he is already aware of the interest shown here.

It's too bad you and Barry(TMTV) are so far apart...a Dr. Bunza clinic could be a regular feature on TMTV, in my humble opinion.

I hope all goes well for you in Portland...I do wish I could be there!

Best regards,

Kevin

~Kevin

Appreciating Modeling In All Scales but majoring in HO!

Not everybody likes me, luckily not everybody matters.

Reply 0
Heisler wanted

Turnout control

Geoff,

Like most writers here I am too impressed with your work, and is about to order a few Pro Minis.

As I have not (yet) studied Arduino in detail I wonder about timing when driving servos. Controlling several servos

should require a great deal of PWM, not interfering between outputs. Is it simply that there's enough multitasking around ? Even so, 17 simultaneous PWM outputs is a lot.

Don't get me wrong, I am quite happy with these possibilities, just curious !

Best Regards

Peter 

Reply 0
Geoff Bunza geoffb

@Peter re: Arduino PWM capability

Hi Peter,

Quote:

Controlling several servos should require a great deal of PWM, not interfering between outputs. Is it simply that there's enough multitasking around ? Even so, 17 simultaneous PWM outputs is a lot.

Good question -- the Arduino Pro Mini clocks at 16MHz which means it can easily execute over 4 million instructions per second or there about. THe processor does have a hardware capability to generate PWM (Pulse Width Modulation) signals, but this decoder does not use it. All 17 Servos are controlled in a timing loop which calculates the updates for PWM control. The servos themselves require a signal that has an "ON" time between 1 and 2 milliseconds (1000-2000 microseconds) repeated every 20 milliseconds (0.02 seconds) to operate properly. So in the 20 milliseconds it can execute about 80,000 or more instructions to set the 2 timing edges for the 17 servos or 2353 instructions per timing transition, which is entirely do-able. It is actually more efficient than this, but I wanted to give you an idea that this is not a difficult task for this processor. By the way this is not technically a multitasking operation, but sometimes referred to as a transition scheduler or time-wheel technique. There are other names for it too.

Let me also direct you to the latest update for this decoder series here: SMA20 New Low Cost 17 Channel DCC Decoders with PC Boards & Dual Motor, LED, & Servo Control  http://model-railroad-hobbyist.com/node/24316

Have fun! 

Best regards,

Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Heisler wanted

PWM capability

Hello Geoff,

Thanks for a fast and, as usual, informative answer! I didn't  expect it quite so soon, as I forgot about the time difference; here in Sweden it is getting very late.... I labeled my first question "turnout control" but forgot to write about that, so basically I want to control several servos from a  panel or panels; by the way is that "fascia" ? Perhaps a good idea would be the local net you have mentioned; one panel read by a Pro Mini which talks to other Mini's. My layout is small, but minimizing cabling is always welcome. "Of course" I also have a practical question: You recommend a serial cable for programming that has six connections, why is that - why six connections ?

I have tried to do the above with Picaxe circuits, and then used their cable; it has only Vcc, Gnd, Tx and Rx data. Could this be used for Arduino ?

Regards

Peter

  

 

Reply 0
Geoff Bunza geoffb

@Peter re: Re-using PIC Serial Cable

HI Peter,

Quote:

You recommend a serial cable for programming that has six connections, why is that - why six connections ?

The six connections match the six pins at the end of the Arduino pro mini boards that I use a great deal. These pins were defined in the FTDI USB-TTL serial cable used to program the pro mini. These are the original pin definitions:

Pin Wire     Signal on      Signal on
#   Color      Cable            Pro Mini Label

1  Black        GND               GND or BLK
2  Brown       CTS
3  Red          +5 Volts          VCC
4  Orange    TXD     
5  Yellow       RXD     
6  Green       RTS                DTR or GRN

For all practical intent pin 2 is not used, but pin 6 is used to interrupt the processor so you can reload a new sketch (program) at will. all the signals are TTL (0-5 volt) levels. The +5 volt line comes directly from your computer's USB port.

Quote:

I have tried to do the above with Picaxe circuits, and then used their cable; it has only Vcc, Gnd, Tx and Rx data. Could this be used for Arduino ?

Assuming it is using TTL levels and not RS232 (+/- 12V) levels, you are still missing the RTS signal. So this cable would not do the job here.

Have fun! 

Best regards,

Geoff

 

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Heisler wanted

Reusing PIC serial cable

OK, thanks !

Will stick to the recommended cable then. Btw. what about that publishing project I saw in a post, any progress on that ?  Your work is surely a candidate for a book of some sort, though this, blog, format is perfect for sharing updates etc. It is also obvious that your suggestions trigger others  to do great things. For myself I'm just anxious to get those parts and do some testing, future will tell what, if any, great things there will be from me....

Best Regards  Peter

 

Reply 0
Geoff Bunza geoffb

@Peter

Hi Peter,

I hope to see some of those great things from you!

With regard to new publications, I am preparing for the NMRA 2016 Indianapolis convention clinics that I will be giving, and have a bunch of work to do for those. They are, generally, the most fun (besides building models themselves). MRH recently published a 2 part article from me in Dec '15 and Jan this year, and my experience is that editors generally want to spread material from the same author over a period of time.So I have a tendency to publish blog articles on my own schedule, and submit material for publication with expectations that it may take 9-12 months to be published-- just part of coping with hobby realities. It is kind of you to ask, and i appreciate it. Twice I have been asked to write a book, and I am considering it. Like yourself, who knows what the future will tell?

Have fun! 

Best regards,

Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Heisler wanted

Hi again Geoff, there's an

Hi again Geoff, there's an old saying; "better ask and look stupid, then not ask and remain stupid". I'll lean on that, and ask away: When looking at your decoder program I fail to see the servo control part. There is a number of CV statements, but they should be initial constants and not something you use to change servo positions ?. Is that simply a way to set up the Arduino using a DCC command station ?  I am new to this programming language, so am probably missing things here. Basically, what I want to do is control servos by switches, for turnout control. Perhaps you could just make som points to help me understand it better.

Best Regards Peter

 

 

Reply 0
Geoff Bunza geoffb

@Peter re:CV's

Hi Peter,

Quote:

There is a number of CV statements, but they should be initial constants and not something you use to change servo positions ?

The list  of CV's are literally the same CV's that you can set via your DCC throttle as in other commercial decoders. You are, in effect, looking at the inner workings of a decoder by closely examining the code (sketch) which I provided. As such, they are not constants, but variable "place holders" and the listing shows what I arbitrarily initialized them to. For your convenience you can set them anyway you want, either by editing the sketch and downloading it to the pro mini, or by changing the CV's via a DCC throttle.

Quote:

what I want to do is control servos by switches, for turnout control

Obviously, this does not use switches for a panel control. Panel switches could be logically viewed as the equivalent of the DCC functions, providing the on/off control for each of the servos. Each panel switch would use one pro mini I/O pin. So one could re-write the sketch to operate 8 servos, via 8 panel switches, but the throw limits of each of the servos would be "adjusted" by editing the initial values of the CV's in the sketch.

'Hope this helps. Have fun! 

Best regards,

Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Heisler wanted

Re CV:s

Hello Geoff,

This surely helps, the first part of your reply is my point; I totally agree what CV:s are, but do not see it as a practical way to throw switches(getting into programming mode etc.).

The second part, though, sounds very practical; adjusting servo throw by CV:s should be much more practical then rewriting code and reprogramming the Pro Mini. You would then have everything in place, and no need for programming cables. I will check the tutorials on using switches etc.

One thing I notice is that I tend to look for "more code", which probably comes from programming Picaxe; that is a version of Basic, and Arduino code is by comparison "too simple". I guess then the best is to start the learning curve from the bottom, and I'm sure this will turn out great.

Best Regards

Peter

Reply 0
Heisler wanted

Switch coding

Hi Geoff, I just searched your blogs, and realized how productive you are, amazing.

I have now installed my first seven turnouts, controlled by your 17-pin decoder. It works fine, except for the

growling sound these servos make, but that's another issue. I may have asked before, but is there a reasonably simple way to add switch control to this code ? I.E. switch as in panel switch. My next goal is IR control, so doing that would be excellent. Keep up your work, and....Have fun !

Regards

Peter

Added 30/8: I wasn't very clear what I meant, the decoder unit is out of pins, so switches mean another Pro Mini to scan switches and send that to the decoder; perhaps by I2C. Or, using a handheld IR controller(best). I would like to keep the possibility to program the decoder over DCC, if possible.

I am also installing a very simple "display" for turnout positions; 2 LED:s with resistors, connected in series over the track. Both glow dimly, but connect the common point to a turnout frog: this makes a single pole switch so one LED only lights up depending on TO position. This also tells if the points don't connect to rails. 1.8 or 2 mm LED:s will make a neat panel.

Best Regards

Peter

 

 

Reply 0
Geoff Bunza geoffb

@Peter re: Panel Switches

Hi Peter,

I am glad to hear you are making progress! 

Adding switches will obviously require an alternate communication interface (IR optical or serial) and start to use up pins. We have discussed previously in these blogs the issue of adding panel switches and halving the number of Functions (to account for switch pins). The problem I pointed out previously was the inconsistency/ambiguity that two independent control points (DCC and switches) would make for the operator.

Your "simple "display" for turnout positions" would help here, but the base station would be unable to follow the changes, hence the inconsistency. A DCC base station interface (like Loconet for Digitrax) may be a better solution. Perhaps LCC may help here too, but I don't know enough about LCC yet.

If you can tolerate the resultant inconsistencies, the way to accomplish this would be to add the code to scan all the switches the "decoder" wil be associated with in loop (), or receive the communication coming in, and  call either

 notifyDccAccState(  Addr,  BoardAddr,  OutputAddr,  State)

or

notifyDccFunc(  Addr,  AddrType, FuncGrp,  FuncState)

in order to update the decoder internal information.

'Hope this helps and gives you some food for thought. Have fun! 

Best regards,

Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Heisler wanted

Peter re: Panel Switches

Thanks Geoff,

Food for thought, absolutely !   I just have to ask, "add the code to scan all the switches the "decoder" wil be associated with in loop ()"  That would be in another Pro Mini for scanning switches, right ?,

"or receive the communication coming in, and  call either notifyDccAccState(  Addr,  BoardAddr,  OutputAddr,  State)" And this is the code to push the scanned info into the DCC decoder ?  Why "or receive...." (if I'm right) ?

On top of this the two Minis must communicate, I2C looks suitable to me. I don't want you to rewrite the whole thing, but could you let me know if I'm assuming correctly ? Hopefully I will be able to scan, and pack in bytes, switch data and send it to the decoder. A lot of assuming here, but very interesting and satisfying to get it working. But I don't have to tell you that.

Best Regards

Peter 

 

 

Reply 0
Geoff Bunza geoffb

@Peter re: More on Panel Switches

Hi Peter,

Quote:

I just have to ask, "add the code to scan all the switches the "decoder" wil be associated with in loop ()"  That would be in another Pro Mini for scanning switches, right ?,

No. code for scanning 8 switches attached to pins 11,12,13,14,15,16,17,18 something like (bold is added code in 3 places):

int numfpins = 8;
byte fpins [ ] = {3,4,5,6,7,8,9,10};
byte swpins [ ] = {11,12,13,14,15,16,17,18};
int savedFstate [8]={0,0,0,0,0,0,0,0};

:
:

void loop()   //**********************************************************************
{
  //MUST call the NmraDcc.process() method frequently
  // from the Arduino loop() function for correct library operation
  Dcc.process();
  SoftwareServo::refresh();
  for (int k=0; k < numfpins; k++)  {
    if (digitalRead(swpins[k]==LOW)  {
      if (k< 5) notifyDccFunc(  This_Decoder_Address, DCC_ADDR_SHORT, FN_0_4, savedFstate[k] ^ 1);
        else notifyDccFunc(  This_Decoder_Address,  DCC_ADDR_SHORT, FN_5_8,  savedFstate[k] ^ 1);
    while (digitalRead(swpins[k]==LOW) delay(1);   //wait until pushbutton releases
    }
  }

  :
  :
  void exec_function (int function, int pin, int FuncState)  {
     savedFstate[function] = FuncState;

You need to add the last line in exec_function to save the last function state of all functions, which is not now done. I assumed a pushbutton per switch pin and each push would toggle the function On/Off

Quote:

or receive the communication coming in

This comment refers to the equivalent code instead of reading the switches, read a communications line. I2C is doable, but requires 2 pins - clock and data -- plus a ground wire. Check out softwareSerial instead for a Ground and 1 wire/pin interface to do the same thing. A second Pro Mini handling Switches would enable you potentially to deal with 17 switches and just transmit switch changes to the decoder. It will make your job easier if you assume only one switch has changed at a time. The second Pro Mini could also do much more than handle switches. It could present a display, even handle a display with touch screen.

I do not have the time until near the end of this year to delve into this thoroughly, but this is food for your thought for now.

Have fun! 

Best regards,

Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Jim at BSME

Alternate solution???

What about using DCC Function generator in Geoff's SMA22 blog, and reading panel switches with that pro-mini and generating the DCC commands to the decoder. I would think the decoder could receive commands from both the function generator and the DCC throttles.  Of course this would be the same issue as mentioned about the base station not knowing the settings of this accessory decoder.

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: Facebook, Instagram
Reply 0
Heisler wanted

Peter re: More on Panel Switches

Geoff, this is awesome; my english vocabulary is insufficient to describe it !

 adding switches to the servo outputs !??  So the processor switches between input/output, and stores pushbutton activation just as it would store a DCC command ?  Many question marks here, but I'm just testing my understanding of your code. Of course the decoder, or base station will not, as you point out, know TO status. So, what I will probably do now is mount, for each TO,  my two LED:s and your pushbutton close together on the very layout edge, near the TO in question. But first, a very exciting test of this added code ! 

One small question, you made code for scanning eight switches, is there a significant reason for that, or could I do this for, say, fifteen ?

Finally, I totally appreciate your limited time for questions like mine, from my horizon you have still opened new chapters in this fascinating book. 

Many thanks and Best Regards

Peter

Reply 0
Geoff Bunza geoffb

@Peter: Words to Consider

Hi Peter,

It is always great to see someone so enthusiastic! ...And by the way, your English is far better than my very limited capabilities in any other language!

Quote:

adding switches to the servo outputs !??  So the processor switches between input/output, and stores pushbutton activation just as it would store a DCC command ?

Yes, that was the idea -- to store only the Function states for that decoder.

Quote:

One small question, you made code for scanning eight switches, is there a significant reason for that, or could I do this for, say, fifteen ?

Because the Pro Mini is limited to the 17 pins for Functions and switch inputs. So 8 Functions 8 Switches. Also (very importatnt) the code I showed was by way of an example, not tested, likely not complete, provided to you since you said you were going to try things on your own. Tracking push buttons in real time (in tens of milliseconds) is likely to upset the DCC capture timing -- which may or may not be important to you. There are likely other issues I didn't think of too. And again, I do not have the time soon to deal with the details of this approach until some time much later.

Now with that said, if you are really going to take a hard look at this, you might want to look into using an Arduino Mega2560 board instead of the Pro Mini. It has many more input/output pins for Function pins and switches. I do not know whether Alex's NmraDcc library is completely compatible with the Mega2560 board without modification, but it is an intriguing idea nonetheless. If if were compatible, you could create a 53 Function decoder, or there about! I have never tried it.

Again Peter, this is only food for thought, neither functional nor likely complete.

Have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
banax

What about the confirmation for command station

Hi Geoff,

First of all thank you for your great work. I've tried your decoder with few lights (and configuring them as Signal Masts in JMRI) and it just works (as it should - amazing ). However when I've tried to program decoder via JMRI + DCC++ arduino base station it has no confirmation from decoder, which makes it really hard to work with. I know it is currently not implemented at all, and I want to try to do it myself, but I don't know where to start from.

What I know is that I will need one pin, which will turn on and off "heavy load" via transistor and something (preferably a "small" static element) to draw specific current form DCC line (50mA? I remember I found it somewhere, but can not recall myself where was it). I need a starting point here, can be a link to documentation. Help with calculating a proper "heavy load" will be also welcome.

Next step after having "decoder -> master station communication" can be a train detection decoder, hence we can have occupancy control.

Best regards

Wojtek

Reply 0
Geoff Bunza geoffb

@Wojtek re:

Hi Wojtek,

You are most welcome.

Quote:

it has no confirmation from decoder, which makes it really hard to work with. I know it is currently not implemented at all, and I want to try to do it myself, but I don't know where to start from.

What I know is that I will need one pin, which will turn on and off "heavy load" via transistor and something (preferably a "small" static element) to draw specific current form DCC line (50mA? I remember I found it somewhere, but can not recall myself where was it). I need a starting point here, can be a link to documentation. Help with calculating a proper "heavy load" will be also welcome.

You are correct there is no current draw feedback to the base station implemented during programming. Remember too that all that these decoders are set up for is Ops Mode Programming only. That said, Alex's NmraDcc library does provide a mechanism for this feedback. If you look in the full NmraDcc library Examples in NmraDccMultiFunctionDecoder_1 you will find example code to be inserted in your sketch:

// This function is called by the NmraDcc library when a DCC ACK needs to be sent
// Calling this function should cause an increased 60ma current drain on the power supply for 6ms to ACK a CV Read
const int DccAckPin = 15 ;
void notifyCVAck(void)
{
  Serial.println("notifyCVAck") ;
  digitalWrite( DccAckPin, HIGH );
  delay( 8 );  
  digitalWrite( DccAckPin, LOW );
}

Note that you will need to know which pin can yield the required current draw, which is why I never implemented this -- a LED will not do it. For an approximate 4.5 volts output at a pin 4.5 / 0.060 = 75 Ohm load minimum on the "acknowledge" pin -- pin D15 in the above example.

Note well that this acknowledgement is not much in terms of communication to the DCC Base Station, and it is initiated only by the DCC Base Station.

'Hope this helps. Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
banax

Thank you for your answer

Thank you for your answer Geoff,

I don't think any of the arduino pins can draw such an amount of current, and from that reason I've wrote about a transistor. Maybe I will draw current from 12V just before L7805 voltage regulator (using H-bridge and little engine first and maybe later a transistor and some static element (resistor? - I'm not to good in electronic calculations - maybe I will consult my ideas here later, after success with some engine here) ).

I understand it will work in programming mode only as confirmation of write something to decoder - but it is also good to have it working - will it work also if I will try to read variables from decoder (in programming mode) if the proper code (to answer questions from base station) will be added? I should really find more time to read mentioned example and check what else is to be done...

Thanks again

Wojtek

Reply 0
Geoff Bunza geoffb

Hi Wojtek, You are right, an

Hi Wojtek,

You are right, an Arduino Digital output pin can't handle the 60 ma. But this simple circuit can:

_Ack_Pin.jpg 

'Hope this helps. Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Reply