author
9Instructables73,082Views132CommentsFalkland, Scotland

Tell us about yourself!

Achievements

100+ Comments Earned a bronze medal
10K+ Views Earned a bronze medal
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi, these variables are part of the clock sequence in the microcontroller and are vital to create the DCC signal.If you copied and pasted the sketch into your Arduino IDE, there will be some errors. You should re-type the lines that are "not declared'Can you load other sketches on to the Arduino Pro Mini ok ?Try some simple sketches just to ensure correct set up.Bill

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi Rafael,Sorry I also had a senior moment in giving you the wrong instructions !Please change this part of the code:From:addr5 = 1; // gives decoder address of 17 to 20addr6 = 2; // gives decoder address of 21 to 24addr7 = 3; // gives decoder address of 25 to 28addr8 = 4; // gives decoder address of 29 to 32To:addr5 = 5; // gives decoder address of 17 to 20addr6 = 6; // gives decoder address of 21 to 24addr7 = 7; // gives decoder address of 25 to 28addr8 = 8; // gives decoder address of 29 to 32Bill

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Thanks for your interest in my project.To control address 17 onwards change lines in the code:From:addr1 = 1; // gives decoder address of 1 to 4 addr2 = 2; // gives decoder address of 5 to 8 addr3 = 3; // gives decoder address of 9 to 12 addr4 = 4; // gives decoder address of 13 to 16To:addr5 = 1; // gives decoder address of 17 to 20 addr6 = 2; // gives decoder address of 21 to 24 addr7 = 3; // gives decoder address of 25 to 28 addr8 = 4; // gives decoder address of 29 to 32From:if( (Msg->Data[0] == 0x81) || (Msg->Data[0] == 0x82) || (Msg->Data[0] == 0x83) ||(Msg->Data[0] == 0x84)){ //for Addr1 = 1, Addr2 = 2, Addr3 = 3, Addr4 = 4 To:if( (Msg->Data[0] == 0x85) || (Msg->Data[0] == 0x86) || (Msg->Data[0] == 0x87) ||(Msg->Data[0] == 0x88)){ //for Addr5 = 5, Addr…

    see more »

    Thanks for your interest in my project.To control address 17 onwards change lines in the code:From:addr1 = 1; // gives decoder address of 1 to 4 addr2 = 2; // gives decoder address of 5 to 8 addr3 = 3; // gives decoder address of 9 to 12 addr4 = 4; // gives decoder address of 13 to 16To:addr5 = 1; // gives decoder address of 17 to 20 addr6 = 2; // gives decoder address of 21 to 24 addr7 = 3; // gives decoder address of 25 to 28 addr8 = 4; // gives decoder address of 29 to 32From:if( (Msg->Data[0] == 0x81) || (Msg->Data[0] == 0x82) || (Msg->Data[0] == 0x83) ||(Msg->Data[0] == 0x84)){ //for Addr1 = 1, Addr2 = 2, Addr3 = 3, Addr4 = 4 To:if( (Msg->Data[0] == 0x85) || (Msg->Data[0] == 0x86) || (Msg->Data[0] == 0x87) ||(Msg->Data[0] == 0x88)){ //for Addr5 = 5, Addr6 = 6, Addr7 = 7, Addr8 = 8Then amend each segment of code :From:if (MainAddr == addr1){ // T1 to T4 To:if (MainAddr == addr5){ // T17 to T20............From:if (MainAddr == addr2){ // T5 to T8To:if (MainAddr == addr6){ // T21 to T24 .............etcif (MainAddr == addr7){ // T25 to T28if (MainAddr == addr8){ // T29 to T32Otherwise, the rest of the code remains the same.Bill

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Hi Bill, I have updated the Arduino code and a new App. It operates much faster and the App has many more features. (The new code does not work with the old App)Bill

    View Instructable »
  • Model Railroad DCC Command Station V2

    Hi guyr, thanks for letting me know. Your finished project looks great. Happy railroading !

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi RichardGlad that worked for you.The system does automatically transmit loco numbers 1 and 2 with zero speed, in addition to your current locos. This is required to ensure constant data is seen by the decoders otherwise they may stop responding to DCC packets.It should not interfere with your normal operations.Bill

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi, did you build this yourself or did you purchase system from me ?Please ensure you have the latest version of the App LocoMotive DCC v17Go to the 'Address' layout and enter 6 into the 'Qty of Packets sent' field- if that does not work, try more than 6Bill

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi klaus, on looking again at your video, I think there may be a short circuit on your track. The red led on the Arduino flickers on and off meaning there is a fault, please check.Regards, Bill

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Kaus, sorry to hear of this problem. Please try pairing the Bluetooth device again with your phone. Delete the original pairing and start again. Contact me directly on:billc at john-lewis dot comThanks Bill

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi Alex, yes I did start with your great idea on this, thanks for all your efforts.I decided to keep options open to users to allow for variations in use of the circuit. For example in my own loft railway, I use 6 turnouts using solenoids plus 2 on/off switches for lights and station announcement (switches on an Arduino based sound circuit). I did not want to turn the circuit into a decoder and preferred to keep options within the Arduino code.As you know, other users require different pulse widths, use of tortoise and servos, etc. The servo example by passes the h-bridge IC's. Please find attached circuit diagram - hopefully fully readable and printable.Thanks for your interest and if you want a PCB let me know - I have only 1 left.I plan to get more manufactured later this month.Take c…

    see more »

    Hi Alex, yes I did start with your great idea on this, thanks for all your efforts.I decided to keep options open to users to allow for variations in use of the circuit. For example in my own loft railway, I use 6 turnouts using solenoids plus 2 on/off switches for lights and station announcement (switches on an Arduino based sound circuit). I did not want to turn the circuit into a decoder and preferred to keep options within the Arduino code.As you know, other users require different pulse widths, use of tortoise and servos, etc. The servo example by passes the h-bridge IC's. Please find attached circuit diagram - hopefully fully readable and printable.Thanks for your interest and if you want a PCB let me know - I have only 1 left.I plan to get more manufactured later this month.Take care and stay safe.Bill

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    The Locomotive DCC Controller is limited to loco ID 1 to 20However, you can change address on the App from 27 to an address within this range.If you have the free App go to 'Address' on main menu, then press 'Address' on CV1 page and select a number 1-20 then press Go. The loco will now have this new address.If you have the full App you can also read and write CV's including CV1 (loco address)Bill

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Sean, glad to hear you have successfully built the system.If you are familiar with Arduino code, the required commands can be extracted from the sketch on my Instructable on the hardware version of dcc controller. Or you can get the DCC packet details on the NMRA website.Bill

    View Instructable »
  • Model Railroad DCC Command Station V2

    Very nice! Maybe you are ready to have a look at the Bluetooth version which has full cv read write.Bill

    View Instructable »
  • Model Railroad DCC Command Station V2

    Hi Yammas2, you could try the Mega, however not sure if running clock2 will conflict with code for TFT.Bill

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Waveforms look good. 116 us represents a digital '0' while 58us is a '1' (58 +/- 3 is the NMRA spec although most decoders are more tolerant than that)Maybe need 2 x 7805 regulators on the pcb ?

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Looks good Bill ! I like your double heatsink on the Vreg. Glad to hear it works with WiFi ok. I found Android versions 9 and 10 are difficult to connect to the system. Bill from Falkland, Scotland

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi, did you build the DCC system or purchase a fully assembled PCB ?You will need to purchase a decoder for your analogue train. The controller only works on DCC and has no analogue output. The train will just buzz as it is fed with +/- 14v AC and will not move.I do not know where you live, but I can give you a link to and eBay source for a decoder. Once you purchase one, follow the instructions to install in your train.The cheapest decoder here:https://www.ebay.co.uk/itm/192696880266

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, I hope you are keeping safe and well.For JMRI, I use a SPROG device found here:https://www.sprog-dcc.co.ukMy DCC system is stand alone via Bluetooth and an Android App and does not connect to JMRI.In the video, the tram changes direction using a Lenz decoder and a ABC braking module found here:https://www.aandhmodels.co.uk/abc-braking---automa...I have an ABC module placed at both ends of the tram track (across a cut in the track at about 20cm from each end)Bill

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi EdI now have the PCB for turnout control available on eBay:https://www.ebay.co.uk/itm/DCC-Digital-Model-rail-...The DCC system is also available on eBay:https://www.ebay.co.uk/itm/DCC-Controller-for-mode...Bill

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi Ed in OhioI have run out of PCB's for the moment (been popular) and should have 10 more to sell on eBay within a few days. I will let you know when they are available.Bill from Falkland in Scotland.

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi Billitem num is 233461778549 on eBay

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi, BillI now have another 10 PCB's for sale on eBay (for V2 of DCC Digital Model rail 8 o/p for points, turnout, accessories)

    View Instructable »
  • Arduino - Points/turnout/accessory Control V2

    Hi Bill, The v2 has improved protection of the h-bridge when outputs are shorted or overloaded. Also, all of my sketches now relate to the new design. If you have not assembled the boards you have, I would recommend you re-order the new ones.I am waiting a delivery of these and should be on eBay by the end of this week.If you decide to order 1, I shall give the second one free. The boards you have already (v1) may be safely used for driving relays and LED lights.where the risk of over load or shorts is lowerThe use of 'off' is just the same as 'x' i.e. 2 off resistors = 2 x resistorsThanks for your support.Bill from Falkland, Scotland

    View Instructable »
  • Model Railroad DCC Command Station V2

    Michael, please contact me directly and I shall send copies to you. billc at john-lewis dot com

    Hi Michael, Do you get this error when you compile the sketch (press ✔︎) on top left of sketch window ?Please check lines 29 & 30 of the code should read :String speedString1;String speedString2;

    Michael, note I have replaced the .ino (Arduino code) files with text files to overcome issue with Instructables website.Try downloading again and copy text into a new blank Arduino sketch.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    OK Alex, glad it works for you (albeit with some bugs). It is so easy to become lost in the complex logic and timings involved. You know the best solution is to add another Pro Mini to your circuit using the same onto coupler. In this way you can isolate the timings of flash leds and servo while gaining advantage of multiple actions from each button T1.... T16 Let me know if you take up on this.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Alex, looking at your sketch where L15 stays on you need to add a line at the end of this section of code: i.e. digitalWrite(15,0); if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 1 && (Msg->Data[1] & 0x01) == 0){ // pin A1 led off // pin 15 A1 T13 led15 = true; } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 1 && (Msg->Data[1] & 0x01) == 1){ // pin A1 led on // pin 15 A1 T13 led15 = false;digitalWrite(15,0); }

    Hi Alex, I am getting a bit lost in the dev of this sketch. I looked at yours and seems fine, however, I have made yet another version with control of servo range and speed - see lines 95-97 servo_sweep_interval = 200; // interval to step the servo (milliseconds) this contriols speed of travel min_range = 5; //this contriols max range of travel in multiples of 5 (min value of 5) max_range = 95;// this contriols min range of travel in multiples of 5 (max value of 175)I have swapped pin3 with pin10 (pin3 has servo sweep and pin10 has servo points)Hope this meets your requirements !

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, I had another go at solving the timing issues you raised. The attached text file contains updated sketch with time sequences introduced to allow multi-operations. Please check out.

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    No problem, Michael, I am glad to hear of progress. A sense of satisfaction for you at last.Please let me know how you get on with next steps in project.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Thanks for the video Alex, your work is impressive.I looked at the link you gave and I doubt if this would work along with the NMRAdcc library. Could you have the servos running faster on the points controls ? They do operate slowly at the moment. If made faster, the delay in flashing less may be less noticeable.line 58 in the last code I gave, has servo_speed = 15;Try some other numbers - 0=full speed, 1-255 slower to faster

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Hi Michael, you might be more successful using this link:https://randomnerdtutorials.com/installing-the-esp...You should not have to move folders and files around.

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Michael, these links might be more helpful for you:https://randomnerdtutorials.com/installing-the-esp...or:https://github.com/espressif/arduino-esp32/blob/ma...

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, great scenery and action in your layout!The Arduino can only complete one task at a time, therefore the flashing lights will stop when the servos run. You would need to have another Pro Mini just for the flashing LEDs to cure this. Maybe there will be an Arduino with twin core features in the future. I did find a sketch where someone uses 'mills' and interrupts - not sure if that would work with the #include NMRADcc.h. library. I will try it out later and get back to you.On the servo moving till you stop question - see attached test file (text format)

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Michael, I think that means the ESP32 Core has not been installed properly.I am afraid you will have to go back to the Lastminuteengineers site and follow 'Installing the ESP32 Core on - Windows OS' (for a PC)When successful, the Arduino boards list will contain a variety of options including Node32S and NodeMCU-32S, etc

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Michael, you only connect one of these two boards while loading the Arduino code (sketch)The IDE only recognises one board type at a time.You will need an adapter for the Arduino Pro Mini (if you do not have one already)see eBay item #264206118002The ESP32S does not require any other device other than an USB cable.

    Michael, the ESP32S must be programmed via the Arduino IDE. Go to Tools, Board, and select NodeMCU-32S from list.Go to Tools, Port and select /dev/cu.SLAB_USBtoUART That is the option on my Apple MacBook Air - something similar on PC I would imagine.See how far you get with that and let me know outcome.

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Hi Michael, sorry to hear of these problems. I understand you have loaded the ESP32S with the code successfully now. Can you connect to the ESP32S WiFi now , using correct name and password on your Android device settings ?What device (phone or tablet type) are you using ?What Android version does this device have ?I have found Android 7 works fine, however Android 9 requires you to switch on GPS in the Location settings of your device.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, at last I have had time to test your alternating flashing lens. I tried adding the sketch to this reply but got. server error so I have added this new sketch to the Instructable above.The sketch does the job on T16 with o/p 18/19 flashing !

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Alex, sorry I did not test my last suggestion, please amend void flash1819() as follows; if (led18 == false){ digitalWrite(18,0);digitalWrite(19,0);}

    Hi AlexTo make your double flash LED'sReplace void flash18() with :void flash1819(){ digitalWrite(18,0);digitalWrite(19,0); if (led18){ if (led18State == LOW){ led18State = HIGH; led19State = LOW;} if (led18State == HIGH){ led18State = LOW; led19State = HIGH; } digitalWrite(18,led18State); digitalWrite(19,led19State);} }And edit here:MainAddr = 0; currentMillis = millis(); // led flash timer if(currentMillis - previousMillis > interval) { previousMillis = currentMillis; flash17();flash1819(); //. new void for alternative 18/19 flashing } Dcc.process();

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    To make double flash on T16,Add: int led19State = LOW;pinMode(19, OUTPUT); // T16 flashled19 = false;Add to:if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin A4 led flash on // pin 18 A4 pin 19 A5 T16 led18 = true;led19 = true; } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin A4 led flash off // pin 18 A4 pin 19 A5 T16 led18 = false;led19 = false; digitalWrite(18,0); digitalWrite(19,0); } Add new void():void flash19(){ if (led19){ if (led19State == LOW) led19State = HIGH; else led19State = LOW; digitalWrite(19, led19State); } else digitalWrite(19,0); } On the short iss…

    see more »

    To make double flash on T16,Add: int led19State = LOW;pinMode(19, OUTPUT); // T16 flashled19 = false;Add to:if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin A4 led flash on // pin 18 A4 pin 19 A5 T16 led18 = true;led19 = true; } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin A4 led flash off // pin 18 A4 pin 19 A5 T16 led18 = false;led19 = false; digitalWrite(18,0); digitalWrite(19,0); } Add new void():void flash19(){ if (led19){ if (led19State == LOW) led19State = HIGH; else led19State = LOW; digitalWrite(19, led19State); } else digitalWrite(19,0); } On the short issue, the circuit has a 0.1 ohm current detector that will shut down the h-bridge when current > 2 ampsThere is a time lag of around 50 milliseconds before triggering. It looks like your power pack is reacting sooner and turning off the DC supply.What power unit are you using (max current) ? Can you add big capacitor (>470uf 16v) to output ?

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi AlexChange these lines in the code:From: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin A0 led on // pin 14 A0 T12 digitalWrite(14,1); } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin A0 led off // pin 14 A0 T12 digitalWrite(14,0); } To: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin A0 led on // pin 14 A0 T12 led12 = true; } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin A0 led off // pin 14 A0 T12 led12 = false; …

    see more »

    Hi AlexChange these lines in the code:From: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin A0 led on // pin 14 A0 T12 digitalWrite(14,1); } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin A0 led off // pin 14 A0 T12 digitalWrite(14,0); } To: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin A0 led on // pin 14 A0 T12 led12 = true; } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin A0 led off // pin 14 A0 T12 led12 = false; } Add to:boolean led17, led18; // o/p 17,18 set for flashing ledboolean led12;Add to: led17,18 ...led17 = false; led18 = false;led12 = false Add to :int led17State = LOW; // ledState used to set the LEDint led18State = LOW;int led12State = LOW;Add a new void ...void flash12(){ if (led12){ if (led12State == LOW) led12State = HIGH; else led12State = LOW; digitalWrite(18, led18State); } }Add to:currentMillis = millis(); // led flash timer if(currentMillis - previousMillis > interval) { previousMillis = currentMillis; flash17(); flash18(); flash12(); }To change the frequency of flash:Set at 0.5 second on and off by:interval = 500; // interval at which to flash led (milliseconds)Change interval to less than 500 for faster flash or less for slow flash.

    AlexIn void flash_(), add line 'else digitalWrite(18,0);'void flash18(){ if (led18){ if (led18State == LOW) led18State = HIGH; else led18State = LOW; digitalWrite(18, led18State); } else digitalWrite(18,0); }

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Alex, glad to hear of your success.The delay in reading current is unavoidable in the App as I send packets of data every 5 ms for all 20 locos and functions within a window of 2 seconds.The current reading is received every 2 seconds.I shall look into the 28 speed step question, however I need to look into routing as a possibility. The App is developed in the MIT App Inventor website and on my 2018 MacBook Air, it barely copes with the size of the App as it is. (although only 3.24 MB in size)The Zener Diode is only a protection device to Arduino inputs and does not affect current readings.If I update the App with any of your ideas I shall be pleased to inform you.Happy modelling and best wishes from Bill in Scotland to you in Bulgaria (as learned from App purchase records)

    Hi Alex, Thanks for video. It is obvious the servo is still active.On review of sketch, I did not have the correct code for servo detach. Now amended and new sketch attached.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, thanks for your feedback. This exercise is useful for others who may wish to purchase my points controller PCB. I have one customer who is building a servo points system. I am a retired electronics engineer and this is my hobby and I am glad to help.I have added 'VarSpeedServo detach();' to the code after servo ops. This should cure the noise issue. See attached updated sketch.For changing the order of buttons, there are 2 choices either re-arrange the wiring to suit or alter the code. The code may be changed for example T8 using pin 10 to pin 11:From: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin 10 T8 myservo10.write(max_pos[10],servo_speed,true); VarSpeedServo detach(); } if ((((…

    see more »

    Hi Alex, thanks for your feedback. This exercise is useful for others who may wish to purchase my points controller PCB. I have one customer who is building a servo points system. I am a retired electronics engineer and this is my hobby and I am glad to help.I have added 'VarSpeedServo detach();' to the code after servo ops. This should cure the noise issue. See attached updated sketch.For changing the order of buttons, there are 2 choices either re-arrange the wiring to suit or alter the code. The code may be changed for example T8 using pin 10 to pin 11:From: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin 10 T8 myservo10.write(max_pos[10],servo_speed,true); VarSpeedServo detach(); } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin 10 T8 myservo10.write(min_pos[10],servo_speed,true); VarSpeedServo detach(); } To: if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 1){ // pin 11 T8 myservo11.write(max_pos[11],servo_speed,true); VarSpeedServo detach(); } if ((((Msg->Data[1]) - 0xf8>>1) + 1) == 4 && (Msg->Data[1] & 0x01) == 0){ // pin 11 T8 myservo11.write(min_pos[11],servo_speed,true); VarSpeedServo detach(); }

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex please try attached Arduino sketch and library file that must be used.This has 8 servos, 6 led on/of and 2 flashing leds

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Hi, all looks very good and neatly done.After initial WiFi connection on phone, please try closing App then open again. You may have to press the 'Start' button a few times to establish connection. When the name of the WiFi connection appears in place of "DCC_WiFi' the connection is ready. Try the controls even though a message may still appear to say 'Check WiFi' - this will normally go away once started.

    View Instructable »
  • WiFi DCC Command Station for Model Railway

    Yes, you need an USB to TTL adapter to programme the Arduino Mini Pro such as ebay item # 264206118002

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi AlexI tried your servo sketch on my layout (using Nano) and I did find weird goings on.The Arduino code was totally corrupted in some cases and I had to re-prog it.I do not recommend the use of this sketch as there is no filter for garbage messages and noise gets through to corrupt the memory.The sketch I use for solenoid points has a 'filter' where it only passes through valid DCC packets and appears much more solid in use.I will look into developing a servo sketch using this starting point.What angles of movement do you require for servos - start and end positions ?How many servos do you use ?

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, is the 1000uf capacitor across the rectifier bridge ? I would put a small resistor in series with it if it is. When crossing points there is likely to be momentary open circuit at non metal part of points, when making contact again, the 1000uf cap will take a surge in current of short duration but enough to disturb the DCC o/p.Value of resistor depends on current drawn by lights. Are they LEDs ?

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, good progress. I am aware of the issue with NmraDcc v2 as it applies to my points controller also. I did not mention this as I thought your servo controller worked with the Piko station therefore ruled that out.On this new issue, it sound like the Pro Mini on the servo board is being reset.This can happen due to spikes. When the car with lights passes the turnouts do the lights flicker ?Can you try keeping the wiring from DCC o/p to servo controller as short as possible ? Maybe try twisting the pair of wires ?

    Hi Alex, I will have a v10 available soon as a another attempt to improve the data packet going to your servo decoder. I will add a function to select the number of attempts at sending accessory decoder data (1 t0 5)I have made the changes but need to test it out on my layout etc. before release. I will inform you when available.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, I have released an update to App that has improved data handling for accessory decoders. Please try with your servo board and hopefully works now. The update has just been uploaded and will be available on Google Play store in a few hours. Look for version 9 (v9)

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex,My controller board is based on same as your servo board (Geff Bunza design) but using h bridges to switch solenoids.I use a Nano instead of Pro mini.I was able to load the servo prog onto it for testing, otherwise is same config as yours. I have found timing issues with this design when the DCC input is not 'caught' by the coding. I have some ideas on solving this issue and will get back to you.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi AlexSorry I confused you. The servo sketch does not operate as a loco decoder. Go back to original sketch for servo points.When acc addr are set to 11, 12, 13, 14 on my App the Servos should operate when T1 to T16 are pressed. I have tested this using my circuit and App and all works OK. I noticed the servo sketch needs a few seconds to setup before it will work. I have updated App to include acc adddr numbers

    Hi Alex, I loaded the sketch onto an Arduino Nano (on a points controller pcb I have) and a single servo on D11.You need to enter 11, 12, 13, 14, into the Buttons T1-T4, Buttons T5-T8, Buttons T9-T12, Buttons T13-T16, Accessory addressesThis produces Acc addresses of 40 - 56The sketch covers 17 servos while my App is limited to 16 therefore whatever servo is on F0 will not work.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, that is good to know for future reference.The address you want can be set, albeit a little complicated:Go to 'Address' on the AppUnder 'Accessory Address' got to 'Buttons T9-12'Enter '13'Now buttons T9 - 12 will respond to Acc addresses 49 to 52You will see a message at top of screen saying file not found (this will go when you close and open App again)The calculation is :Acc Address X 4 Say the number you enter into box under 'Enter 1-63' is A (in above example A =13)For each set of 4 buttons gives actual addresses of :T1,T5,T9,T13Actual address = A*4 -3T2,T3,T10,T14Actual address = A*4 -2T3,T7,T11,T15Actual address = A*4 -1, T4,T8,T12,T16Actual address = A*4

    Hi Alex, I need to try out the Arduino sketch you have on your servo points, however it looks like a loco address 40 that is used. As my system only covers 1-20, you could try changing the Arduino sketch to address 20 and see if function keys operate the servos.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, I had another go at calculating the required numbers for pulse length:While you wait for Arduino, please try if you can:Change from:#define TIMER_SHORT 0x8D // 58usec pulse length #define TIMER_LONG 0x1B // 116usec pulse length To:#define TIMER_SHORT 0xC6 // 58usec pulse length for 8Mhz clock#define TIMER_LONG 0x8D // 116usec pulse length for 8Mhz clockIt would be interesting to see if this works on 8Mhz devices (which I do not have).

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Alex, what type of Arduino Pro Mini do you have ?The Atmega 328 5v 16 Mhz must be used.The Atmega 168 5v 8Mhz does not work - the clock used to generate the DCC packets will not run.

    Hi Alex, I cannot see what is wrong with your circuit. I can send you a free PCB to build an alternative system that I know works.If you can provide your home address, I shall post it to you by Royal Mail International Standard delivery. If you prefer, you may contact me directly with address on billc at john-lewis dot com

    Hi Alex, glad you may have found the source of problem. I look forward to your next report.

    Hi Alex, something to try while you wait for new Arduino.If your board is running at 8Mhz, change the following lines from:#define TIMER_SHORT 0x8D // 58usec pulse length #define TIMER_LONG 0x1B // 116usec pulse length to:#define TIMER_SHORT 0x70 // 58usec pulse length for 8Mhz clock#define TIMER_LONG 0x0D // 116usec pulse length for 8Mhz clockNot certain if these are correct values, but worth a try.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Also, how do you know e-stop is working ? Did you place a volt meter on output ? Just to make sure that bluetooth is connected:1. Pair your Samsung tablet to BT device on the circuit which must be set at 9600 baud (some are not)2. Load App then press the 'Get Bluetooth' button to connect

    Hi, cannot see the problem from your video. However please check:On the Arduino serial monitor, do you see a flow of data DD,n,n Are you sure that D5 from Arduino goes to Dir and D6 goes to Pwm ?Is there 14v on the V+ on LMD ?

    Hi Alex, Yes that is correct. The serial monitor runs at 115200 baud while the BT runs at 9600.I am keen as you are to solve this problem.What short address numbers do your locos have?Have you tried changing the address on the App ?Can you read the CV values ?What is the value of CV29 ?What power supply are you using ?It must be smoothed DC and not simply a rectified AC.

    View Instructable »
  • Model Railroad DCC Command Station V2

    Hi Guy, If you have basic knowledge of electronics and able to solder, then I am sure you will be able to make this project. You will need to familiarise yourself with the the Arduino IDE, how to load sketches (all supplied) and load required libraries.If you need any assistance, please ask.

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi Alex, the L298 is not suitable for this DCC application - it does not have MOSFET outputs (has bipolar transistors with high sat voltage which reduces the DCC output level). I did find an alternative h-bridge that works quite well with amended sketch. The DRV8871 is on eBay at 4.60 GBPhttps://www.ebay.co.uk/itm/272665415480The on board resistor of 30k limits current spikes of 2 amps - this is too low to cope with noise levels on a layout where spikes of > 2 amp can occur. I changed this value to 15k (min allowed by TI) with a current limit of 6 amps. The DCC system will stop overloads >2amp while the DRV8871 will shut down on short circuit (recovers when short is cleared). The L298 sketch will not work with the DRV8871. Let me know if you want a copy of the new sketch.

    View Instructable »
    • Arduino - Points/turnout/accessory Control V2
      99 views
      0 favorites
      0 comments
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi, Alexander. Hope you do mind if I ask a few questions to help understand your setup.Did you build my circuit as in Instructable above ?What power supply are you using ?What decoder do have in the loco ? Are you using my App ?Regards Bill

    Hi, I should have advised to remove jumper on enable A pin.I am currently on holiday, however when I get home next week I plan to investigate the LM298 further as it is cheaper and easier to source than LMD18200. Thanks for trying, I will keep in touch.Bill

    View Instructable »
  • Model Rail Digital DCC Command Station Arduino and Free App

    Hi, the L298 does not switch on/off as fast as LMD18200T and output DCC waveform is not as clean - however it may work OK. This would need a change to the Arduino code which I have attached for you to test. The connections would be:DCC out 'Motor A'Remove jumper for 12v/5v regConnection from connector block on PCB to LM298V+. to power pin Vs0v to GndDir to Input 1Pwm to Input 2Br to enable ASolder wire from regulator 5v output on PCB to 5v input on modulePlease find attached amended copy of Arduino sketch.Please note- this is for your experiment and I do not guarantee it will work okLet me know how you get on.Best regards, Bill

    View Instructable »
  • Model Railroad DCC Command Station V2

    Hi Tao, I have solved the problem with TCS decoders on CV1 write. Please download the latest Arduino sketch 'Command_Station_with_keypad_7_sep_2019.ino'Sorry it took me so long !!

    View Instructable »
  • Model Railroad DCC Command Station V2

    Hi Dave, sorry I did not reply sooner. However you seem to have found a way round the problem! I was going to suggest the issue with the Arduino loading may have been due to the latest Arduino IDE update includes a faster loader for Nanos. The older or clone Nanos require us to choose the older loader from the file menu. With your success on using the older files makes that unlikely. There may have been a problem with the downloaded libraries for the newer version ?Thanks for you support and enjoy using your completed project.

    View Instructable »
  • Hi Tao, please try the attached file 'Command_Station_with_keypad_11_july_2019.ino' to check if CV1 can be changed on your TCS decoder.Thanks.

    View Instructable »
    • WiFi DCC Command Station for Model Railway
      155 views
      0 favorites
      0 comments
  • Hi Tao, Do you still have issues with the writing of CV1 on a TCS decoder ?I could look at increasing the time delay between write packets tory and resolve this.

    View Instructable »
  • Hi Tao,If the decoder is installed in the loco, you will not need the resistor.What value are you trying to give CV1 ?Ensure the track and wheels are clean.Not sure what else to suggest. I am away on holiday till mid next week. I will have another look at this problem then.

    Hi Tao,How are you connecting the TCS decoder to the DCC Command Station ?It must have the loco motor on its output to change CV1. The decoder must be in the loco or it should be ok with a 150 ohm resistor between the motor wires.Hope this helps.

    View Instructable »
  • Hi Juan, I have attached a zip file of library used in the sketch. If attachment does not come through I can send directly by email. My email is billc 'at' john-lewis.com

    Hi Juan, I have attached the Adafruit GFX AS library for you. You could use the DCC system without display if you want to try it out using keyboard only.

    Hi Juan, This TFT shield is for the UNO and will not work directly with my DCC code. I have used this type on another project where I used a PCF8574 (8-Bit I/O Expander for I2C Bus) chip to connect it to an Arduino Pro Mini. It requires different library files and is not compatible with the existing sketch code for the DCC command station display - sorry, but you do require to use the specified display (available from eBay as in link above)

    View Instructable »
  • Hi Keith, glad to hear you resolved the problem. Please let me know when you have completed and fully tested the system.

    View Instructable »
  • Email msg not received with jl...broadband address. Please try again with 'billc at john-lewis (all small case with hyphen) dot com'

    Hi Alan, I am not sure either about messages sent from this site! I thought I replied last night but no sign of it here today. The momentary F1 will still appear as 1 or0 on the display but should work ok. Maybe you should only change the sound functions F2 and F3 though as F1 is usually engine sound on/off which should not be momentary.The turnout address for your decoder should be 0x8b, 0x8c, 0x8d, 0x8e to provide decimal addresses 11, 12, 13, 14

    Alan, thanks for your order on e-bay I shall post pub today.If you want to contact me directly, my email address is billc@john-lewis 'dot' com

    View Instructable »
  • Alan, the display will still show 0 and 1 but should work as momentary switches for sound on F1 etc.Not sure what is going on with the turnout address on your decoder. I shall have a look and get back if I find an answer.

    View Instructable »
  • Thanks for your feed back. I am delighted to read of your success with the project. The Arduino sketch may be modified to make the sound functions momentary if you wish. The turnout code should work 'as is' for accessory decoders (tested on Decoder Pro SPROG) (or you may want to build my project on this subject where 8 pairs of outputs can be switched). The accessory address in the Command Station sketch is :void amend_tun1 (struct Message & x) { x.data[0] = 0x81; // accessory decoder 0x80 & address 1void amend_tun2 (struct Message & x) { x.data[0] = 0x82; // accessory decoder 0x80 & address 2etc for address 3 and 4If your turnout decoder is not reacting to this code, you may have to send multiple packets. Try adding a repeat line here with a small delay in between.In voi…

    see more »

    Thanks for your feed back. I am delighted to read of your success with the project. The Arduino sketch may be modified to make the sound functions momentary if you wish. The turnout code should work 'as is' for accessory decoders (tested on Decoder Pro SPROG) (or you may want to build my project on this subject where 8 pairs of outputs can be switched). The accessory address in the Command Station sketch is :void amend_tun1 (struct Message & x) { x.data[0] = 0x81; // accessory decoder 0x80 & address 1void amend_tun2 (struct Message & x) { x.data[0] = 0x82; // accessory decoder 0x80 & address 2etc for address 3 and 4If your turnout decoder is not reacting to this code, you may have to send multiple packets. Try adding a repeat line here with a small delay in between.In void read_turnout(); if (changed_t){ // if turnout keys pressed amend_len3(msg[1]); assemble_dcc_msg_tun(); delay(5); assemble_dcc_msg_tun();delay(5); assemble_dcc_msg_tun();Try this for momentary F1 : (not tested by me yet)Replace:In void read_function()if (f1a[locoAdr] != fun1){ f1a[locoAdr] = fun1; changed_f = true; } if (f1a[locoAdr] == 0) {data |= 0; // f1 off } if (f1a[locoAdr] == 1) {data |= 0x01; // f1 on }with:if (f1a[locoAdr] != fun1){f1a[locoAdr] = fun1; changed_f = true;}if (f1a[locoAdr] == 0) {data |= 0x01; // f1 on}if (f1a[locoAdr] == 1) {data |= 0x01; // f1 on}

    View Instructable »
  • BillC35's instructable Model Railway Station Sounds's weekly stats:
    • Model Railway Station Sounds
      55 views
      0 favorites
      0 comments
  • I have updated the link - https://www.ebay.co.uk/itm/232996521728

    View Instructable »
    • Model Railroad DCC Command Station V2
      117 views
      1 favorites
      2 comments
  • Simon, I have repeated the DCC signal to ensure continuous operation when locos have intermittent track connections. When CV11 is set to zero the loco does not respond to time outs. When set, it is usually in terms of seconds, I believe, rather than within 30mS. Thanks for your input.

    View Instructable »