# DCC++ Arduino and jmri



## Riggzie (Dec 24, 2019)

ok so got my $40 bachman in that has dcc. Wanted a cheap train that was dcc so when I do the arduino and laptop setup, I would know it all works befor converting my old trains.

I have followed all kinds of youtube videos and im stumped.

I have tried an arduino mega with wire from 5 to 10

then tried an arduino uno with 2 wires from 2 to 13 and 10 to 12.
think that is it...

copied arduino dcc sketch to arduino.
panel pro sees arduino and all.
click power and all 4 lights on shield power on.
Bring up throttle and choose 3 for default and cannot control light or train. gotta check if train has light but it wont move.


side note. 
15v dc in tested with meter but checking voltage out to track is only 1.5v. does that mean I have an issue with the arduino shield? or is that normal voltage?


----------



## wvgca (Jan 21, 2013)

nope .. should be over 10 for voltage, 

and programming track is for programming, main track is for running
did you cut the traces on the L298 shield ??


----------



## Severn (May 13, 2016)

I built the one that's an arduino uno plus a Pelolu motor driver. It worked. Ah. I now also recall you have to set which motor driver you have in the addition code before you build and upload it.


----------



## Riggzie (Dec 24, 2019)

wvgca said:


> nope .. should be over 10 for voltage,
> 
> and programming track is for programming, main track is for running
> did you cut the traces on the L298 shield ??


yes i did and ohmed it out to make sure its cut


----------



## Riggzie (Dec 24, 2019)

Severn said:


> I built the one that's an arduino uno plus a Pelolu motor driver. It worked. Ah. I now also recall you have to set which motor driver you have in the addition code before you build and upload it.


got a link to that step?


i also noticed this is the shield. had to look in my orders.
flashtree arduino Motor Shield R3 5V to 12V for arduino A000079 https://www.amazon.com/dp/B07VCFQCY8/ref=cm_sw_r_cp_apa_i_ED-oEbV5RKHZ6


----------



## Riggzie (Dec 24, 2019)

so online chat with amazon person on the shield. they had me reset it, etc... weird thing is now....

im only getting 2 lights and not all 4.
BUT...
i now have 
DC in - 15v
A - 6.5v
B - 14.8v

should both match? I dont see why the programming track would have more power to it as its just typically a small run with no other trains on it.


----------



## Severn (May 13, 2016)

this is it and you'll need to be able -- well this is what i did. i soldered the headers and jumped the pins. you could just solder it all up i guess.

https://www.pololu.com/product/2503

i just connected to a regular bachmann junky old transformer from a set i have, PC.. and then two track segments. my set up is simple.

anyway, by hand i could verify by sending text [thru the arduino serial window] that the various aspect appeared to work and then jmri had no issue with it and it works ok enough.


----------



## Riggzie (Dec 24, 2019)

Severn said:


> this is it and you'll need to be able -- well this is what i did. i soldered the headers and jumped the pins. you could just solder it all up i guess.
> 
> https://www.pololu.com/product/2503
> 
> ...



Thanks.. appreciate it..

i have 2 - Arduino uno and 1 arduino mega plus 1 arduino motor shield so I want to go this route.

i just went and bought a true Arduino Motor Shield vs the generic flashtree i have. 

originally when I clicked power on from within JMRI - all 4 led came on; however, i didnt have track power. now with tinkering, etc... and resetting and all... its weird. i only have 2 led lights coming on but i do have 6.5v track power and 14v programming track power....

so i want to build 3 of these.. 1 for a friend... so i need more stuff anyway... thus ordered 


in a video... the guy said.. go and launch the dcc sketch and bring up the console monitor. Put a <1> in and all 4 lights will light up. *mine do not... hence my problem*

so ill get the other one in.. in 1 day!! WOOT AMAZON PRIME!!!!
and if i get it working, i will contact amazon to get a replacement on the other as it must be defective.

here is the video...


----------



## Lemonhawk (Sep 24, 2013)

When you measure the track voltage, with DCC you need to have the meter set to A/C.


----------



## Riggzie (Dec 24, 2019)

Lemonhawk said:


> When you measure the track voltage, with DCC you need to have the meter set to A/C.


oh thx...

still train doesnt move, nor lights work.

interesting enough i posted on a guys youtube video and he replied...
not letting me copy txt.. so screenshot.
I have an actual arduino shield on order now...


----------



## wvgca (Jan 21, 2013)

that will make a big difference , not all shields are made the same ...
I -assumed- you were using one of the recommended shields, not a weird clone of some kind ...
Get the right shield with the right pinouts, lol


----------



## Riggzie (Dec 24, 2019)

wvgca said:


> that will make a big difference , not all shields are made the same ...
> I -assumed- you were using one of the recommended shields, not a weird clone of some kind ...
> Get the right shield with the right pinouts, lol



yes and no.. there are knock off shields out there that even look different but work. For me the one I bought looks identical down to chip layout and pin labels and everything. It maybe just bad, not sure...

now funny thing here.. I went with the "actual arduino" and guess what... the vin to cut under the board doesnt exist. I had to use my cell phone and zoom in... the 2 pads exist with nothing connecting between them!!!!! ohmed it out and beeped...
so I ended up seeing the pin and bent it out of the way. all good now. weird...

but all in all im running!!!!!!! train light came on, fwd and reverse works.

now from raspberry pi, i cant get it to work and not too worried... need to hook it up to the tv and go into it and see what gives...
from my windows 10 surface pro touch screen were good!!!!!!


----------



## tankist (Jun 11, 2009)

Riggzie, I've run DCC++ on non genuine Arduino, and eventually migrated to ESP32. 

i'm having very hard time understanding what is it that you trying to do, what worked as expected and what didn't work as expected. sounds like you solved some issues , but still have questions. consider describing your issue in more detail.


----------



## Riggzie (Dec 24, 2019)

tankist said:


> Riggzie, I've run DCC++ on non genuine Arduino, and eventually migrated to ESP32.
> 
> i'm having very hard time understanding what is it that you trying to do, what worked as expected and what didn't work as expected. sounds like you solved some issues , but still have questions. consider describing your issue in more detail.


its easy... with an uno mega and flashtree motor shield, I am only getting 4.5v ac to the track. Ordered an actual arduino bramd motor shield and it works.

flashtree motor shield looks identical so its either bad or internally its different.


----------



## Riggzie (Dec 24, 2019)

long story short.. the one I had was defective. The FlashTree Shield replacement works...

now learning how to create a roster in JMRI...
Got my first loco in, but cant get it to work with my 4 digit number but 3 still works...
more to figure out.


----------

