MRH

017-p103.jpg 

 

 

 

 

 

 

Read this issue!

 

 

 

 

 

Please post any comments or questions you have here.

Reply 0
lnxlnx

Website for DCC++

The support website and forum for DCC++ is based at TrainBoard.com  http://www.trainboard.com/highball/index.php?forums/dcc.177/

Also it has more projects based around DCC++ like wireless throttles.

Reply 0
Nick Santo amsnick

Great article and information again!

Hi Dr Geoff,

I had a little head up for LEDs.  Do the LEDs connected to your boards need the usual resistors in series?  Also, please tell your lady that the music in the video caught my attention right out of the starting gate.  It was very fine!

Thanks again for the thoughts and encouragement.

Nick

Nick

https://nixtrainz.com/ Home of the Decoder Buddy

Full disclosure: I am the inventor of the Decoder Buddy and I sell it via the link above.

Reply 0
Geoff Bunza geoffb

@Nick Re: Output to LEDs

Hi Nick,

The output from the Arduinos switch from Ground to about +5 Volts, so the series resistor is required to limit the current to the LED. Because LED lighting efficiency varies so much now, I recommend you keep a set of resistors (1/4 Watt) on hand with values from 10,000 Ohms (10K) to about 470 Ohms. Starting with the highest value in the set, work your way lower until you get a pleasing light level and use that value as your series resistor of choice -- simple and foolproof. Use the highest value that works well, as it will limit the total power used.

I will pass your compliments on to the music composer/performer (my wife) and add my thanks to you. Using her music avoids YouTube copyright issues.

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
Nick Santo amsnick

Handy tool.

age(40).jpeg 

Hi Dr. Geoff,

At one time I contemplated a run up box but the cost was the same as a couple of good locomotives.  I enjoy electronics and kits so I built something that has served me well... if even built for incandescent lamps.  If I put it together now I'd spread the range a little further on the top.  

My buddies in China have a good deal on resistors regularly.  I can wait and can't pass up a good deal.

Viva la resistence!

age(41).jpeg 

Nick

Nick

https://nixtrainz.com/ Home of the Decoder Buddy

Full disclosure: I am the inventor of the Decoder Buddy and I sell it via the link above.

Reply 0
maddragon

Just as an FYI, I've

Just as an FYI, I've purchased LEDs on Ebay that have the resistor mbedded in one of the wires.  So far they've all worked well.  Here's a link to the ones I bought:

< http://www.ebay.com/itm/10x-3MM-RED-DIFFUSED-PRE-WIRED-LED-12V-DC-20cm-CAR-BOAT-Free-Shipping-/170821435187>

Note that these will take 12 volts, but they're bright enough on 5 volts for panel indicators.

 

 

Reply 0
maddragon

Arduino Pro Mini

Geoff, I notice you tend to ust the Pro Mini in your projects.  Except where absolute minimum size is required, I prefer the Nano.  Still being manufactured, still low cost, and has more analog pins, which of course can be used as digital.  Same chip, same speed.  What's not to like?  And adapter boards with screw terminals that it plugs into are low cost as well, eliminating a lot of soldering and making experimenting a lot easier.  I've also found the screw terminals are more reliable than breadboarding.  Here's a link to an adapter board:

< http://www.ebay.com/itm/V3-0-Nano-AVR-ATMEGA328P-AU-Module-Terminal-Adapter-Board-For-Arduino-/112017387653>

Reply 0
Geoff Bunza geoffb

Pro Mini and Nano

Hi maddragon (name?), The Nano will do just fine too-- it uses the same processor on its board, with a built-in USB interface. The Nano is slightly larger and a bit more expensive than the Pro Mini which is why I usually favor it in my projects. I am often trying to cram electronics inside a model, so I favor the Pro Mini. You can easily see from my December MRH article and this one (together with your own experience with the Nano) that the family/series of Arduinos offers a variety of form factors and capabilities for a wide set of applications and situations. The fact that most will run the same sketches with no or minimal changes is a great benefit. 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
Jim at BSME

Pro mini and Nano

Quote:

the Nano.  Still being manufactured, still low cost, and has more analog pins, which of course can be used as digital.  Same chip, same speed

As far as analog pins go some Pro minis include the two extras, just have to look around the board for the A6 and A7, the pro minis I use have them on the opposite end from the programming connector. I have also seen them on the inside of the A4 A5 pins. 

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

Article issues with DCC projects using the Arduino

On article page 22 the bottom of the board is not shown even though the caption states "Bottom Component placement."

The link to the video DCC model railroading fun with Arduinos on article page 31 is wrong, the one when you click is https: // www . youtube . com/watch?v=TWEDums_2M&feature=youtu.be, the link should be https: // www . youtube . com/watch?v=TWEDums_2ME&feature=youtu.be notice the capital E after the _2M.

This is with the online edition of the magazine (http://mrhpub.com/2017-03-mar/online/html5/), read in Chrome on windows 7 not that it should matter.

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
Reply 0
Geoff Bunza geoffb

@Jim B re: Board Bottom

p>Hi Jim,

The correct bottom pic is this:

e_Bottom.JPG 

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
joef

These corrections have been applied

Actually, the bad video link and the wrong board image corrections (along with a number of other minor corrections) have been applied, so re-download if you want the latest and greatest. On the title page it says: (Updated 3/9/2017) ... that's how you know you have this updated version.

Joe Fugate​
Publisher, Model Railroad Hobbyist magazine

[siskiyouBtn]

Read my blog

Reply 0
Brent Ciccone Brentglen

Nano

I would agree with Geoff, the nano is handy because of the built in mini USB connector, but once you have it buried inside a model, you probably aren't going to use the USB connection ever again, so why pay the extra for it? I use an Uno to test everything, then once it is working properly, write the code to a cheap pro mini and incorporate into the model. If you want, you can solder the female pin sockets into you project, then you can pull the pro mini off the board and reprogram at your desk. This adds a small cost for the female header strips plus a bit of extra thickness to the construction.

Brent Ciccone

Calgary

Reply 0
Jim at BSME

Magazine article issues

@Geoff thanks for the picture, since I know about your work and read your forum posts I would have found it.

@Joe thanks for making the corrections in the magazine so quickly.

I didn't intend to clutter this thread with this, and thought I published my error notes over in the thread about the magazine itself,  MRH 2017-03 - March 2017, but perhaps it was moved.

BTW: you know how hard it is to put a youtube video link in the text so the link text shows up and not the video!

 

Jim

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

Yes, it was moved

Quote:

I didn't intend to clutter this thread with this, and thought I published my error notes over in the thread about the magazine itself, MRH 2017-03 - March 2017, but perhaps it was moved.

Yes, we moved it because it's most relevant to readers reading this article with older versions of the magazine that did not have that correction.

On the general magazine thread, it will be missed by most of readers who need the corrected link. The context there isn't very helpful to anyone except MRH.

Joe Fugate​
Publisher, Model Railroad Hobbyist magazine

[siskiyouBtn]

Read my blog

Reply 0
maddragon

Pro vs Nano

"I would agree with Geoff, the nano is handy because of the built in mini USB connector, but once you have it buried inside a model, you probably aren't going to use the USB connection ever again, so why pay the extra for it?"

I don't see any price difference - both are about $2.00-$2.50 on Ebay.  And the Nano usually includes a cable.  In fact, if one is willing to solder the headers to the Nano, it can be bought for around $1.50.  Both are cheaper if bought in multiples.

I agree that the Pro is the way to go when absolute minimum size is a major requirement.  And I said so in my original post.

But I'm using Nanos for a turnout control panel.  For another $1.50 I can get a board with screw terminals that the Nano plugs into.  Since I fully expect to have to replace  either a DPDTswitch or a servo in the future, and maybe even an LED, the screw terminals make more sense than soldering.  I might even have to replace the Nano!

So both the Pro and the Nano have their place.  I suspect the person who's just getting started with microcontrollers will prefer the ease of changes with the Nano, just as the ones with experience and a use for an embedded controller will prefer the Pro.  To each his own.

Reply 0
Jim at BSME

Pro vs Nano - links please

Whenever I have looked at the pro mini and nano the nano has been $1 higher and no cable. Granted $1 each is not much, but it does add up.

If you have links (or a vendor/seller name/id) to the nano that are as cheap (or almost) as the pro mini, please share them.

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
Reply 0
Kevin Rowbotham

Great to see all this in article form!!!

Thanks MRH and Dr. Geoff!

Quote:

 I use an Uno to test everything, then once it is working properly, write the code to a cheap pro mini and incorporate into the model. If you want, you can solder the female pin sockets into you project, then you can pull the pro mini off the board and reprogram at your desk. This adds a small cost for the female header strips plus a bit of extra thickness to the construction.

Brent Ciccone

I do the same thing.  I find the Uno with a breadboard handy for learning and figuring things out.

duinoUNO.JPG 

I broke my FTDI cable out to mini grabbers and don't bother with headers or a usb connection at all.  As long as the data end of the pro mini is accessible it can be easily connected to my computer.

_Connect.jpg 

Everybody has different ways of having fun wth Arduino in model railroading!

Regards,

~Kevin

Appreciating Modeling In All Scales but majoring in HO!

Not everybody likes me, luckily not everybody matters.

Reply 0
atanisoft

Nano and Pro Mini links

Here is a Nano for just over $2 each... https://www.aliexpress.com/item/50pcs-lot-Nano-3-0-Atmel-ATmega328-Mini-USB-Board-for-arduino-with-USB-Cable-Free/32243859576.html

And for a Pro Mini here is one for $1.60: https://www.aliexpress.com/item/New-Pro-Mini-atmega328-3-3V-8M-Replace-ATmega128-For-Arduino-Compatible-Nano/32664999121.html

If you order from these I would buy a few at a time and pay for an ePacket (EMS) or other shipping method that provides full tracking info.  Many of the default shipping options show tracking only in China.  All of my orders from various vendors on aliexpress have arrived within 3 weeks of ordering (I have bought too many items to count on there, lots of Arduinos, relays, CT sensors, ACS712 boards, etc...)

Reply 0
Nick Santo amsnick

A little off subject @Dr. Geoff and/or Pelsea

Hello again Dr. Geoff and Pelsea,

Looks like JoeF really got a good one going in LED strip lighting "for the average Joe".

Thinking out loud....

I did the YouTube video above and wanted to price out a DT012 MOSFET transistor as mentioned.  No go.  Not to be found.  The feed power for the LED strings is 12 volts and 5 Amps.  I think 15 Amps should work for three strings 17 might make me feel more comfortable.  But stopping to think for a moment, strings connected in parallel.  An Arduino will activate a transistor at 5 volts.

What transistor or device should I consider to turn the LED strings on and off and consider PWM for a dimmer? 

I've used transistors to offload current draw on an Arduino in the past and wondered how the transistors were spec'ed.  I'm psyched to do this project,  The timing was perfect.

Thanks in advance.

Nick

Nick

https://nixtrainz.com/ Home of the Decoder Buddy

Full disclosure: I am the inventor of the Decoder Buddy and I sell it via the link above.

Reply 0
Geoff Bunza geoffb

@Nick

Hi Nick,

Try this for the FETs: https://www.sparkfun.com/products/10213

and this for hookup instructions: http://bildr.org/2012/03/rfp30n06le-arduino/

This is a bit off topic here. It might be best to start a new forum topic to get better feedback.

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
maddragon

Pro/Nano links

All you have to do is go to Ebay or Amazon, search for the Pro or Nano, and sort the results by price.  Here's a Nano (that has the headers already soldered in) for $2.10:

< http://www.ebay.com/itm/Mini-USB-Nano-V3-0-ATmega328-16M-5V-Micro-controller-CH340G-board-For-Arduino-/272579941945>

And here's a Pro Mini (soldering required) for $1.93

< http://www.ebay.com/itm/Pro-Mini-Enhancement-ATMEGA328P-5V-16MHz-Compatible-to-Arduino-PRO-mini-/191679508570>

Amazon tends to be a bit higher in price, but they're still comparable.

Last time I bought I paid $12.99 for 3 Nanos but that's because I wanted them in a hurry and ordered from a US supplier.

BTW, I've had no problems ordering from Chinese sellers, but I'm a bit skeptical about Malaysian ones - seem to go in for deceptive ads.

Once again, if you want something for an embedded system, go with the Mini.  If you want flexibility and easy attachment replacement go with the Nano.

But that's just my opinion .

Reply 0
Jim at BSME

Pro/Nano links - thanks

I guess prices have come a little closer than they used to be, but your Nano link goes to an item for auction, not buy it now. I can search further no need for more links. I wouldn't go by the picture that the headers are already soldered into the board. The last Pro minis I bought the picture showed the headers soldered in, but they did not come that way, not that it is a problem for me.

I do agree that the Malaysian sellers seem to cheat on their ads, offering two products, but put the more valuable one (e.g. pro mini) in the title, no mention of the other one till you look at the actual item description. And the ones I see that offer a 99 cent Bluetooth module it is really just the PC board and you have solder a surface mount Bluetooth chip to the board!

Thanks,

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
Reply 0
MP152-Eliot

What is the purpose of the optocoupler in the DCC_Decoder3P

Hello Dr. Bunza:

As someone new to electronics I'm puzzled by the use of the 6N137 optocoupler shown in the schematics for the DCC_Decoder3P. The input pins 2 and 3 to the optocoupler are connected to DCC1 and DCC2 so they "see" DCC track voltage; the output of the optocoupler goes to pin 5 of the Pro Mini. I understand that DCC voltages can be as high as 18 V and this can damage the Arduino so optical isolation will prevent damage but I'm still not sure what the output of the optocoupler provides to the microcontroller.

Carlos G.

Reply 0
Geoff Bunza geoffb

@Carlos re: Optocoupler Purpose

Hi Carlos,

The 6N137 and its support components serve these purposes:

1. It isolates and limits the load on the DCC bus. This is particularly useful if you are using a separate local power supply to power the decoder and its connections (like servos, stepper and motors) to prevent ground loops and noise entering the DCC bus.

2. It effects a level conversion from the differential +/- 15 Volt DCC signal to  unipolar 5 Volt levels compatible with the Arduino Pro Mini input pin.

3. The 1.3K resistor (R18) and the small 270pf capacitor (C8) form a noise filter to reject noise spikes on the DCC bus itself which could corrupt the DCC packet timing and decoding.

'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