"DCC Like" Model Train PPM Control
by Krumps Projects in Circuits > Arduino
1061 Views, 1 Favorites, 0 Comments
"DCC Like" Model Train PPM Control
THIS PROJECT IS A TEST PLATFORM NOT IN PERFECT WORKING CONDITION. IF YOU HAVE IDEAS ON HOW TO FIX IT I WOULD LOVE TO HEAR THEM.
If you like this project there is a similar project using rf that actually is in working condition and you can vote for it in the microcontrollers contest. RF Train Control
I built this project to test my hand at designing circuits, for fun, but also to see if I could design a "DCC Like" system for my trains that is user-friendly so that any inexperienced driver could take the controls and have fun. It works using a Pulse Position Modulation on the tracks. But the power is flipped back and forth on the rails so by having a rectifier in the train you can have stable power. More details on this later. I also have made an Android app and a Transistor circuit to control the track turnouts with the same system.
I used Tinkercad Circuits to make the neat diagrams then draw on the screenshot to add annotations.
Supplies
1 Arduino Mega for control panel (Can use any size depending on how many things you need to operate)
1 Arduino nano per train.
L6203 H-Bridge for control panel( this is just what I had on hand but it is incredibly robust I love it)
L6202 H-Bridge 1 per train (use this because it is smaller)
NAND logic gate IC (This is optional, if you don't use you will just need to use two pins on the Arduino to control the H-Bridge instead of one.)
22nf Capacitor
Wire the H-Bridge L6203
I wired my L6203 separate on an 8 pin connector because I use it for other things and I think it is easier to show the wiring this way. Feel free to wire it all on one PCB board if yours does not have to be removable.
If you want to know more check out the links below I used these in my research.
https://www.st.com/en/motor-drivers/l6203.html
Wire the Control Panel
For the speed control are just standard Pots that I hooked up and tested the analog output and found it to be 1-1302.
Set the direction pins to the internal pull-up resistor and then reverse is when the pin gets pulled low.
I use a logic gate to run the inputs on the L203 because I wanted to only use one pin for the H-Bridge. I plan to use the other pins to run the track turnouts and need 54 for that.
Wire the Train
I Used an L6202 for the train because of the smaller size and less risk of heating up due to less current draw. The pins need to be wired the same as in step 2.
Time for Code
Install the train.ino on the train board
Install the Control Panel on the board that will be controlling the tracks. There are different versions of the same code depending on what your set up is.
If you use a NAND logic gate use the one labeled for that(it is smaller though the standard will work).
Final Notes
Like I said at the start this is not a perfect working system. There are interference issues that I was not able to sort out If you have an idea how to fix this leave a comment. I would love to hear from you.