DCC++ Arduino Track voltage question - Model Train Forum - the complete model train resource
Model Train Forum - the complete model train resource

Go Back   Model Train Forum - the complete model train resource > Model Train Workshop > DCC Forum (Digital Command Control)
Forgotten your password?


Reply
 
Thread Tools Display Modes
Old 11-17-2018, 10:59 PM   #1
BrokeCurmudgeon
Dispatcher
 
BrokeCurmudgeon's Avatar
 
Join Date: Feb 2016
Location: Riverton Utah
Posts: 1,519
Scales Modeled: American Flyer S Scale and some N Scale with a maginfier glass
DCC++ Arduino Track voltage question

I am playing around with a Arduino DCC++ project. A YouTube video (
) has one to use a 12vdc wall wart . After connecting a Motor Shield to the Arduino the track voltage is the same as the input voltage to the Arduino. In this case, 12vdc (wall wart).
Question: Is 12 AC from the motor shield sufficient to power a small DCC layout and drive the decoder in the engine?
I see where people have used 15vdc inputs which would produce 15vac track power but the higher voltage can destroy the Arduino. (So I am told.) In one of the videos the narrator says to cut a trace on the motor shield to avoid this problem. The problem with this approach is that the motor shield that I have doesn't have such a trace. So, any suggestions and/or comments? All would be greatly appreciated!
__________________
"Take my advice because I don't use it!"
Fred
BrokeCurmudgeon is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 11-17-2018, 11:12 PM   #2
wvgca
Station Master
 
wvgca's Avatar
 
Join Date: Jan 2013
Location: yorkton, sask
Posts: 3,143
Scales Modeled: HO 1890's
Images: 48
i used a 15 volt power supply, my shield had the traces [two] that were cut for powering with 15 volt ..
i ran HO, for N scale i -beleive- 12 volts is enough ??.
__________________

wvgca is online now   Reply With Quote
Old 11-18-2018, 10:48 AM   #3
BrokeCurmudgeon
Dispatcher
 
BrokeCurmudgeon's Avatar
 
