No video

36 - Signal lights using JMRI with an Arduino and C/MRI

  Рет қаралды 13,972

Newcastle Central (OO Gauge)

Newcastle Central (OO Gauge)

Күн бұрын

I'd originally planned on using DCC control for the signal lights on the layout, but then came across the relative simplicity of C/MRI in combination with JMRI. This allowed me to set the individual signal lights based on how a turnout or route was set in JMRI.
Skip to around 21:39 in the video to jump over initial attempts at DCC control and exploration of C/MRI. At this point in the video, I'm set on using 74HC595 shift registers with an Arduino and C/MRI.
The Arduino code and written explanation of how JMRI and C/MRI are configured can be found here - github.com/fouldsy/arduino-jm...

Пікірлер: 42
@planker
@planker Жыл бұрын
Excellent presentation. I'm not a Train guy but your Arduino practices are in line for a well done video in demonstration. Trains are cool but I don't have time to get sucked into that.
@leilacentral1883
@leilacentral1883 5 жыл бұрын
What a setup! It will look and run great once in. Really enjoyable seeing this develop and also your explanation on what your doing. Keep up the great work, Clint
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks, Clint. As with most of my videos, I'm sharing as I go along so others can hopefully learn a little and not repeat any of the same mistakes. It's not as overly complicated as it maybe comes across if you strip out the first 20 mins of the video or so! Very pleased with the end result though, looking forward to getting the rest of the signals up and running now. Iain
@bobfuller
@bobfuller 5 жыл бұрын
Thanks for the video, Clint, and especially for the link to the Github page. I was struggling to understand what you were doing until I read the Github page and then it suddenly all made sense. Nicely done.
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks, glad the GitHub page makes sense. KZfaq videos are great for showing a visual representation of what's going on, but I still also then like to see things written out or in a diagram to understand what's going on. Hopefully you're able to try it out if you'd like to build something similar. I'm toying with the idea of designing a circuit that I can share to get printed to make it easier to solder up the registers since I'll still need more for the north end of the station, and elsewhere on the layout when I get to them. Iain
@JAMESDEMU-RailwayModeller
@JAMESDEMU-RailwayModeller 5 жыл бұрын
That's all very clever and looks great. Very impressive.
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks! I haven't seen many other folks going this route, but it's actually a pretty good solution for what can really complex if you overthink it (like I did originally!). The end result is pretty cool. Iain
@ModelTrainOutsider
@ModelTrainOutsider 5 жыл бұрын
Very thorough and cool. Thanks for the look into it all. 😎👍
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks! I'm happy with how this turned out. Bit of a winding way to get there, but I learned a lot along the way, and it's actually pretty easy now I understand what's happening to quickly add more signals. Iain
@BALD8BIL
@BALD8BIL 5 жыл бұрын
Thanks for sharing this great video with us and I'm going to share it with TRAINS ACROSS THE WORLD Facebook group
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks, glad you like it. Feel free to share! I'm starting to dig more into JMRI and controls like this, so hopefully I can record more along the same lines soon. Iain
@johnmarshall2660
@johnmarshall2660 3 жыл бұрын
I have just watched your video after a while and I am just setting up a similar section of my layout ( its been on going for 18 months ) with multiple points and signals and IR sensors or maybe track TOTi sensors later also using it with a Mimic Panel ... I got an A4 PCB designd and made at JLCPCB with all the Bi- Colour LEDs and a bank of 14 pushbuttons and works with 1/ A Uno conected to 4 PCF8574 8 channel modules 2 modules are button inputs and 2 modules are outputs (sketch on Github - MERG - DEV) and feed into 2/ a Mega which in turn the sketch selects the points to thrown and signals to operate after a sensor is triggered and I press button for route the Point operation are via Mosfets feeding into a MERG Servo4 controller ...3/ Aspect signals I control via CD4049 Inv Buffers 2 inseries i.e Red on first and Green on second ... 4/ The Mimic Panel switching Bi-Colour Leds is again via CD4049's and a Nano to control ... If you are interested I can send you my schematic ...Regards John
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 3 жыл бұрын
Thanks, John. Sounds like an interesting, and similar project. I have everything working, just have a few more lights to install. I don't have sensors installed yet, but I have the logic figured out. It's trickier to do that JRMI logic than the electronics for the sensors and lights! I'm slowly working through other projects, but getting there. Iain
@paulowen9628
@paulowen9628 4 жыл бұрын
Iain, I really enjoyed this video and am looking to implement JMRI / CMRI / Arduino control on a startup system myself. Please can you give me more info regarding the led driver board. Regards, Paul
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 4 жыл бұрын
Glad you enjoyed it, Paul. More info on the LED driver board is at github.com/fouldsy/arduino-jmri-cmri-signal-control. The link is kinda lost in the video description. In a later video around Christmas I did all the north side signals using the commercial LED driver boards, just had to wire the signals differently. Both work great. All the best. Iain
@LaytonJunction
@LaytonJunction 5 жыл бұрын
very impressive to complicated for me afraid but looks good cheers al 👍😊
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks. There is a lot to it, but now that I understand more what's needed, the complicated part is soldering all the resistors for the shift register. There's no code involved or programming once it's set the first time. It's still not plug + play, but gives a lot of flexibility. Thanks for following along. Iain
@keithfuller5697
@keithfuller5697 4 жыл бұрын
Hi, I’ve watched your CMRI signalling video with great interest; in particular notice that you’re using a Pi running JMRI. As a complete novice I’d appreciate some idea how/if you’re implementing RS485 on the Pi. I’ve paused the video several times trying to spot how the Arduino to Pi connection is wired but can’t figure it out - your help would be much appreciated. Regards, Keith
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 4 жыл бұрын
Thanks for watching, Keith. Yes, I'm using the Auto485 library with the Arduino - github.com/madleech/Auto485. This library simplifies the connection part. It may help to look at github.com/fouldsy/arduino-jmri-cmri-signal-control where I wrote up how I'm connecting this, and then the Arduino code for communication. If I recall correctly, on line 10 where the DE pin is defined, that's using an internal pin on the Arduino for the serial communication. Line 11 then creates the Auto485 connection. I didn't change anything for that, and there's nothing physically wired up for it. Hopefully this helps! Iain
@keithfuller5697
@keithfuller5697 4 жыл бұрын
Newcastle Central (OO Gauge) Hi Iain, Many thanks for your swift response. Would I be correct in thinking that you’re using a bog-standard USB cable between Pi and Arduino? I couldn’t spot any RS485 hardware as such. Regards Keith
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 4 жыл бұрын
Correct - just the regular USB cable for the Arduino (USB A-B, I believe). The Auto485 library handles the basic communication that's required here. I think in more advanced scenarios you may need the hardware adapters, but for basic communication like I'm doing here, it's not needed. It's all done in software. The CMRI standard seems to pre-date pretty much all the JMRI and modern DCC equipment, so a lot of the CMRI docs are overly complicated for what's available now. At the time, it was rather impressive, I'm sure. Iain
@keithfuller5697
@keithfuller5697 4 жыл бұрын
Newcastle Central (OO Gauge) Hi Iain, I was hoping you’d say that - I’ve already got points and sensors sorted with Arduino DCC decoders and was looking for a straightforward expandable solution to signalling - you’re project is exactly what I’m looking for. Regards, Keith
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 4 жыл бұрын
Yes, signaling seemed overly complex with most of the solutions I looked at it. When I discovered CMRI, it seems like a perfect fit. All you want to do is monitor DCC state and shift out light power state. Works great. Good luck with your project! Iain
@chrissharp6845
@chrissharp6845 3 жыл бұрын
I've followed a similar path to you with CMRI and shift registers. I too spent an age trying to figure out the cmri.get_byte(0) part. It really is not clear form the info on the net. And once you have figured it out, it is so simple. Then I returned to it a couple of weeks later and I'd forgotten how it works. Out of interest. Are you using the RS485 for serial comms. I can see the library in your code, but I didn't notice any signs of you using it in the video. Are you connecting your Arduino to the Rpi by USB or RS485? I ask because I'm just about to install a Rpi-JMRI-CMRI-RS485-Arduino setup on my layout and I'm on the look out for people who are doing the same so we can compare notes.
@AndrewMurphy8383
@AndrewMurphy8383 3 жыл бұрын
were did you get the two driver board and can you post some link for those @newcastle central (oogauge)
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 3 жыл бұрын
I got them from Adafruit, though I imagine other vendors are available - TLC5947 24-channel (www.adafruit.com/product/1429) or TLC59711 12-channel PWM LED (www.adafruit.com/product/1455) driver boards, depending on how many LEDs you want to use. Good luck with your projects! Iain
@kitchenhamfarm
@kitchenhamfarm 5 жыл бұрын
BRILLIANT I'm thinking of using train controller with a digikeijs dr5000 controller with have dedicated opto boards which will work with arduino ,to save on 100's decoders for each signal led , that's the plan?
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
I haven't used the Digikeijs systems, but it should work just fine. I know C/MRI is rather old at this point, but it's also really light-weight, and perfect for controlling a large number of signals like this. There's just not a lot of talk about it. I think the prevalence of commercial signal lights that include DCC give the illusion that's the way to go. The approach in this video, other than having to solder your own shift register boards, is so much simpler and cheaper. I have 15 signals just on the south side of the station here, with another 14 required on the north side of the station. That would start to get really expensive without the approach I'm using here! All the best with your build. Iain
@303urch
@303urch 4 жыл бұрын
You can daisy chain the shift registers also
@303urch
@303urch 4 жыл бұрын
Oh, i guess you did :)
@dashepar
@dashepar 3 жыл бұрын
I am looking for stl files for 3D printing for signals. I have a HO scale layout. I can scale them for HO. Any info on files would be appreciated. Thanks, Dave
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 3 жыл бұрын
I uploaded the files to www.thingiverse.com/thing:3635986 I also then had a separate video just on 3D designing, printing, and building the signals and gantry at kzfaq.info/get/bejne/idGdZJRm1eC5fac.html Good luck! Let me know how they work out. Iain
@srduke
@srduke 5 жыл бұрын
For purely automatic signals, have you thought about using a current sensor running through an ADC into a suitable TTL chip?
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Yes, I did some early prototyping back in September/October that used photoresistor sensors, and I have seen setups using current detection for real block detection. On the 1/8th scale railroad I'm a part of, the track signals are controlled like that. I'd still need this kind of set up with C/MRI and JMRI routes to initially set the lights based on the turnouts set for a given route, but I could use something like you suggest to sense when a train enters a section and flip the light from green back to red. All I need some kind of sensor for is to set a signal light back to red when a train passes it. Ideally I'd still want JRMI to know about that sensor state so I can then track the state as a loco would move between two or three signals, for example, to then be able to update the downstream lights as needed. Wouldn't a current sensor require each section of track to be isolated? I have dropper wires for the DCC bus on each section of track, but I didn't use insulated rail joiners other than on the electrofrogs at turnouts. Would I still be able to sent the current when a loco passes the sensor okay? Iain
@srduke
@srduke 5 жыл бұрын
@@NewcastleCentralOOGauge The module that I've developed (with help from a few other sources) would require the block to be isolated on one side only (the red or nearestside in my case) so that it behaved as per the full size track circuiting system. It would only require one isolated track joiner to be placed adjacent to the signal so as to isolate the sections between signals. It can also tell the signal in the rear that it needs to show an amber aspect and can be told by the next signal in advance the same. I've not moved onto four aspect yet but it's only a matter of time. The module (per signal) comprises of a bridge rectifier, a bi-directional optocoupler, a 555 timer, a 74HC00, plus a couple of capacitors and four resistors. If you price those up, I'm sure you'll agree that it's a very cost effective way of running autonomous signals. I'ts also possible that the sensing circuitry (basically without the 74HC00) can be connected to a C/MRI or JMRI system as the 555 is used as an analog to digital converter. when there's a train in the section, the output from the 555 is high, when there's no train the output is low. I've also got a sensor that can send out a filtered analog signal that can be used with an Arduino when connected to an analog pin. It is so sensitive that it can detect a 10K resister placed across the track yet give no false output at any other time, even with DCC. If you would like any more details on this I'd be happy to send them to you. Best regards, Phil
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Thanks for all the detailed information, Phil. Definitely a few different ways to approach this. It would be hard to split all the track segments to isolate one of the rails now, but doable. I know Canal Sidings has done quite a bit with exploring signaling like this and I think went with the IR sensor route. I'll keep looking around at options, wanting to wrap up installing the remainder of the signals on the south of the station first. Iain
@srduke
@srduke 5 жыл бұрын
@@NewcastleCentralOOGauge No problem Iain. If you decide that you'd like any more detail then let me know and I'll send the schematics over to you. Love the videos. All the best, Phil
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Much appreciated, Phil. Seriously. Like I said in the video, I'm by the no means the expert here, just sharing what I've come across and my understandings of how things work. I think input sensors are going to be somewhat similar - I'll try different approaches until I find one that works. At that point, it probably isn't that complicated to get going! Aside, I ordered some IR sensors to compare against photoresistors (which I'm leaning away from), so can explore those options soon. Thanks again. Iain
@avt-CNC
@avt-CNC 11 ай бұрын
Используйте WS2811 IC меньше проводов больше светодиодов!
@markjaques5921
@markjaques5921 5 жыл бұрын
Looks good mate, hope all is well sent you a mail to catch up
@NewcastleCentralOOGauge
@NewcastleCentralOOGauge 5 жыл бұрын
Cheers, Mark. Sent a follow-up; let's get together soon! Iain
Model Railway Automation using JRMI Dispatcher and Simple Signal Logic
40:40
Little Wicket Railway
Рет қаралды 45 М.
Adapting budget signals to work with JMRI, CMRI, Arduinos and shift out registers
41:03
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
No empty
00:35
Mamasoboliha
Рет қаралды 11 МЛН
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 9 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 23 МЛН
Using an Arduino Mega with CMRI For JMRI
31:54
Lawrence Eggering
Рет қаралды 11 М.
iTrain is amazing
13:08
Ron Armes
Рет қаралды 25 М.
Arduino Block Signal for Model Trains
42:40
DIY and Digital Railroad
Рет қаралды 74 М.
JMRI: Layout Editor, Interlocking, Routes, Roster and Throttles
33:13
Trains and Dioramas
Рет қаралды 29 М.
Model Railroading 101 What is JMRI? MR101
44:44
TSG Multimedia
Рет қаралды 116 М.
Control Arduino In JMRI - Easy CMRI Set Up
14:34
Toms Trains and Things
Рет қаралды 9 М.
Using JMRI, sensors, Dispatcher and LogixNG to automate the parking of my trains
53:37
The Clever Way to Count Tanks - Numberphile
16:45
Numberphile
Рет қаралды 813 М.
Adding block detection to a layout using current detectors, Arduinos and JMRI / CMRI
29:04
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН