author
9Instructables65,661Views47CommentsFalkland, ScotlandJoined October 5th, 2015

Tell us about yourself!

Complete Your Profile

Achievements

10K+ Views Earned a bronze medal
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V225 days 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 »
  • Arduino - Adjustable & Smart Battery Charger

    Hi yash, I have added the zip files to the Instructable as requested, hope this works for you.When the library files have been transferred, refresh the Library via Arduino menu: Tools/Manage Libraries. Load them directly into the sketch via the File/Sketch/Upload Library then select the 2 files.

    View Instructable »
  • Arduino - Adjustable & Smart Battery Charger

    These are not the files I have used in the sketch. Please download "Adafruit_MCP4725" and "Adafruit_LiquidCrystal" libraries from these links.https://www.arduinolibraries.info/libraries/adafru...https://www.arduinolibraries.info/libraries/adafru...Hope this fixes the problem and please let me know how you get on.

    View Instructable »
  • Arduino - Adjustable & Smart Battery Charger

    Hi, What is the error code you are getting ?Please ensure you have the required files in the Arduino library folder:"Wire.h""Adafruit_MCP4725.h""Adafruit_LiquidCrystal.h"

    View Instructable »
  • BillC35 commented on BillC35's instructable Arduino - Points/turnout/accessory Control2 months ago
    Arduino - Points/turnout/accessory Control

    Hi Jay, thanks for buying 2 boards. Do you want to have ON/OFF switches ? If so, I can send you an Arduino sketch with the correct coding. If you are controlling solenoid turnouts, then you must use the momentary switching. Either way, I can provide the code for 1 to 8 and another sketch for 9 to 16. I shall email you directly with these files if you wish.

    Hi Bill, I have JMRI running on my Mac with a USB connected Sprog device. This supplies DCC power and instruction packets to the rails. The Arduino based turnout control board is connected across the rails (DCC output) which then decodes the DCC packets and operates each set of turnouts.This is the same setup for use with any other Command Station. The input ('Track DCC' on the PCB) is connected to the DCC rails.I am not sure if I have helped you with this reply. Please try again if I can be of assistance.

    Hi Bill, The pdf download requires you to have a premium membership. You should be able to download the individual files.If you are controlling solenoid turnouts for all outputs then you must use the code for all momentary outputs - this sketch is included in above for T1 - T8. Please let me know if you require a sketch for T9 -T16 for all momentary turnouts also. I could send it directly to you if required.

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

    Looking good Tao !

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

    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

    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

    View Instructable »
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V24 months 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 V24 months 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: 5 months ago
    • Model Railway Station Sounds
      55 views
      0 favorites
      0 comments
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V26 months 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: 9 months ago
    • Model Railroad DCC Command Station V2
      117 views
      1 favorites
      2 comments
  • BillC35 commented on BillC35's instructable Model Railroad DCC Command Station V29 months 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 »
  • Arduino - Adjustable & Smart Battery Charger

    Please re-check wiring and ensure LCD is a HD44780 Backlit 1602Pins 12, 11, 5, 4, 3, 2 of the Arduino Pro Mini (5v version) must be connected to display as shown.

    View Instructable »
  • Arduino - Adjustable & Smart Battery Charger

    These are on ebay uk at:https://www.ebay.co.uk/itm/2x-IRLB8743-MOSFET-N-CH...

    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

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

    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.

    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 »
  • Arduino - Adjustable & Smart Battery Charger

    Would this be a 48v lead acid cell battery? You would need to increase R1 and R4 to 87k, increased C3 voltage to >60v and replace the 5v regulator with one that can take at least 60 volt input. High transient voltage peaks may need to be considered in the design. Not sure if all this would work for you, but maybe worth a go.

    View Instructable »
  • BillC35's instructable Garden Train - Arduino Wireless NMRA DCC's weekly stats: 1 year ago
    • Garden Train - Arduino Wireless NMRA DCC
      654 views
      13 favorites
      1 comments
  • BillC35 commented on BillC35's instructable Arduino - Points/turnout Control1 year ago
    Arduino - Points/turnout Control

    Hi jay,First thing to check is the Arduino serial monitor for the decoded values.You should get burst of code printed on the monitor ending with:tun = turnout numberIf you want to send me an email directly, please use bill.c@btinternet.comYou can send me more detail if required e.g. circuit diagram, code etc

    View Instructable »
  • BillC35 commented on BillC35's instructable Arduino - Points/turnout Control1 year ago
    Arduino - Points/turnout Control

    Hi jayThanks for your interest in this project. You could use the 16 relay boards in this circuit. I think you would need 2 relays per railway point giving 8 points served from one board. If you have the space to use these then fine. Remember to add diodes across all solenoid contacts to protect against induction spikes.Yes, D2 has the DCC signal input from the packet receiver circuit.Good luck and enjoy the project.

    View Instructable »
  • 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 Arduino - Points/turnout Control2 years ago
    Arduino - Points/turnout Control

    Hi Simo, glad you like this Instructable. I used Hornby R8014 points motors (not surface mount) but should operate with same voltage and current. Please check the Vcc2 power supply which must be about 15 volts and capable of supplying peak current of at least 1 amp. Do your point motors operate of the track ok i.e. in free air movement? Please check alignment and freedom of movement of lever to points. You may have to adjust the timing in the Arduino sketch. I have 150 to 250 milliseconds on time delay (250);

    View Instructable »
  • BillC35 commented on BillC35's instructable Garden Train - Arduino / Wireless DCC2 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 »
  • BillC35 commented on BillC35's instructable Garden Train - Arduino / Wireless DCC2 years ago
    Garden Train - Arduino / Wireless DCC

    Please refer to my instructable 'Model Railway DCC Arduino wireless commands on a dead rail system' for details of the nRF24 replacement for the obsolete RF28.

    View Instructable »
  • BillC35's instructable Arduino - adjustable & smart battery charger 's weekly stats: 2 years ago
    • Arduino - adjustable & smart battery charger
      119 views
      10 favorites
      0 comments
  • Model Railway - DCC Command Station using Arduino:

    Yes you can control your layout by having 12v battery power in each train along with Arduino programmed to provide DCC command address bytes. The Arduino is connected to a H bridge to convert DCC signal into +- 12v supply for the installed decoder. The on-board Arduino also has a wireless receiver to accept the command address from the base station which consists of an Arduino and wireless transmitter.

    View Instructable »
  • Model Railway DCC Arduino wireless commands on a dead rail system

    I have upgraded 2 of my garden trains with the wireless DCC system. So yes I do think it was a great idea from you Martin. The old LGB loco needed a more powerful battery. I am currently using a small lead-acid 12v battery from an alarm system. It sits in a modified truck along with the Arduino circuit. This is much easier in these large scale trains of course. I agree, the Li-Po batteries are a bit scary for some. I use the Li-Ion type in my diesel engine which has space under the floor to house them.

    View Instructable »
  • Model Railway DCC wireless commands on a dead rail system

    Hi MartinYou should use the Maniacbug library driver for the nRF24Arduino driver for nRF24L01RF24: Driver for nRF24L01(+) 2.4GHz Wireless TransceiverRF24: Driver for nRF24L01(+) 2.4GHz Wireless Transceiver I shall add this detail to the InstructableTo decrease processing time, the Arduino now only accepts one loco address in line 36 (int locoAdr = 3). The use of preamble + 3 bytes or preamble + 4 bytes (depending on DCC Command station in use) must be entered into line 53 { { locoAdr, 0, 0, 0, 0, 0, 0}, 3} // enter 3 for 3 byte and 4 for 4 byteI have not been able to complete this automatically in the Arduino code as yet.Also, I have removed the printf functions and other radio functions not required and the speed is a lot better. Regards Bill

    View Instructable »
  • Model Railway DCC wireless commands on a dead rail system

    Hi Martin, I do not get this error. Have you got all the library files included for the nRF24.h and nRF24L01.h? There area few entries in the Arduino forum that cover this error code. Have you the latest Arduino IDE 1.6.12 ?The radio will not work if this line is commented out (//)By the way, what Command Station are you using ? Does it supply a 3 byte address or 4 byte ? My code is for 4 byte. I will develop code for 3 byte (or both soon). The nRF24 radio is quite slow and adds a noticeable delay to transmitted commands which might be a problem. Need to look into this further.RegardsBill

    View Instructable »
  • Model Railway DCC wireless commands on a dead rail system

    It should work:- pin 6 Arduino to 2 on mobile decoder. To get the speed packets, your code in the mobile decoder should be similar to mine as Geoffs filters out all non-function packets.I have found variations on the output of different DCC Command stations on both packet contents and voltage levels. e.g. Bachmann EZ operates from a 16 volt supply (dangerously high for some decoders!), whereas my own runs from 12volts. This will make a difference to the resistor chain (10k / 4k7) on the input to the Arduino.Good Luck and thanks again for the ideas.Bill

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

    Hi MartinI have found a way of using Arduino Mini Pro and nRF24 to transmit and receive DCC command station data. The on-board Arduino must run the basic clock sequence and only the packet data needs to be transmitted. I shall create another instructable soon with details.Regards

    View Instructable »
  • Model Railway - DCC Command Station using Arduino:

    I have not included a programming feature on this command station. This must be done elsewhere, for example I use 'Decoder Pro' software on my Mac along with a Sprog II USB programmer.

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

    Hi Martin, With limited space in HO/OO locos it will be difficult to achieve a DCC wireless solution. You will need at least 2 x 1.5v batteries plus step up voltage circuit to supply 12 volts to the H-bridge. It should be possible to transmit the DCC signal by wireless to one of the bridge inputs and reversing the signal via a transistor to the other input to provide a 20+ volt peak to peak output that follows the received data. I will purchase a nRF24 module and check it out. Will let you know how I get on.Thanks for you idea.

    View Instructable »