Join Date: Feb 2016
Location: Riverton Utah
Posts: 1,519
Scales Modeled: American Flyer S Scale and some N Scale with a maginfier glass
Quote:
Originally Posted by wvgca View Post
i used a 15 volt power supply, my shield had the traces [two] that were cut for powering with 15 volt ..
i ran HO, for N scale i -beleive- 12 volts is enough ??.
Thanks WVGCA! I have a Fundumoto motor shield and data is very hard to find. (http://rc.mired.org/2017/09/the-fund...or-shield.html) What I want to do is duplicate cutting the trace so that the shield doesn't feed vin to the Arduino. However I am lost now. Any further thoughts?
__________________
"Take my advice because I don't use it!"
Fred
BrokeCurmudgeon is offline   Reply With Quote
 
Old 11-18-2018, 01:01 PM   #4
Shdwdrgn
Dispatcher
 
Join Date: Dec 2014
Location: Longmont, Colorado
Posts: 1,901
Yep that's what I've heard too... 12V for N scale (although I have also seen some HO that runs on 12V) and usually 15-16V for HO.

As for the board itself, just reading a little bit of that page would make me avoid trying to use that board. At the very least, there does not appear to be any access to the current-sense feature of the L298 chip (it can be added to some boards with a 3W 1.5 ohm resistor and a bit of soldering). Without being able to sense the current to the track, the board has no way of shutting down power if you get a short across your tracks. Also note that the L298 will only provide up to about 1.5amps to your layout, maybe enough for two locos, but only IF you add a heavy heatsink to that chip on your board.

If you can pull yourself away from 'shield' boards, there's a much better choice. Search for a BTS7960B (sometimes listed as IBT_2). This board can be found for about $7, includes the current-sense function, and can handle up to 43 amps of power (way more than you will probably ever need). Note this board only handles ONE track though, so you'd only use this on the main layout. You would also need a transistor and a couple resistors to complete the circuit. Here's what the circuit looks like connected to my ESP32:


The blue wires are the current sense lines, orange is the enable line, and yellow is the DCC signal output. The logic pins on this board get power directly from the I/O lines on the arduino, so no need to cut traces. It is also compatible with both 5v and 3.3v devices.

The circuit above is what I run here. The L298N board has been modified with the resistor to allow current sensing on my programming track, and I have a separate board to provide a regulated 5V power source out of my 16V power pack (which I also use to run an arduino that is set up as a decoder to run turnout servos). You can get much smaller arduino boards than the Mega/Uno, and plug them directly into a breadboard with the transistors and any other parts you might need. I use an ESP32 board with a built-in display and the corresponding DCC++ESP32 project code to allow wifi access, but not everyone cares about that.

Anyway, there are alternatives available that are much better suited for DCC if you are willing to do a little breadboarding.
Shdwdrgn is offline   Reply With Quote
Old 11-19-2018, 11:00 AM   #5
BrokeCurmudgeon
Dispatcher
 
BrokeCurmudgeon's Avatar
 
Join Date: Feb 2016
Location: Riverton Utah
Posts: 1,519
Scales Modeled: American Flyer S Scale and some N Scale with a maginfier glass
Thanks for your expert advice Shdwdrgn! Many years ago,Uncle Sam made me a Heavy Ground Radio Repairman after almost one year of training. Today I struggle with even the most basic electronic projects. Soldering is terrible. The suggestion to use discrete components is a good one. However it is beyond my abilities today due to my age effects, both physical and mental.
A shield seems to be a easier solution howbeit not as flexible. There must be a way to enable the current sensing capabilities in the chip. I will continue on...

p.s. for some reason I do not see your diagrams.
__________________
"Take my advice because I don't use it!"
Fred
BrokeCurmudgeon is offline   Reply With Quote
Old 11-19-2018, 11:20 AM   #6
Shdwdrgn
Dispatcher
 
Join Date: Dec 2014
Location: Longmont, Colorado
Posts: 1,901
Here's the direct link to the schematic... http://sourpuss.net/projects/trains/misc/DCCppESP32.png

When I referred to breadboarding the circuit, I was actually meaning a solderless breadboard. Sure I plan to eventually move my setup to a permanent soldered breadboard, but it's working just fine as it is. Note that the 43A bridge board already has header pins soldered on it, so you can just use jumper wires to hook it up to the arduino, but you still need that transistor to complete the circuit. Basically the transistor is just acting as a logic inverter, so something like a 7414 IC chip could probably perform the same function.
Shdwdrgn is offline   Reply With Quote
Old 11-19-2018, 11:30 AM   #7
BrokeCurmudgeon
Dispatcher
 
BrokeCurmudgeon's Avatar
 
Join Date: Feb 2016
Location: Riverton Utah
Posts: 1,519
Scales Modeled: American Flyer S Scale and some N Scale with a maginfier glass
Quote:
Originally Posted by Shdwdrgn View Post
Here's the direct link to the schematic... http://sourpuss.net/projects/trains/misc/DCCppESP32.png
.
When I tried to access the link my virus protection said "Website blocked due to a Trojan". Are you comfortable with this site?
__________________
"Take my advice because I don't use it!"
Fred
BrokeCurmudgeon is offline   Reply With Quote
Old 11-19-2018, 12:07 PM   #8
Shdwdrgn
Dispatcher
 
Join Date: Dec 2014
Location: Longmont, Colorado
Posts: 1,901
It's my website and server, so yeah I'm comfortable with it. Some virus scanners keep blocking my domain simply because of the name, not because they've ever actually found any malicious content on my servers.
Shdwdrgn is offline   Reply With Quote
Old 11-19-2018, 01:55 PM   #9
tankist
Station Master
 
tankist's Avatar
 
Join Date: Jun 2009
Location: NW Chicago burbs
Posts: 2,900
Scales Modeled: HO
Interesting discussion.
Althoug I don't expect to exceed 1.5A capacity ofL298 I Ordered a BTS7960B to try it out.
tankist is offline   Reply With Quote
Old 11-19-2018, 04:23 PM   #10
Shdwdrgn
Dispatcher
 
Join Date: Dec 2014
Location: Longmont, Colorado
Posts: 1,901
There is certainly an advantage to having a board that greatly exceeds your needs. I have two of these boards, and the first board I got didn't seem to work right (before I had a working DCC setup and was fumbling around in the dark)... I decided to try and troubleshoot so I pulled off the big heatsink from the back -- then the board started working. Must have been a trace shorting against the heatsink, but I never put it back on again. So far I haven't felt any heat at all coming from the chips, but I'm also only running a single loco. However I've heard of other people also pulling the heatsink to save space, and apparently you have to run quite a few locos at once before this chip starts generating any noticeable heat.
Shdwdrgn is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


» Visit These Sites:
LGB World

Or Our European Train Website ModelRailForum




All times are GMT -5. The time now is 08:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.