author
9Instructables54,953Views114CommentsFalkland, Scotland

Tell us about yourself!

Achievements

100+ Comments Earned a bronze medal
10K+ Views Earned a bronze medal
  • 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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V23 months ago
    Model Railroad DCC Command Station V2

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

    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.

    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;

    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

    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 !

    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); }

    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    WiFi DCC Command Station for Model Railway

    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.

    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.

    View Instructable »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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

    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();

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

    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 i...

    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

    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); }

    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.

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

    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.

    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)

    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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 »
  • BillC35 commented on BillC35's instructable WiFi DCC Command Station for Model Railway4 months ago
    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, 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.

    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

    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, 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.

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

    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

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

    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.

    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 ?

    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

    View Instructable »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V25 months ago
    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 »
  • BillC35's instructable Arduino - Points/turnout/accessory Control V2's weekly stats: 6 months ago
    • 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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V26 months ago
    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V27 months ago
    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V28 months ago
    Model Railroad DCC Command Station V2

    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 »
  • BillC35's instructable WiFi DCC Command Station for Model Railway's weekly stats: 9 months ago
    • WiFi DCC Command Station for Model Railway
      155 views
      0 favorites
      0 comments
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V29 months ago
    Model Railroad DCC Command Station V2

    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V29 months ago
    Model Railroad DCC Command Station V2

    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V210 months ago
    Model Railroad DCC Command Station V2

    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V211 months ago
    Model Railroad DCC Command Station V2

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

    View Instructable »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V21 year ago
    Model Railroad DCC Command Station V2

    Looking good Tao !

    View Instructable »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V21 year ago
    Model Railroad DCC Command Station V2

    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

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

    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V21 year ago
    Model Railroad DCC Command Station V2

    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 »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V21 year ago
    Model Railroad DCC Command Station V2

    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 v...

    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: 1 year ago
    • Model Railway Station Sounds
      55 views
      0 favorites
      0 comments
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V21 year ago
    Model Railroad DCC Command Station V2

    I have updated the link - https://www.ebay.co.uk/itm/232996521728

    View Instructable »
  • BillC35's instructable Model Railroad DCC Command Station V2's weekly stats: 1 year ago
    • Model Railroad DCC Command Station V2
      117 views
      1 favorites
      2 comments
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V21 year ago
    Model Railroad DCC Command Station V2

    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 »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Hi martin, good work. Why not use the 5v version of mini pro ? The timers are affected at 8Mhz. There is no pre-scaler (/4) for 8 to 2 Mhz as far as I know. Not sure if other adjustments would work at 1 MHz (rescaled 8Mhz / 8), I will look into this and get back to you if I do find a way round this.

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Hi Martin, You are getting closer to working system! Please try the new sketch I have added to this instructable. I have attempted to match the data from your DCC system you have supplied above. Let me know how it performs.

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Are your lights switching on/off ?If so, the F1, F2 etc should work. F1 up to F8 works on Bachmann DCC and JMRI / SPROGIIv3. systems.

    It looks like you should revert back to '3 byte' option in Arduino receiver sketch as there is a '0' in the last part of the DCC instruction.However DD,3,146,145 seems incorrect to me. It should be DD,3,145,146 for light ON and F1 pressed. Or DD,3,129,130 for light OFF and F1 pressed.Please check transmitter sketch to ensure 'message' is constructed correctly. i.eextern void notifyDccMsg( DCC_MSG * Msg ) { if( ( Msg->Data[0] == 0 ) && ( Msg->Data[1] == 0 ) ) return; //reset packlet if( ( Msg->Data[0] == 0b11111111 ) && ( Msg->Data[1] == 0 ) ) return; //idle packet String s1 = String(Msg->Data[0], DEC) + ",";String s2 = String(Msg->Data[1], DEC) + ",";String s3 = String(Msg->Data[2], DEC) + ",";String s4 = String(Msg-&...

    see more »

    It looks like you should revert back to '3 byte' option in Arduino receiver sketch as there is a '0' in the last part of the DCC instruction.However DD,3,146,145 seems incorrect to me. It should be DD,3,145,146 for light ON and F1 pressed. Or DD,3,129,130 for light OFF and F1 pressed.Please check transmitter sketch to ensure 'message' is constructed correctly. i.eextern void notifyDccMsg( DCC_MSG * Msg ) { if( ( Msg->Data[0] == 0 ) && ( Msg->Data[1] == 0 ) ) return; //reset packlet if( ( Msg->Data[0] == 0b11111111 ) && ( Msg->Data[1] == 0 ) ) return; //idle packet String s1 = String(Msg->Data[0], DEC) + ",";String s2 = String(Msg->Data[1], DEC) + ",";String s3 = String(Msg->Data[2], DEC) + ",";String s4 = String(Msg->Data[3], DEC) + ",";String theMessage = ("DD," + s1 + s2 + s3 + s4 + '\0');

    Hi Martin, Thanks for the info on the nano shield. Interesting one I have not seen before here in Scotland. From the connection diagram I see D2 of the Nano is connected to the IRQ of the RF2401. This will conflict with the Arduino connections where D2 is the input from the Command Station on the transmitter side. I think the problem is on the sending side. Although you are assembling the correct data, the RF24 is in conflict with the input signal. The RF24 does not need a connection to the Nano in this application.You may be able to either:1. Disconnect the IRQ pin on the RF24or2. Change the input pin on the transmitter Nano from D2 to D3. Amend the sketch to call up D3 as the Interrupt pin. Serial.begin(115200); // Setup which External Interrupt, the Pin it's associated with, disable...

    see more »

    Hi Martin, Thanks for the info on the nano shield. Interesting one I have not seen before here in Scotland. From the connection diagram I see D2 of the Nano is connected to the IRQ of the RF2401. This will conflict with the Arduino connections where D2 is the input from the Command Station on the transmitter side. I think the problem is on the sending side. Although you are assembling the correct data, the RF24 is in conflict with the input signal. The RF24 does not need a connection to the Nano in this application.You may be able to either:1. Disconnect the IRQ pin on the RF24or2. Change the input pin on the transmitter Nano from D2 to D3. Amend the sketch to call up D3 as the Interrupt pin. Serial.begin(115200); // Setup which External Interrupt, the Pin it's associated with, disable pullup. Dcc.pin(0, 3, 0);// Call the main DCC Init function to enable the DCC Receiver Dcc.init( MAN_ID_DIY, 100, FLAGS_DCC_ACCESSORY_DECODER , 0 ); Serial.println("Ready");Please let me know how you get on with this.

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    The problem seems to be in the receive side. Incoming data is corrupted. Please check the void loop(void) - re-type the text in this void. i.e re-type the != ; if (rc == '\0') ; char rc = inmsg[0]; symbols again from your keyboard in case they are corrupted. While you are at it, re-type the code for the transmit side to ensure all keyboard symbols are correct ( I have come across some issues like that before especially with apostrophes ' ")Double check the wiring on receive side to ensure all pins are connected correctly between RF and Arduino and RF24 radio(9,10); is on D9 and D10 The 5volts should be connected to Vcc only and not Raw as in my diagram.

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Hi Martin, Good to hear of progress on this topic. Have you got a 220uf capacitor connected across Vcc and Gnd on the NRF24L01 ?

    Martin, On the transmit side, what does your print out look like ? Uncomment the //Serial.println(theMessage);If s4 has a value, you have 4 bytes and the receive side code must be edited.struct Message msg[MAXMSG] = { { { 0xFF, 0, 0xFF, 0, 0, 0, 0}, 4}, // idle msg { { locoAdr, 0, 0, 0, 0, 0, 0}, 4} // enter 3 for 3 byte and 4 for 4 byte DCC Command Station}; Hope this helps.

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Hi MartinI think I may have confused you with my last reply. Are you using the 'DCC packet Transmitter' and 'DCC packet receiver' circuits as shown above? If so, the Arduino code in this intractable should work as it is simply taking the DCC commands from your Command Station and transmitting the complete DCC data (including functions). I was using a Bachmann and a Compact (Atlas) DCC command stations which both work fine. Maybe your system uses 4 bytes (plus preamble). I have included this option in the code but I have not tested it. The Arduino code in my new intractable is not relevant to the above circuit - sorry if I misled you. Maybe you could send me a copy of your circuit diagrams to let me understand what you are doing ? billc.c@btinternet.com

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Hi MartinYes, weather permitting, I have run the garden train successfully without the problem of dead spots in the track. Only leaves and twigs spread on the line by foraging birds, need to be swept away first. What a difference the wireless system makes!Some of your questions are answered in my latest intractable, see:https://www.instructables.com/id/Garden-Train-Ardu...On further examination of the speed code required I found an error corrected in the new code within this intractable. A look up table is required to enable the speed steps.

    View Instructable »
  • BillC35's instructable Garden Train - Arduino Wireless NMRA DCC's weekly stats: 2 years ago
    • Garden Train - Arduino Wireless NMRA DCC
      654 views
      13 favorites
      1 comments
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Gary,You should find this cap herehttps://uk.rs-online.com/mobile/p/aluminium-capacitors/4759289/If not any 3.3 uf 25 volt (or greater) capacitor will do.Please note, the sn754410 h-bridge I use is suitable for train motors less than 2 Amps. If you have larger motors > 2Amps, you should use a more powerful H-Bridge.Also, I found the 12v supply to be too low and now use 14.4v batteries (12 x AA re-chargeable NiMh (1.2v each)). These are mounted under the floor of the home made diesel (DMU) or can be placed within a truck or carriage of the train with connecting cables.

    Hi GaryAnother h-bridge that supplies up to 3 Amps is this one on eBay (from Hong Kong). I have used this on my DCC Command Station project.http://www.ebay.co.uk/itm/3A-75W-PWM-DC-Motor-Driv...Happy to help.

    View Instructable »
  • Model Railway DCC Arduino Wireless Commands on a Dead Rail System

    Buy the Arduino pro mini on eBayhttp://www.ebay.co.uk/itm/Arduino-Pro-Mini-Atmega3...You will need a CH340 driver alsohttp://www.ebay.co.uk/itm/CH340-CH340G-USB-TTL-Ser...RS stock numbers for other parts:nrf24l01 885-57485 v reg. 298-85083.3v reg 686-9552sn754410 h-bridge. 527-7040.1uf cap. 108-2700220uf cap. 526-148010k ohm resistor. 150-9284.7k ohm resistor. 151-0001n4001 diode. 628-89313.3uf cap. 475-928922uf cap 449-1012

    View Instructable »
  • BillC35 commented on BillC35's instructable Garden Train - Arduino / Wireless DCC3 years ago
    Garden Train - Arduino / Wireless DCC

    Yes any other wireless comm would work as the DCC part is generated onboard the train. All you need to transmit is the instructions.You would probably have to make your own app on a phone - I do not know how Engine Driver transmits data.

    View Instructable »