Jump to content


  • Posts

  • Joined

  • Last visited

Contact Methods

  • Website URL

Profile Information

  • Location
    Mid-Suffolk Light Railway Territory
  • Interests
    Have returned to model railways after sharing my younger brother's train set as a kid! Interests now include control electronics (esp. DCC-ex), programming microcontrollers and more recently 3-D printing.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Railsnail's Achievements



  1. Mine also had one pickup that had been fitted so badly that one of the pickup's 'wipers' had ridden over the wheel flange instead of contacting the back of it! A very quick visual inspection by whoever fitted the sound chip (at Rails) should have spotted this as it was so obvious and it could have been fixed before sending resulting in a happier customer. After some umming and ahing I decided to strip the offending bogie down and fix it myself as everything else on the model was intact. Whistles, lamp brackets etc. I reasoned that knowing my luck, it may come back worse than I'd received it if it went back. Having made my decision, I completely understand yours reddragon. I hope they fix it for you!
  2. Yes, I have used the Pi Zero W on a standalone Zigbee heating controller project of mine and they are great devices at the right price. I see that availability of the W variant has improved following general shortages of silicon worldwide. As far as driving a motor HAT direct from a Pi - I have seen some progress on some code for this. I guess it's early days and will take a while before it matures to the level of the current DCC++ Ex project.
  3. Attach Controller to Underside of Baseboards etc I have received feedback from a friend testing the controller asking if it would be possible to modify the enclosure so that it could be screwed underneath a baseboard or on a vertical surface for that matter. I didn't want to alter the enclosure so I have 3D printed a bracket that attaches to the vents on the underside of the enclosure. (Like those mobile phone holders that attach to the air vents in cars). So this is what it looks like - and with the bracket attached... The bracket along with the original sticky feet allows air to circulate under the unit .
  4. Thanks Nigel for the feedback. I really enjoyed working on this project and learned a lot as it progressed. I take your point regarding going down the USB route. A RaspberryPi (maybe running JMRI) would go well with this. Plus it would give remote access (to the Pi) via WiFi and remote terminal like VNC. I have experimented with just that solution and it works well, however I didn't want to dedicate a RPi to that one task. The buck-converter works well for making a single PSU system. The module barely gets warm, but any heat is catered for by the ventilation slots in the enclosure lid. My earlier system in the fully enclosed larger enclosure never suffered with overheating despite the lack of ventilation.
  5. Bluetooth Interface Option So, having explored a USB and WiFi connected controller, I next considered Bluetooth. Some years ago, I had experimented with Bluetooth modules available in their droves on eBay for an industrial robot application. They were readily available and advertised as HC-05 and HC-06 modules. They looked similar, but the HC-05 could be used as a master or slave device, while the HC-06 was slave only. Both would offer the functionality I was looking for, but I decided to experiment with the HC-05 as it was a very similar price to the HC-06, but offered both master and slave functions. I soon discovered after breadboarding a few of these, that although they were all sold as HC-05's, they often differed in the way they are programmed. These modules require some sort of setup to set their broadcast Bluetooth ID and pairing PIN. Also, their data communications speed requires setting, usually just the once for most applications. This is achieved by putting them into 'AT' programming mode, but more of that later, Setting these in 'AT' mode is where many of the HC-05's varied due to Chinese manufacturers using slightly different firmware. There are many websites that have delved into the various variants of these modules, but the best in my opinion is Martyn Currey's website where he discusses the different variants at http://www.martyncurrey.com/category/bluetooth/ Anyhow, back to the project. Given what I had discovered a few years ago and having caught up on Martyn's discussions on his site, I decided to go with the HC-05. The 'Older' variant as some eBay sellers describe these to be exact. It's worth noting that there is also a cheaper Bluetooth module known as the JDY-31 variant. Do not try these if you are thinking of building one of these controllers! The HC-05 can be powered from +5V DC, so it could be easily hooked up to the Arduino Mega +5V rail with flying leads. The HC-05 data pins however are 3.3V compatible NOT 5V, so the Receive Data (RXD) input of the HC-05 cannot tolerate the Transmit Data (TXD) output from the Mega2560. Some sources on the Internet say this may be ignored, and that they have got away with driving the RXD pin directly from the TXD of the Mega2560. I say good for them, but the proper way to drive the RXD on the HC-05 is to convert the high level output voltage from the Mega2560 to a level that can be tolerated by the HC-05. The simplest solution for this is a simple potential divider comprising two resistors. These can be seen soldered to a small piece of prototype board, then attached to the HC-05 Bluetooth module in the picture. The 4 wires are Power (Red/Blue) and Data signals (Green/Yellow). These are the two flying leads that connect to the Mega2560 module. Programming the HC-05 This now left programming the HC-05 in 'AT' programming mode so that the module had the correct communication Baud rate (115200) and a sensible Bluetooth name. I decided that one way of programming the Bluetooth module was by creating a simple Arduino sketch that would allow the module to be set up. An alternative would have been to connect the module to a cheap USB to UART module , but why bother when I had the Mega2560 and had built the Bluetooth 'level converter' board allowing me to connect the HC-05 directly to one of the Mega's UARTs using the flying leads. After all, the HC-05 setup was after all a one-off process, after which the HC-05 would be left connected to the Mega2560 TX0/RX0 data ports. (The sketch referred to above and the programming process can be found in greater detail on my site at https://railsnail.uk/dcc-ex-bluetooth/ ) So, after setting up the HC-05 Bluetooth parameters the module with its level converter was secured into the enclosure and then tested to ensure that a host (PC/Tablet/Phone) could connect and control the DCC++ CommandStation. Testing was carried out by setting up a Bluetooth COM port on my Bluetooth enable laptop and testing using JMRI software. I also tested using an Android App named DCCpp CAB available from the Google Play Store. Bluetooth range is perfectly adequate given that I want to be in the the same room as my layout, not at the end of my garden! Conclusion In conclusion I am very happy with my suite of DCC++ controllers. I wish I had taken pictures of the original DCC++ bare module and wires 'lash-up' from a few years back now. It would be funny to see the original next to my latest offering in its 3D enclosure. I would strongly recommend anyone with some basic soldering and mechanical skills to have a go at this. A 3D printed enclosure is not essential as earlier pictures of my DCC++ Ex controller in a commercially available box shows. However, I really enjoyed designing my enclosure. I learned a lot about basic CAD and I'm very pleased with the result. The bottom line is that it is possible to build a fully functional standards compliant controller for a lot less than the price of a sound decoder!
  6. Final Assembly... Now that cables had been cut to length, soldered onto the modules. Sockets/LED's wired and sleeved and all documented of course It was now time to put all of the pieces together. (The picture (right) shows my early prototype Bluetooth controller ready to be assembled. The Buck converter had already been adjusted to +7.5V output). An assembled Wifi Version Controller. To complete the unit, I decided to make some short 'pigtail' PROGRAM and TRACK cables that plugged into the 5.5mm x 2.5mm DC sockets and terminated in 'click' type connectors. This would allow the output of the controller to connect to the wiring from the MAIN and PROGRAM tracks. And this was the final system... Next... Bluetooth variant
  7. Wiring, sockets and LED's. I made the decision fairly early on in the project to connect the various modules together with small plugs and sockets. JST-PH 2.0 to be exact. I could have just permanently wired the modules together, but my preference was to be able to build/solder all of the parts with cables and plugs, then connect everything together during final assembly. The cost of plugs/sockets was fairly insignificant in the overall scheme of things. Of course some thought had to given to connecting the wrong plugs to the wrong sockets, but a careful choice of cabling has hopefully minimised this although the final socket combination is not fool proof. Also, two different sizes of DC sockets were used. DC Power in being 5.5mm x 2.1mm and PROG Track/MAIN Track output sockets being 5.5mm x 2.5mm That choice of socket size should prevent connecting the DC PSU to either of the track outputs resulting in magic smoke! The Buck Converter In order to power the logic circuitry from a single 15V DC supply, a Buck converter is used to reduce +15V to around +7.5V to power the Arduino Mega. (The Mega2560 has its own regulators for +5V and 3.3V). The Buck converter is secured to the lid with double sided sticky pads and glue on the 3D printed standoffs. The unit was designed so that there is enough clearance so that the Buck Converter could not short out on the Motor Driver module. The Buck converter's DC output voltage was set to around +7.5V BEFORE connecting up the Arduino Module as I found that the Buck Converters I had purchased all came with the output trimmer potentiometer set to maximum voltage out! The picture shows the Buck Converter mounted on the enclosure lid. The red LED indicates that the unit is powered. The blue component is the Buck voltage output trimmer. Next... final assembly
  8. 3D Printed Enclosure As mentioned, I wanted this project to have a half decent enclosure rather than use an off-the-shelf box. This was when my newly acquired 3D printer came in really useful. I rather optimistically thought that this would be the easiest and quickest stage of the whole project. But I hadn't thought through the CAD part of designing what is just a box with holes and a lid! The actual printing stage is quite easy, albeit slow, with the printer doing all of the work. Anyhow, after much watching of CAD tutorials and even more trial and error, not to mention failed prototypes, I finally arrived at my finished enclosure. It was printed in 3 stages. The main enclosure, the lid and finally a small 'guide' tube that links the lid to the RESET button on the Arduino Motor Shield. This would allow the controller to be reset without having to pull the power by simply inserting a longish thin reset device cocktail stick into the reset hole on the top of the controller This is what the CAD looked like... Next - Wire it all together and provide sockets/LEDs
  9. WiFi - Combined Mega/ESP8266 or discrete Modules? As already mentioned, the choice of the combined Mega2560/ESP8266 controller module seemed like the logical choice for a WiFi version of this project, however, in practice this module has two drawbacks both relating to switch type and their positions. In order to program the Mega and ESP8266 and link their serial data pins, two switches are provided. One slider switch and the other, a dual-in-line package switch with tiny sliders (circled in red in the picture). In use, the DIL slider switches are fiddly and quite fragile. I guess they are supposed to be set a few times during programming, then left alone. They are also located roughly in the centre of the module, meaning that they are impossible to access with the Arduino motor shield attached to the top of it. For those reasons, I decided to proceed with discrete Mega2560 and ESP8266 modules (the ESP-01 to be precise) and to ditch the combined board shown. The decision to proceed with discrete modules had a slight issue in that the ESP-01 module has 3.3V compatible TX/RX data pins whereas the Mega's TX/RX UART pins are 5V compatible. This raised a problem with the 8266's RX Data input requiring some sort of voltage divider requiring further hardware. This could be solved fairly easily though with the use of a 'level converter' addatper (sic) designed for ESP-01 modules (circled red in picture). Power (Red/Blue) and Data (Yellow/Green) 'flying leads were soldered to the adaptor's connecter so that they could be plugged into the Mega's Power/Data connector later To be continued...
  10. Tinkering With DCC++ Ex Having robbed my older DCC hardware for parts I decided to build my first USB version of the DCC++ Ex project. In my opinion, the original DCC++ project had suffered from a lack of documentation. Information could be found, but it sometimes took a little finding. In fairness, the four series YouTube videos referred to above gave a very good start on building a system and the original software worked without any issues (for me), but I always thought the project needed something better in the way of documentation, The new DCC++ Ex project appeared to be the answer to that, so within a short time, with the help of the build guides on their website, I had a new bare-bones system running the new code-base. All seemed well. I could control my DCC locos just as I did with the original code/hardware. This still left the main issue though of making my system look more than a heap of electronic modules and wires, also I wanted to try making a WiFi connected version of this project. So I had two immediate items on my to-do list. The first was easy. Just buy a suitable box to house the electronics. The second; build a WiFi variant, would require additional or different hardware as the Arduino Mega2560 does not support WiFi. It has a USB port for communication. The DCC++ website recommends a variant of the Mega2560 microcontroller with an additional onboard ESP8266 microcontroller that supports WiFi. See https://dcc-ex.com/advanced-setup/supported-microcontrollers/wifi-mega.html This combined Arduino + ESP8266 board would still allow the easy attachment of a motor board (to drive the tracks) and would effectively give WiFi access to the Arduino. The DCC++ Documentation discusses using two power supplies for their system. One for the DCC Power/Control and the other lower voltage power supply for the logic boards. I did not want to go down the route of two power supplies, so decided on using one higher voltage DC supply that could provide power to the tracks (locos) and it would also provide power for the logic boards via, a Buck Converter (basically a DC voltage step down device). Three DC power plug/sockets. One for the DC input (from the power supply) and two outputs for the Program and Main track circuits plus some coloured LEDs produced this... The Arduino Mega2560/ESP8266 module is under the L298 Motor Shield. The LM2596 Buck converter can be seen alongside the motor shield/Mega2560. A USB cable can be seen temporarily attached to the Mega, allowing me to program it from my laptop. Hot glue keeps everything nicely stuck down and in its place! Holes were drilled for 3 sockets and 3 LEDs. One socket for power from a 15V DC/3A power supply, the other two sockets are outputs to the Programming Track and Main Track. LEDs indicate DC power on and Main/Programming track power. To be continued... (WiFi - change hardware)
  11. Background to my DCC++ Project Like a lot of modellers, I have been intrigued for some time by the DCC++ Project started by Greg E. Bermann. He had the idea of creating a DCC Controller based on an Arduino Uno (also Mega) and easily obtainable motor controllers with the aim of providing a cheaper option for modellers with basic electronics skills. Videos explaining the principles of DCC signalling and his Arduino based system are available to view on YouTube providing an excellent tutorial on the fundamentals of DCC and how to achieve DCC control with basic hardware. In my opinion, the four videos are well worth a watch and the first in the series of 4 videos can be found at... So around 2 years BC (Before Covid) I built my first DCC++ prototype just to see what it was capable of and I was impressed with the result! To be fair, this was my first foray into DCC control, so I had nothing to compare this system with. However, considering the DCC++ project was aimed at inexperienced people like myself, I was very happy with what it offered, it was reliable and I could not see any immediate reason to try commercial offerings at a much higher price. My early builds were fragile pieces of equipment, without a proper enclosure and wires hanging off! (Sadly I have no pictures of my early attempts). Luckily nothing ever shorted resulting in magic smoke, but I decided that a more durable solution was required but time passed, and the Mk1 DCC 'frankencontroller' was put away for another day awaiting a block of revisiting time. Enter Covid - resulting in a chance to revisit the world of DCC++ In the meantime, the project had moved on and a new team had taken up the reins from where Greg E. Bermann left off. According to the official DCC++ Website, a core team of developers decided that they would build on Greg's work but the next iteration of the software would involve major re-writes. For those unfamiliar with the new DCC++ Ex project, details can be found at... https://dcc-ex.com/index.html So, after catching up on the changes and liking where this project was heading, I decided to cannibalise my old DCC 'frankencontroller' and repurpose the parts for a Mega2560 based DCC++ Ex To be continued in my next post... A detailed how-to for this project can be found at https://railsnail.uk/dcc-ex-bluetooth/
  12. Has anyone got deep enough pockets to model this event I wonder? (With apologies if this has been posted before)
  13. Mine just turned up too. Royal Mail, Special Delivery, deliver by 1pm. Hope yours arrive soon. I ordered mine on the 28th June if that is of any relevance.
  14. I was unaware of ePLA. Thanks for the information. It will be interesting to see how robust ordinary PLA works out in the longer term. The parts, once printed, appeared to be up to the job. Time will tell I guess, but I would certainly try ePLA if I have a future requirement.
  15. Mine have just arrived from LTM! Haven't opened the boxes yet... Just savouring the anticipation
  • Create New...