With Instructables you can share what you make with the world, and tap into an ever-growing community of creative experts.
Tell us about yourself!
hello BillYou have been very busy! It has been quite the learning curve on this one! Thank you for the library link, I looked at that one but it was quite old and there were a few more recent folks to it (newer is not always better it seems).So my SPROG2 is 4 Bytes, not a problem setting that one, probably low on the "features list" to fix in software. As users give feedback you could create a list of command stations.I have added a fixed wifi address of 108 (above most domestic wifi etc) also reduced the speed to 250kbps to help with data reliability and set the power to Low (as it's on a bench!) they can go back up once it's in a loco.With the fixed decoder address 3 hard coded my set up is quite reliable forward/reverse and stop are all ok (just the odd time when at full speed it fails to respond to a slower speed? Serial monitor reset the Arduino so I am not sure why it stopped). The forward/reverse LEDs were working but have now stopped, not sure why yet? I am still on "training wheels" when it comes to software so please forgive me if I say something inappropriate ;) but I am enjoying learning.Good to hear the speed has improved, I have also seen the use of millis() to improve code speed? I read about it and had to have a lie down afterwards! :)Thanks againMartin
hello BillThank you for the help with this as I assume the problem is with my setup!Arduino is 1.6.12RF24 library is TMRh20 Ver 1.1.7My guess is this library is the problem,whilst up to date it is not the one you used? If I remove the done= from line 182 it builds and receives the DCC command but only once i.e the loop is stopped after the first run. Probably due to the Bool done test?I am using the SPROG 2 as a bench test unit in service mode. (Have not tried it in Opps mode yet)I also have ESU Ecos and Roco command stations.(no tested it yet with these)Re the 3/4 Byte my understanding was that the Basic Packet Format (NMRA) is 4 Bytes, preamble (1byte) and 3 command Bytes.The Extended Packet Format is upto 6 Bytes.I see Geoff uses Alex Sheppards library NmraDcc.h to handle the Packet formats.Re the speed of the RF24. Is it possible that the serial.println is slowwing thing up? I have seen others comment them out once they have their projects debugged.RegardsMartin
hello BillFinally got a couple of hours spare, put it all together with only one problem so far! The Reciver code throws the error "void value not ignored as it ought to be" on line 182 .... done = radio.read(inmsg, 1);I have // it out to get it to upload, the serial monitor shows the rNF24 info but no received commands (the Transmitter does show commands in serial monitor) ?Hope it's just a typo ?RegardsMartin
Model Railway DCC wireless commands on a dead rail system
hello BillI will have to read this twice! But I think you have "nailed it" really can not wait to upload the code and give it a try.Great idea to make it a DCC to DCC end to end wireless solution with the H-Bridge at the receiver end, if I want to use Geoffs "mobile decoder" can I just connect pin 06 PWM from the Arduino to pin 02 on the mobile decoder to give it a try? In the long term the plan would be to incorporate your code with Geoffs to give a single Arduino /nRF24 (basic wireless DCC Decoder) not sure if the clock/timings and I/O are compatible :(Buts that's in the future, this gives me a great stepping stone to my Battery/wifi loco project and I can keep my very expensive sound decoders working :) without having to clean the wheels and track every few weeks.Best RegardsMartin
Garden Train - Arduino / Wireless DCC
Hello BillYou are a genius! I will keep an eye out for that post.RegardsMartin
hello BillThank you for your positive support, I have used LiPo 1 cell (with step up) and 3 cell LiPo battery with great success on my "dead rail" loco's, also with "ON track charging" powered track in stations etc . I see you are familiar with Geoff Bunza's projects, as I have his "mobile decoder" up and running (2 motors, 1 servo and several LED outputs) I assumed getting the DCC packet in (via pin 2) would be a just a binary input? Not needing the optoisolator circuit? I have found a couple of Arduino programs on line that read the DCC track and out put to the serial window the Binary packets and also convert them the "human readable" form, it was one of these that I was trying to use with the nRF24 to transmit the DCC packet to the Arduino loco decoder.RegardsMartinK
hello BillC35Thanks for posting this great idea, I also have a lot of trouble with power/track and have tried various "Deadrail" solutions but have yet to find the ideal solution for my HO/OO locos ( not much space inside for battery/radio/cpu etc. ) I have a bench project that uses Arduino MiniPro with H-bridge, battery powered via wired DCC. My aim is to use nRF24 (2.4Ghz) to replace the wired DCC and make it wireless. However Iam no software engineer and it's slow progress.Basically I need a DCC track signal sniffer to transmit DCC and my Arduino loco decoder to receive it! I have been using the excellent DCCNMRA library for Arduino by Alex Shepard and also Geoff Bunza's DCC decoders but the DCC packet via wifi is giving me a headache ?. Maybe this is a project you might like to fix with me? I have asked many rail modlers and they all say "why can you wiz kids not fix this track/wheel power problem" I see Bluetooth solutions but none with DCC "bridge" or just their own RF handsets!I will follow your progress, good luckMartinK
Join 2 million + to receive instant DIY inspiration in your inbox.
Download our apps!
© 2016 Autodesk, Inc.