Thank you for this series of videos. You have opened my eyes to a multitude of possibilities and I have just redesigned my proposed new layout from going round and around to shuttling back and forth, making a much more realistic railway and saving a heap of space! I'm learning so much in the process too. 😊
Great video, which gave me the confidence to build the sensor hub and start experimenting with IR detection. The thing that caught me out was the PIN OFFSET definition in the sketch: I needed to set this to zero (not 18 as per the default) to get the sensor hub numbers to match the JMRI system numbers. I think this is a change in the Bunza sketch since you recorded the video. When connected to JMRI, it is possible to use IR sensors for block occupancy. The way I did this was to define a "virtual sensor" associated with each block. Then use a "Logix" to set the virtual sensor active when the entry point sensor changes to active, and another to set the virtual sensor inactive when the exit point sensor changes to inactive (i.e. the whole train has passed). I use a fairly high debounce time on inactive, currently 1000ms, to avoid false deactivation at couplings. This means you can get true block occupancy detection without the need for resistor wheelsets. It doesn't protect against wagons being shed, but my objective is to facilitate signal and point interlocking, and to drive the trains myself in accordance with the signals - so any derailments or accidental uncouplings would be my own responsibility. I haven't thought about bi-directional running yet, but I'd imagine a few flags would sort it.
Your videos are absolutely fantastic. Thank you so much for all the effort you put in in making the videos and the notes to support them. I've learned so much. I'd love to see a video about your layout - the reasons behind how you decided to build it that way and the various running options it gives you, etc.
Hi Rob, I just came across this video again, i'm using my own sketch on a Mega to control a complex crossing but after setting 11 IR sensors up in the house, they all triggered ON in the shed that I just built, and when I installed my layout, I couldnt make them work properly so I rebuilt a bank of 6 and a bank of 5 LDR sensors with 6 LM393 which were not quite as sensative and that cured my issue, I could have got the MERG boards but this was quicker ... great videos ... Regards John
Hi Rob! Thank you so much for posting this. It's a really nice "how-to" guide that even people not savvy about digital systems, etc. can use. As you noted, there are several possible sensor types - I'm sure that will be expanded upon at some point. I'm looking at getting back into N scale after a 40+ year hiatus. I know the electrical engineering and computer end of things well, but at this point I haven't so much as a loco or a loop of track on hand, and not a lot of spare cash to go wild with. I hope to get at least a basic MRR setup soon. I have been working for several years with other small single-board modules, including the ESP8266/ESP32, STM32, and Raspberry Pi. I can see why Arduino is attractive for a number of reasons, but my guess is that in the future there will be additional options that are equally inexpensive. One other thing I've noticed is that there is a lot of hardware used in R/C (radio-controlled) model aircraft that can be used, or adapted to model railroad uses. This goes anywhere from small multi-pin connectors, servos, power management modules, and control systems. Unlike some hardware I see being sold as "model-railroad specific" much of the R/C hardware is much less expensive and very widely available, as well as being extremely reliable. It is also, in many cases, physically very small, which might come in handy for some applications. Anyhow, thank you for these excellent videos. I'll look forward to watching more of them.
Hi and thanks for watching! If you're already familiar with ESP32s then I expect this will all be really easy for you. I want to explore what ESP32s can do when using their wireless capabilities combined with MQTT. I think these might be a better option compared with Arduinos and CMRI. I've seen a few people do some amazing things with RC stuff, especially for tiny vehicles on layouts. I expect this would also be particularly useful for garden railways. Do you know of any good resources where I could learn a bit more about the RC side of things?
Thanks for the warning about the sensor shield. Mine has the same issues you found. The Mega was not turning on when coupled with the shield because it shorted over the USB case. Clipped the terminals and isolated with tape and it worked. The issue of pins 35 and 36 I solved by soldering a wire between the +5V pins on the underside. In this way I'm not loosing the two channels for the flying wire jumper.
Sounds like you got the same type of board as me. Glad you got it all sorted. My other shield doesn't have either of these issues, so I guess it was just a bad batch.
@@LittleWicketRailway Thanks for your truly excellent videos. I've watched your whole series on Arduinos, have purchased all the components, and have started working through them one-by-one. I've completed this video and, to my surprise, everything is working. The only problem that I'm having is that on my Sensor Shield the red PWR LED on the lower right corner of the board is often lit -- if I wiggle the USB cable that's plugged into the Mega the red LED will turn on and off in time with my "wiggling". Like others have mentioned, some of the Sensor Shield's pins are hitting the top of the USB port housing, and I have clipped those pins and covered them with electrical tape, but I'm still getting the red LED. Do you think the red LED indicates that I'm getting a short? Do I need to return the Mega, the Sensor Shield, or neither, since the sensor is communicating properly with JMRI? TIA. Dan
Thanks for another excellent video! For those of us on the Stateside of the pond, a RCD (residual current device) is called a GFCI (ground fault circuit interrupter).
Hi again Rob, Arduino MEGA Sensor Shield V2.0 - A problem with the 5V source to the MEGA Analog Pins. I was going through and tested the power connections on the Arduino MEGA Shield boards and although I didn't discover power issue between pins 35 and 36 as you had, I did find something else. The external power on the middle connector on all the digital 3 pin connectors (the 'V' pins) are routed via the 'PWR-SEL' jumper and can be connected to either the Arduino MEGA board's 5V Power or to the MEGA Shield board's external 5V power connector (but obviously not both simultaneously) and this is done by simply changing over the jumper and of the MEGA Shield board. This is what you would expect. However, I noticed the pins that corresponding to the digital 'V' pins on the Analog 3 pin connectors are marked not as 'V' pins but as '+' pins, possibly by some convention I'm not aware of. Anyway, this led me to check on how the '+' pins are powered and it turns out that they are always wired directly to the Arduino MEGA's 5V power via the MEGA Shield board's interconnecting '5V' pin. This is regardless of whether the 'PWR-SEL' jumper is opened or closed. Not a problem you say, not unless you have used the entire Arduino MEGA Sensor Shield V2.0 board for sensor inputs and require the MEGA Sensor Shield to be connected to the external 5V connector to better manage/control the power usage. In which case you are not supplying the 16 analog connections with the same 5V supply. The work-a-round here might be to use the external 5V supply and cut/remove the MEGA Shield board's '5V' interconnecting pin to prevent the connection with the MEGA Board’s 5V power and replace the 'PWR-SEL' jumper (make it closed) in which case all power on the Arduino MEGA Sensor Shield V2.0 board for all pins (Analog and Digital) will only come from the external MEGA Sensor Shield 5V supply.
Hi Warren! This is quite the discovery. I've read a lot about these boards, but didn't know that. I wonder why that is. You should be able to get 400mA off the Ardunio if powered by USB or up to 900mA if using external 5V power supply. As you say, if you need all 16 pins the I think the solution would by to give the Ardunio a separate 5V supply. I wouldn't run the whole board off the Ardunio though, think you'll max out the 900mA pretty quickly. Thanks for sharing! 👍
Hi ROB, Found an uno r3 PLUS> DIY MORE makes an uno with the shield built in. sensors, servos etc plug directly into R#+, no soldering. using standard rc airplane servo cables.
If you're good with a soldering iron, you could bridge the terminals and skip the link wire :). Just as a quick note. Some Arduino boards will not run on 3Volts as they are 5Volt logic. Sometimes 3V is not enough to provide the High signal and it will just look like it is floating. Really enjoyed watching this. I am just getting into railways, but I do have a background in electronics and micro-controllers. I was wondering if there would be a cheap way to do some of this stuff. I looked at some Digitrack stuff and it was really expensive to do this same function.
Thanks for the tip, althought I'm pretty dreadful at soldering. That's the same reason I started doing this, it's so much cheaper than buying off the shelf products and I'd rather spend my money on models.
Hi Rob, Thanks for the info, I will give it a try but I have noticed that the CMRI is considerably slower than running a script. In the mean time I was able to actually get the two MEGA boards running but I noticed that in Geoff's code it clearly shows a commented line near the top: "# 1 byte: bit 7 Sensor ON/OFF bit 6-0 sensor # 1-127" Although the code seems happy when loaded onto the second MEGA board it will not recognise any sensor past the 127th sensor port/pin (pin A4 to A15 are not available in the second MEGA board) and if you watch the 'Script Output' screen it tries to go back to start the count at 'AR0 Not Available' and never gets any higher than 127. On closer examination the limitation seems to be highlighted by the comment in the same line above in: "bit 6-0" as this limits the total count (wouldn't you know it) to 127 sensors as per the comment. It would appear that regardless of previous information, you can put in 69 sensors per MEGA board but the actual code prevents this and limits the number to 127 in total, regardless of how many MEGA boards you add. I'll have another play and see if I can't get around this before going to CRMI. Additionally when I activated the second script for the second MEGA board, while viewing the 'Thread Window' it showed the second 'SerialSensorMux ? script' would briefly run and show up and then quickly disappear. No sensors on the second board would work. Running the script a second time would create a stable script in the 'Thread Window' and the second lot of sensors (from 72 up to the 127th one) worked correctly. If anyone is interested I will get back to you with a comment if I can get passed it. Hope this is of some help. Regards Warren
Worked first time only problem I am having after I shut it all down and restart it the sensor table is empty? No idea what has happened. The saved file is in the jurisdiction folder. Any ideas what I have missed have deleted the file and redone each step setting up the sensors and the run script and it will work but again once I close it down on startup no table eateries?
Think after a little messing around I got it sorted looks like I need to learn a little bit more of jmri software now have 2 sensors working once I am happy on with part 2 of this great series.
The way that JMRI stores tables/configurations is a bit odd. Every other programme has "Save" or "Save As", not JMRI 🙄 Just remember to save various versions along the way as you get things working because sometimes you can do something that causes the file to become "corrupt", usually when messing about with signal logic. The file isn't really corrupt, you can go into it and fix it manually, but it's easier to have a saved version that you can go back to.
@@LittleWicketRailway yeah once I got my head around jmri quirks all is going well. Hope the new year goes well for you and look forward to any new tech videos you put out.
Hi Rob I have been very successful in following your video in getting the MEGA and its associated sensor shield working with all the IR sensors - Thank you very much for that. I have since been trying to get two MEGA boards with sensors shields recognised by JMRI and I'm not having much success. From what I can determine, JMRI seems to see one mega and not the second one. I think it is also linked to the fact that I am unable to provide appropriate address in the sensor table for each IR Sensor on the second board that JMRI will allow. As the second MEGA board is associated with another/different Com port address I'm not sure if there is a way around this. I was able to load the two MEGAs and modify the software to allow them to have different Com ports and have JMRI identify that the two ports existed and when used separately on theie different ports they worked Ok. There seems to be some hints in the things I have read that would indicate what I'm trying to do is possible. I was wondering if there was a way of doing so and if could you shed some light on the process if it is not too difficult. Many Thanks Warren
Hi Warren, I think setting this up as a CMRI node might solve your problem. See this video. It removes the need for a script, you can name your sensors whatever you like and it lets you add outputs ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html It uses the same kit, I just think it's a better way of doing it. Sadly I only learned about it after making this video. Let me know how you get on.
@@LittleWicketRailway Hi Rob, Thanks for the info, I will give it a try but I have noticed that the CMRI is considerably slower than running a script. In the mean time I was able to actually get the two MEGA boards running but I noticed that in Geoff's code it clearly shows a commented line near the top: "# 1 byte: bit 7 Sensor ON/OFF bit 6-0 sensor # 1-127" Although the code seems happy when loaded onto the second MEGA board it will not recognise any sensor past the 127th sensor port/pin (pin A4 to A15 are not available in the second MEGA board) and if you watch the 'Script Output' screen it tries to go back to start the count at 'AR0 Not Available' and never gets any higher than 127. On closer examination the limitation seems to be highlighted by the comment in the same line above in: "bit 6-0" as this limits the total count (wouldn't you know it) to 127 sensors as per the comment. It would appear that regardless of previous information, you can put in 69 sensors per MEGA board but the actual code prevents this and limits the number to 127 in total, regardless of how many MEGA boards you add. I'll have another play and see if I can't get around this before going to CRMI. Additionally when I activated the second script for the second MEGA board, while viewing the 'Thread Window' it showed the second 'SerialSensorMux ? script' would briefly run and show up and then quickly disappear. No sensors on the second board would work. Running the script a second time would create a stable script in the 'Thread Window' and the second lot of sensors (from 72 up to the 127th one) worked correctly. If anyone is interested I will get back to you with a comment if I can get passed it. Hope this is of some help. Regards Warren
Hi Rob Enjoying your videos on DCC++, Servos and sensors. Can you explain (or do another video?) on how to combine all these Unos and Megas That you use, in JMRI. So that you can operate trains and points, and detect sensor points at the same time. Thanks
Hi Roger, I'm currently working on something that shows DCC++, the sensor hub and the servo controller all working together with JMRI to do basic semi-automated running using JMRI dispatcher and basic fully automated running using a script. I'm using three separate Arduinos all with their own USB connections for this. It won't be the next video though, I needed a break from the tech vids and get away from the screen to play with some trains. A few people have asked if it's possible to combined the sensor hub and the servo controller to save on Arduinos and USB ports. The short answer is that I'm not sure. I think it probably is if the board has enough memory to hold the combined sketchs, but I'm not really an Ardunio expert, so I'd need to do a bit of trial and error to find out. I suspect you could also add other functionality to these boards such as controlling lighting, etc. If you've got the USB ports then there are pros to keeping them systems separate though. If one system stops working then you know exactly which Arduino is likely to have the problem and you can locate them in different areas around the layout which is sometimes convenient.
Hi Rob, I have just been through Pt 1 of Model Railway Sensors, Detection and 3 ASPECT SIGNALS I am still trying to learn about Arduinos and sensors and the amount of outputs that you can have. I am wondering of the amount of WIREs involved that may be needed, I wondering if there is anything around for WIRELESS on a larger size layout, perhaps one MAIN BUSS for power supply all around the layout. I have seen with the SIGNALS, most case there is CABINET away from the TRACKS that have THINGS inside, I wonder with this could work ARDUINOS with WIRELESS, I am not keen on JMRI but have been there with Macros. what I saw here might be the way to go
I have discovered that the sensors used in this Video give inconsistent values when activated and respond to repeated analog reads from adrumio sketch reads Values vary from 0 to 1023 on repeated analog reads
I was having trouble to get sensors to work using internal table, found problem. Your video says enter AR2 into sensor table, this does not work, you have to enter AR:2. Thanks again for your great videos.
Hi Alistair, glad you got it working, sorry about the missing colon. Where did you download the script from? This colon symbol has caused problems in the past depending on which version of the script you're using. If you had problems then other people might too. I can't change the video, but I might be able to change the version of the script. It also highlights the issues with using the script method. You can use exactly the same hardware as a CMRI node which I think is a better way of doing thigns. The advantages of this are that you can change the names of the sensors to anything you want (no more ARxx), you don't have to run any scripts and you can turn some of those inputs into outputs if you wanted to. Check out this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html
Don't be scared! Once you get stuck in it'll all become clear. Keep an eye out for a video coming out either today or tomorrow which shows you how you can use the same kit to do the same thing (and more), but there's no need to run the script (I assume this is the scary bit)!
Hi Rob, Thanks for all the work you've put into this series. I seem to have several issues: 1.Ater building the Sensor Table and saving it, when i restart PanelPro the table is empty. I am using PanelPro 5.2+R760... After rebuilding i run the Pythpn script Sensor_Scan and activste the IR sensor. The Sensor Table never shows the sendor going active. I jope you can help. Mike
Hi how are things. I've been following your channel for a while and it's excellent. I started building the sensor hub and it works fine. My problem is when I relate it to JMRI that it does not recognize the activation of infrared sensors. I think there is a problem with the scripts. It is possible that there has been a modification of the same and now it does not work as you explain in the video? Thank you very much and sorry if the translation from Spanish is not exact
Hi and thanks! Someone else has told me about this issue too, I think the script has changed. Please see this video (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html). It's the same equipment, but it's a better way of doing things. No need for a script, you can name the sensors however you want and it's possible to include outputs as well as inputs.
Hi Rob. I am newish to modelling and COMPLETELY new to JMRI, CMRI and Arduino. I've been watching your videos and have decided this is the way I want to go to control my layout. I have "built" the DCC++ controller and am now looking at controlling points, signals and lighting. My signals are currently controlled by a "Megapoints" controller and I would like to keep this as I like the "bounce". Could I use a MOSFET connected to the Arduino to act as the switch connected to the Megapoints controller? If so, how would I wire this up? Lastly (for now :-) ), would it be possible to modify the turnout and sensor sketch to adjust the speed of the servo, to get it to act more like a "Tortoise" point motor? Really enjoying your highly instructional videos!
Hi ROB I am using it on Arduino uno and it is not working and i did every thing you said here, what could be the issue tested ir sensors they work fine but can't scan for sensors i used a shield as well nothing happen
Hi Lawrence. So when the sensors are plugged into the shield they have power and you can see the lights on the sensors go on and off when it detects something? Someone else contacted me recently to say that something may have changed in the script. It might be worth trying CMRI as the connection instead. See this video - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WsfczIPbhsU.html Personally I think that using CMRI rather than the JMRI script is better because: 1) you don't have to run a script every time 2) you can name your sensors whatever you want 3) you can also use CMRI to easily add outputs
Hi Rob. Would this run properly if I am using an Arduino and JMRI to run trains. I am new to model railways but have managed to get trains running thanks to your previous videos. Many thanks on saving me quite a chunk of money. Regards, Simon
I've been following this video, but the link to geoff Bunza is not working. It sends you to a forum, but the zip file you have to down load is not comming up just an error web page. is there another way to get the arduino ide files, and sensor scan files.
Hi Alastair, thanks for pointing that out. I've uploaded the files to my Github page, but it might be worth checking out the CMRI videos. See general message below: A few people have pointed out that the link to the files (script and sketch) on Geoff Bunza's website no longer works. I have uploaded these files to my GitHub area (github.com/LittleWicketRailway/Geoff-Bunza-JMRI-Sensor-Scan), but all credit should still go to Geoff Bunza for developing this system. This is a simple way of adding sensor to a layout, but I would encourage anyone interested in this to explore the CMRI video series which uses the same hardware, but allows use of different sensor names, doesn't require a script to be run in JMRI and can be adapted to change inputs to outputs. CMRI Part 1 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html CMRI Part 2 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CUWFqFmO1Ng.html CMRI Part 3 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WsfczIPbhsU.html
Yes, any digital sensor/input will work, some of my recent videos on mimic panels and slow motion servos use a push to make switch as the input. You might also find this video useful ((ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html), I think it's better way of doing the sensor hub. No need for scripts, you can name sensors however you like and you can easily add outputs.
I've never used an official "Arduino" product, everything I use is a chinese "clone" version. I believe that Arduino technology is open source, so the chinese produced versions are basically the same thing under a different brand name. I've not had an issue with timing and sensors.
Hi Philip. There are a few things that might be going wrong. Please take a look at this video ( ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html ). It uses the same hardware, but doing it this way means that sensor names can be change (not limited to "AR:X"), there's no script to run and you can easily change the inputs to outputs.
Hi Rob, I was wondering, I already have an arduino uno DCC++ base station connected to JMRI controlling my trains, how can I have both the sensor hub and the base station connected to JMRI at the same time?
Dated Jan 2023: Hs anyone successfully got mega sensor board running recently? Like others I found the hard way that the links to RMH don't work and I can't seem to find the current versions of the Arduino files on that site or Rob's git hub page. I'm using a Mega 2650 and a 1.5 sensor shield if that makes any difference. The IR sensor appears to be working ok as the left hand LED blinks when I move my hand near. If I build the sensor table (I've tried both AR2 and AR:2) JMRI doesn't detect the motion of the sensor. Any help gratefully received. Ta
Hi Devon. I use two and keep them separate, however, I've heard that the newer version of DCC++ ( dcc-ex.com/ ) might allow some sensors to be connected directly to the command station. Might be worth checking out if you want it all on one Arduino.
Thanks for the video. I have done the instructions step by step but I can't get it to work. The COM I have modified for my USB port. The sofw. of the arduino is loaded correctly. How can I check the possible problem? Thanks a lot
Hi Lia, A couple of things to check/try: - does your sensor light up when it's activated? Does it receive power? - have you named your sensors exactly the same as in the video? It's the script in JMRI that causes most problems for people with this project. You might want to watch this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html It combines the sensor project and the servo project. You will already have the equipment you need. The big benefits are that you don't need to use the script in JMRI because it uses the CMRI connection. Also, you can name the sensors whatever you want. Let me know how you get on.
This may sound very silly but I only have 3 usb ports on my laptop. I need one for my Arduino DCC++ base station, one for this new sensor board and I use one for my mouse. Am I likely to need more for other boards as I progress and if so how do I do this? Presumably each Arduino must always be connected to the same usb port and so I cannot use an adaptor to connect two boards into one usb. Your series is very easy to follow - I am most grateful. Regards Martin Wilkins
Hi Martin, Thanks for watching! I too am running out of USB ports. You have two options: 1) Combine your Ardunio code and get more functionality out of each board and therefore use up fewer connections. I think I read a blog where someone managed to combine everything they needed for a layout onto a single board. I don't do this because a) I'm not that great at coding so I'd probably mess it up and b) keeping systems separate means it's easy to investigate problems and position boards in the best location. 2) I think it's possible to use a powered USB hub to add more USB connections and (this may depend on your operating system) you should be able to swap connections around and the computer would keep track of which COM port has been allocated. My desktop doesn't seem to care which USB connection I use, it still gives each board the same COM port which is pretty clever. You're the second person to ask me this, so I've just now ordered a powered USB hub with 4 extra ports and I will try this for myself next week. I plan on controlling the layout from a tablet in future and it only has a single USB port. My plan is to have the powered USB hub permanently attached to the layout so that I have a single connection for the tablet. Fingers crossed it works. I will keep you updated.
@@martinwilkins9055 I've just set up a powered USB hub with 4 additional connections and it all works! I've got the DCC++ base station, the sensor hub and the servo controller (3 Arduinos) all working with JMRI. My computer assigned the boards the same COM ports that it did when they were directly connected to it which is pretty clever. Hope that helps. I'm using this - www.amazon.co.uk/gp/product/B07KFDFT4D/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1 However, the plan to control the layout from the tablet isn't going to work as I first planned because I can't run JMRI directly off the tablet (as far as I know), however, I've just bought a Raspberry Pi (bit late to the party of this one), but I understand that I can setup JMRI on here and then use the tablet to access the panel and controls via the wifi network. That will achieve the aim of freeing up my laptop which seems to spend most of it's life as an expensive model railway controller.
Hi Martin, I've managed to combine some functionality onto a single board which might help to free up some of your USB slots (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html)
Hi Rob, So Love being able to connect multiple sensors for JMRI Detection. Is there a way to use this same set up to also control block signals on the layout itself? Ive seen other videos that use a red yellow green signal for blocks but each block had its own Arduino. ( can i combine the JMRI detection with Block Signaling using a sensor hub)
Hi Justin, check out the last couple of videos I've done on Arduinos, CMRI and JMRI. In part 2 you'll see how easy it is to put in outputs. If you've only got a few signals then you might want to use output pins. If you've got loads of signals with loads of lights then you'll probably want to look into either: - using PCA9685 boards (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rJhZK-XgEec.html) which can support 16 LEDs each and with realistic fade OR - addressable LEDs such as neopixels. I've got some of these and I need to made a video on them, but I haven't got round to it yet. Both of the above options only require a single Arduino whereas using output pins would probably need a few depending on how many lights you need to control.
Hello Rob, back again with another question, I finally received the sensor shield for the mega in the mail today, and when I went to connect them some input pin sockets on the USB port side weren’t there. But in the opposite side with the outlet connection there was 3 pins too many? Was this the case for you? And if not 1 does it matter as the pins missing/not connected are only power pins. Or 2 what specific mega and sensor shield do I need if one or both of these aren’t the correct ones
“Arduino Mega 2560 Sensor Expansion Shield V2.0 Adapter Board Module R3 - CANADA” was the title for the sensor shield And “Arduino Mega 2560 R3 Clone ATMEGA2560-16AU, CH340 - Fast Canada Shipping” was the title for the mega
Having trouble locating in the USA Amazon the ILS - MEGA Sensor Shield V2.0 Expansion Board For Arduino ATMEGA 2560 R3 😔 What's the equivalent and will the same Arduino code work? Great Video... Please Advise.
Hi, are you able to have a search on Ebay? Something like the following is the cheapest I could see? rover.ebay.com/rover/1/711-53200-19255-0/1?mpre=https%3A%2F%2Fwww.ebay.com%2Fitm%2FSensor-Shield-V1-0-V2-0-MEGA-2560-Expansion-Development-Board-For-Arduino%2F253068189055%3Fhash%3Ditem3aec0a1d7f%3Ag%3A-SkAAOSwWhRZe~Aw&campid=5338697448&toolid=10001&customid=US Sensor Shield Having a general seach for the mega sensor shield then it looks like newer versions of the boards are available for slightly more money, so it might be worth trying one of these to avoid some of the issues seen with the earlier boards that I've mentioned in the video. Otherwise this from Amazon looks like it might be the same? www.amazon.com/KEYESTUDIO-MEGA-Sensor-Shield-Arduino/dp/B0169YXYEY/ref=sr_1_2_sspa?crid=2ITAIQDUQ0YWU&dchild=1&keywords=arduino+mega+sensor+shield&qid=1605187974&sprefix=arduino+mega+sensor+sh%2Caps%2C256&sr=8-2-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyU0VEMVhKR09ETk9ZJmVuY3J5cHRlZElkPUEwODUzNTc1MkNGUlkyQUEwTkdROSZlbmNyeXB0ZWRBZElkPUEwOTUzNDQxWTNTNFdSNVc5UjJIJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ== Disclaimer - Always check the seller rating and shipping cost before ordering.
i have an issue with building the sensor hub i add the 67 internal sensors run the sensor scan save the panel quit the panelpro restart panelpro now the sensors are gone
Hi Jerry, you need to save your config and panels to a file. JMRI doesn't automatically reload your file when it restarts. You can reload it manually from the Panels menu. You can tell JMRI to load a particular file by going to Preferences -> start up -> add -> open file
Hi Rob, great set of videos. However, I have a problem. Does anyone else have issues with running JRMI with windows 10. I have managed to connect the Mega with the Sensor shield and got the IR sensor to work so the Arduino side is OK. But I cannot get JMRI to work and show the sensor operating in the Sensor table. Have I missed something?
Hi Martin, if your sensor is reacting and you were able to upload the script then I think you're right and the hardware side is ok. Getting the script the run in JMRI seems to cause a few people issues, it's very fragile. Take a look at this video that I did recently ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html it's the same kit, but using CMRI removes the need for the script and might solve your problem. Doing it this way also means that you can gives the sensors whatever name you want PLUS you can run servos (should you want to) off the same board. PLUS PLUS, in the next video (under construction) I'll show you how to change some of those inputs to outputs from which we can operate relays to turn on lights, etc.
@@LittleWicketRailway Rob thanks for your help and the video on sensors and servos. I have sorted all the issues I had, mainly around library location and defaults. My sensor and servo system is up and running with CMRI / JMRI. Cheers
Hi Rob. Followed carefully but it doesn't work for me. I am using a MacBook pro and I dutifully changed the script from "COM5" to "/dev/cu.usbmodem14201" as reported by the Arduino software but the sensor was not detected. Do you have any advice? Can I track this down somehow? Thanks Graham
Hi Graham, sorry this isn't working for you. I'm afraid I've not experience using this with Macs. I've replied to your other comment though about an alternative solution that I think is better, but uses the same hardware.
I have a question about nanos distributed in each block and they control signal lights And analog sensors indicating block occupancy. Now can I feed a digital output from a nano to a digital input on a 2560 to have jmri operate sensor indicators on on the layout screen
Hi Jerry, you don't need to feed the output from the nano to the input on the mega and then into JMRI. Using CMRI you can connect the nano directly to JMRI. I hope to have the 3rd part of this series ready soon which will show you how to do that ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CUWFqFmO1Ng.html
Hello Rob, I know its been a while since you introduced this video, but I can not download the arduino code from MRH anymore, link is broken or something. Is it possible for you to share/send me the Arduino code.
I enjoyed the video and now am trying to build a sensor hub but cannot find the JMRI script/sketch I need from either Geoff Bunza's blog or your github. Im not very computer savvy. What do not suggest.
@@LittleWicketRailway I cannot get sensors to work through JMRI using the video link you sent. Not once. I have spent hours on this to no avail. I did manage to get one servo to work via Arduino, CMRI, JMRI but subsequenly could not figure out how to get a few more servos working from my computer . Furthermore, these efforts caused the single servo connection to quit. The other videos combining servos amd sensors did not help either. This all appeals to me but is simply unattainable. I'm to the point where I am give up, sending Arduino, shileds etc. back to Amazon and go old school. I have no idea what I'm doing wrong. Could be JMRI which is extremely difficult to understand and use, could be bad sensors, bad arduino, bad sketches, etc. There is no diagnostic tool available for me to pin point my problem(s). I guess the problem is me. Sorry I am complaining to you but thought I would let you know.
I don't think it will. The way this is set up is to read a digital signal. Do you need an analogue reading to be passed back to JMRI? You would have to change the sketch. Check out my videos on using Ardunio, CMRI and JMRI, you might also find them useful. They give you a bit more flexibility with what you can do.
@@LittleWicketRailway A bit of info for you The latest nano v3 is using a new serial chip ch340 and the driver is not loaded in Microsoft Windows v10 therefore it will not assign a serial port Check youtube video by MK me lab or sparkfun tutorial
@@jerrydowell5962 thanks for the heads up. I think by using a CMRI bus (probably not the correct terminology) only the RS485 converter gets assigned a COM port and after that the arduinos should be able to connect to the bus as CMRI nodes. They don't need individual COM addresses in windows so this might not be an issues. I got a very basis CMRI bus working on the weekend, but only with a Mega connected. Aim to have a Nano, an Uno and Mega all connected as nodes for part 3 of the CMRI series.
Yikes...dead link to the Bunza files...of have I made a blunder somewhere? It's Dec of 2021, and the link in the MRH article to the Python scripts is a dead end...comes up 404 error...any help would be MOST welcome.
Oh dear 😳 I'll check the links tomorrow at the weekend. Until then check out my series on CMRI. Same kit, bu better. No script to run, you can name sensors whatever you want and you can change inputs to outputs.
Hi, thanks for pointing that out. I've updated the description to say the following: A few people have pointed out that the link to the files (script and sketch) on Geoff Bunza's website no longer works. I have uploaded these files to my GitHub area (github.com/LittleWicketRailway/Geoff-Bunza-JMRI-Sensor-Scan), but all credit should still go to Geoff Bunza for developing this system. This is a simple way of adding sensor to a layout, but I would encourage anyone interested in this to explore the CMRI video series which uses the same hardware, but allows use of different sensor names, doesn't require a script to be run in JMRI and can be adapted to change inputs to outputs. CMRI Part 1 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html CMRI Part 2 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CUWFqFmO1Ng.html CMRI Part 3 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WsfczIPbhsU.html
Rob, I think that I am slowly going mad. I'm trying to set up IR sensors and following your video - Sensors & Detection Part 1 - everything appears to be going OK but I keep losing the Sensor Table. No matter how many times I set it up it just disappears! I have a few questions that may help me (and you) to understand my problem/ 1. I set up the Sensor table and Store it as you instruct but a. where should it be stored and should it be called Sensors.xml ? b. you then say change the default to inactive - i store the file again after doing that. Is that correct? 2. I seem to have two possible locations for all the files /JMRI/My_JMRI_Railroad.jmri /Arduino/Libraries/DCCpp_Uno Which files should be in which folder? Thanks in anticipation of you saving my sanity!! Regards Martin Wilkins
Hi Martin, like you, I have at times been to the edge of madness with this stuff. I'll try to help below: *JMRI Files* The way that JMRI stores its "configuration and panels" isn't very straightforward. When you click on store "configuration and panels" you can choose any folder you like, just take note of it. I think JMRI ususally defaults to /JMRI/My_JMRI_Railroad.jmri The key thing is that JMRI won't automatically reload that file when you open it again. In panel pro you need to manually go to the panels menu then load panels. Once you've done this then your sensor table should appear again. Then you can keep making changes and storing everything again. If you want it to reload a particular file every time then you can set this up in the Edit menu under preferences. I highly recommend keeping copies of panels that work the way you want them to because as you progress with things like signal logic it can be very easy to "corrupt" the XML files. They're not really corrupt, it just means that there's something in there that JMRI doesn't like (usually signal logic for rme). You can actually open this XML files in notepad or Notepad++ (free program for better formatting) and see how all the tables are stored in sections as you scroll down. It's quite a logic structure and if you're careful you can edit it in notepad. *Python Scripts* Regarding the sensorscan.py file. You can also keep this anywhere on your computer, just just need to know where to look for it when you come to run your script. *Arduino Sketch Files* Regarding the Ardunio sketch files, once you've got the sketch uploaded to your Arduino then you shouldn't need them again and in theory you could delete them. The board doesn't go back and access these when it's running, everything the Arduino needs was transferred when you hit upload.
@@LittleWicketRailway I have followed your videos and made a DCC base station on an Uno and the sensor unit on the Mega. To do the automation I now have to run both at once so have ordered a USB hub. Incidentally, I stumbled on the PanelPro Edit|Preferences|Start Up feature which allows the sensor table to open, load my panel and run the sensor_scan.py script (or any other set of items to be executed) automatically.
This works fine in loading the sensor table, but i can't for the life of me get the sensor table to register an active state ieven though the sensor is indicationg on the led it is picking up a passing item .@@gadge3902
Hi Rob, Thank you for the great videos. I had tried to order the Mega and the Sensor Shield on Amazon and they are both showing as Out of Stock and Unavailable. I have searched on Google and found plenty of non branded alternatives, however, I am not sure of the reliability and compatibility of other boards. Putting this together is complex enough without the uncertainty of if the boards are identical. Please can you suggest either alternative suppliers or alternative boards. Thank you
@@LittleWicketRailway Thank you. I am in the UK, however, I have just checked again and the Mega has come up as available and I have placed the order, but the ILS - MEGA Sensor Shield V2.0 Expansion Board it is still showing unavailable. Thanks again
@@wrrail4428 have a look at ebay.us/odpevW Ebay have a few sellers offering the board so please take a look at the options options. I've not order from this seller before, but the feedback looks to be ok. Quality of the boards can be a bit hit n miss with Ebay, most are ok, but I had one with dodgy soldering and bent pins.
@@LittleWicketRailway Thank you. I have placed the orders, it will be a few weeks before I have time to work on this, I will let you know how it goes. Thanks again
Hi Rob Like your videos have made DCC++ all working, made servo motor control all working Know trying to build sensor hub not working followed your instructions but not changing in sensor table is there a way to see if the script is running ?
Hi Roy, Sorry for the slow reply. Glad to hear that your DCC++ system and the servos are all working! 👍 I'm not sure if there's a way to see if the sensor scan script is running and what signals are going between JMRI and the board. I'll do some digging either tonight or tomorrow after I've published the next video and let you know what I discover. I assume you can see that the sensors are functioning properly and detecting objects from the LEDs on them? Have you tried a few different pin connections on the board to check it's not a duff set of pins?
I have tried different pins still the same Sensor leds turn on and off ok With script loaded no leds flash on Mega after running close script orange led flashes when activating sensor Still nothing on JMRI
Apologies, I've still not had a chance to check this for you, but I did have a thought. If the sensors are responding and the board is reacting then it sounds like the hardware is probably fine. Have you definitely got the correct COM port set in the script? This is specific to the board you're using and potentially could change if used on a different computer. This line in the code: # create one of these; provide the name of the serial port a = SerialSensorMux("COM6")
Hello. The connection is performed as a direct pushbutton High(5+) and Low (Gnd). I use the Roco Z21 control unit, the CMRI connection is compatible XpressNet?, because I already have a servo connected. Thanks for the help. Best Regards Pablo
Hi Pablo! CMRI and XpressNet are different I think, but both can be connected to JMRI as separate connections. Afraid I don't know much about XpressNet. I did a bit of research very quickly and it looks like this person has done a project on connection an Arduino to XpressNet which might be helpful: github.com/nzin/xpressnet_arduino
Thank you, for the information, I study it. Excuse another query, if I have another connection for example CMRI and XpressNet, in the layouts can I activate for example the servos by XpressNet and the sensors by CMRI? Thank you very much for your time and help. Best regards, Pablo.
Hi, I had problem with the computer mouse prevented me from communicating with the Arduino, I do not understand because the mouse was COM3 and Arduino COM4 and I could load the scripts into the Arduino without problem. I can run the Z21 with the Arduino mount. Thank you for your help. Best regards
Hi Rob I’ve now been trying to get this to work for a number of hours and even tried a different Arduino I’ve got all the right down loads and think I’ve got it into JMRI ( my DCC++ is on Com 6 (uno) and com11 for the Mega) all code is changed and updated as per your instructions but when I have the page with the 67 connections I don’t get the same top line as you ISCLOCKRUNNING and my tope line AR2 shows unknown, I have tried several sensors in more than one set of pins but still no response, also when I go back into JMRI after closing I need to reload the panel it’s saved to every time,can you give me any guidance please Derek
Hi Derek! Sorry you're not having much success. If your IR sensor is lighting up when you wave your finger in front of it then your hardware is probably fine. Most people have issues with the script that needs to be run. Take a look at this video which uses exactly the same kit, but removes the need for the script. It also allows you to name your sensors however you want. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html Regarding the loading of the panel every time, agreed, it's really frustrating. If you go to Edit -> Preferences -> Startup Then click the "add" button and select "open file". You can then select your panels/config file. JMRI should then load this every time it starts up. Let me know how you get on with it all. Again, sorry for the frustration, but you'll feel great when it's all working!
@@LittleWicketRailway Hi Rob many thanks for the information I have now changed over to CMRI and all is working well, one more question for you now can I attach my blocks using the sensors or is it not possible? Derek
@@drnutsert Hi Derek, glad that's all working for you. How are your blocks currently setup? Anything that provides a logic level output which can be read by the sensor shield can be used as a sensor.
@@LittleWicketRailway Hi Rob I’m very new at this and have during lockdown set up a single board 800 x 400 with two turnouts and 4 sections of track I split it into 4 blocks and purchased the Merg DTC2-T and assuming I assembled them correctly they are now in place powering up the track but I’m not sure if they are giving out a signal or not, I have put the 1K res in R*5 which I thought was for 5v setup, using the CMRI System I have the turnouts and two sensors working I have also un // the code and have also added several new lines in that section of the code, I have added two more sensors in the sensor section and added two blocks for now and assigned the new sensors to each block, I’ve also produced in my layout a design copy of my setup and got the blocks shown, when in sensors I invert them the track colour changes, so all good I just can’t work out why the DTC2 is not sending a signal? Any suggesting would be gratefully received Derek
Hi, great tutorial, thank you. Have you tried using an Arduino Uno/Mega with a YFRobot R3 V5.0 sensor shield? I am having some problems with this. The sensors are working, however, I cannot get JMRI to read them. I am using your codes, but, I think some changes may need to be made to the programming. I shall be grateful if you had any ideas that may help. Many thanks, Brendan
Hi Brendan, I've not used that particular shield, but if it's a sensor shield then I would have throught that it would work in a similar way to the mega sensor shield in the video, just with fewer sensor pins. That might be an incorrect assumption, but let's carry on for now... It's good that your sensors are powered up and reacting, so that's positive. Maybe open the serial monitor (under the tools menu in the Arduino software - set the Baud to 19200) and see what the output is when the sensors changes state, you should see some communication. If you can see something happening there then that suggests the sketch/Arduino side of things is ok and that the problem lies with JMRI and the script. There are a few easy things to double check that caught me out if you're not getting a response in JMRI: 1) have you closed the Ardunio IDE software before running JMRI. Worth doing this just in case the Arduino software's connection to the Arduino is preventing JMRI from commuicating. 2) when you created your sensors in the JMRI sensor table did you name then AR2, AR3, AR4, etc. The naming is very important since the script is specifcally looking for the "AR" followed by a number. 3) did you update the JMRI script with the COM address for you board? This line in the script "a = SerialSensorMux("COM6")" You can find your COM port from the serial monitor in the Arduino software. After that it might be worth checking the following: In the sketch did you update the part at the top with the number of pins availables? This line: "#define Sensor_Pin_Max 70 // Max sensor pin NUMBER (plus one) Mega=70,UNO,Pro Mini,Nano=20" You may need to reduce the number in this line to match the pins available on your board: "char sensor_state [70]; // up to 70 sensors on a Mega2560" I don't know what the sketch does if it tries to read pins that don't exist, but it's worth trying just in case that's causing an issue. Let me know how you get on.
@@LittleWicketRailway Hi, Thank you for such a detailed and speedy response it was really appreciated. I began as you suggested with the serial monitor which returned readings when the sensors were activated. I followed your steps and had made the same amendments so it's not there. I feel the programme may need to include a driver but am unsure which to use. As an example my turnouts include the line, "#include ". If you have any thoughts I shall be grateful. Brendan
Hmm, if you're seeing the correct output in the serial monitor then it suggests it's either an issue with the connection to JMRI or the script. Can you post a link to the Arduino and the shield you're using ? I'm sure I've got an Uno sensor shield somewhere around here, I'll try to dig it out and see if I get the same issue, but it might have to wait until the weekend. I'm not the author of the original sketch or script, but I'll try to help. It's not great if you're following the video and it's not working for you. In the mean time it might be worth having a scan through Geoff Bunza's site (model-railroad-hobbyist.com/node/34392) and the comments (there's a lot) on there to see if anyone else has had the same problem.
Hi Rob, Just got things working today. I had to make one change where I replaced Sensor_Scan.py with Sensor_Scan_R2 and hey presto the servos were recognised in JMRI. Many thanks for your hard work in this series. Brendan.
After getting my arduino mega the sensor shield the sensors to find that the jython script is seriously faulty and does not run in 3 different editions of jmri you can't imagine how frustrated i am
You can use the same hardware to make a CMRI hub that will do the same thing and will definitely work with JMRI - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html
Hi Rob I'm having problems getting my sensors to show on JMRI. I've followed your instructions on this video using AR2 as the user name and running the sensor script. I did open JMRI system console and when I cover the sensor the display says AR:2. Not Available AR:3 Not Available etc I've set the com port to the same as in system devices for the USB Arduino Any ideas? Darren
Hi! Sorry you're having issues with this. I'd recommend trying CMRI rather than using the script. See this video (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html). It means you don't have to run a script and you can name your sensors whatever you like. It uses the same kit, but is a more reliable way of doing things. It's also easy to change inputs to outputs.
Sorry Edward I have no idea if you can you can use a raspberry pi as a base station. You can run JMRI on a raspberry pi, but you'd still need a base station to connect to it.
Sorry that you're having problems with this, but it's hard to say exactly what's going wrong. There are a number of areas when you can encounter problems. The sensor names have to exactly match what's in the script, the script needs to run and the communication via the COM port needs to be working. You can do some fault finding to see what data is being sent and received via the serial monitor, but I would suggest that you check out this video (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html) which uses exactly the same hardware but has some advantages. You can name the sensors however you want, there's no need to run a script every time you start up JMRI and you can change inputs to also be outputs.
@@LittleWicketRailway pleased to say it was all my fault. I edited JMRI script with your inversion text. I later discovered I introduced a syntax error - tabs. I then discovered the Arduino sketch contained an offset of 18. Pin 2 changed AR20. That was on next page of sensors. I was watching AR2. I now have it working and I am looking at block detection and servos. I suppose the moral of the story is RTFM properly but you made it look so simple. Lol. Thank you. Graham
Hi Rob Do the sensors only work through dcc++. I've set things up as per the video but sensors not changing state. I have sensors on com 5, cmri on com 4 and Digitrax DCS52 on com 3. Sensors light up but wont change state in jmri. It seems as though the script isnt uploading to JMRI as your panal seems to go light when script is loading and mine doesnt Hope this makes sense
Hi Stephen The sensors should work regardless of how you are running your trains. Have you updated the bit in the sensor scan code where it references the COM port? Have you closed the Ardunio IDE software before starting JMRI? Are the sensor names in the sensor table identical to those in the video? If your sensor LEDs are lighting up then you're half way there.
@@LittleWicketRailway thanks for the reply Rob. I've ordered uno and motor shield, coming tomorrow. I will install that, then reinstall the sketch and script. If that works I will take of the dcc++ reinstate the digitrax and see if it works. I will let you know how I get on. Cheers
@@LittleWicketRailway Hi Rob My sensor hub is on com 5 anyway so nothing to change. I've done the change to the script. Closed arduino software. I've got a feeling that the script isnt uploading to JMRI for some reason. When watching the video I noticed that the writing on the top of your panel pro goes light grey whilst the script is uploading, mine doesn't so I have no idea if it's loaded. Will keep trying, I'm obviously doing something wrong. Cheers
Hi @@stephengibson1106 , I've been trying to tag you in a comment below, but I don't think it's working. See the post from Paul Derham. Is this the same issue you're having?
@@LittleWicketRailway hi Rob. Sounds very much like it. Will have a go tomorrow night. I assume the delay is in the python script? I've even uninstalled and reinstalled jmri but still the same. Will let you know how I get on. Thanks
Hi Rob, I have been following your videos controller up and running, and have just built the sensor one. However I can not get JMRI to see any sensors. Editing the Arduino sketch allows me to see the sensors in the IDE, but it would appear that JMRI is not opening comms to the sensor Arduino. Have you any troubleshooting tips? so I can find what I have not done or have done wrong.
Hi Paul, Are you running the sensor scan script in JMRI? That's what starts the communication. Also worth checking the COM port in the script is the right one. Also the names of the sensors in the JMRI sensor table need to be exactly the same as in the video. Let me know how you get on.
@@LittleWicketRailway Hi Rob I have not got to the bottom of the problem but looking at the system console window after running the script there are errors NameError: global name 'extport' is not defined Just in case I messed up the modifying of the python I have run the original but get the same errors. Although ther scripts run ok. Is it possible I am missing or have an old library? Panel Pro 4.20+Rc7ba8249b Java 1.8.0_271 Windows 10 19042.685
@Little Wicket Railway Hi Rob I got to the bottom of the issue, I needed to increase the value of the delta_delay changing it to 14 did the trick. Thank you for you suggestions and for the great videos. Paul
@@paulderham8172 well done on finding the solution, I don't think I would have got to the bottom of that very quickly! This is the delay built into the sketch that gives JMRI time to send the data right. It's quite possible that other people may experience the same issue so thanks for sharing 👍
I went to Amazon to order the board but got this message from Amazon, This item cannot be shipped to your selected delivery location. Please choose a different delivery location." What search term should I use to locate it for a Chicago delivery location.
Hi James, All my links are for UK sites. if you're based in the USA and looking for the sensor shield to fit on the mega board then have a look at this, looks like it would do the job (please check product/seller feedback before buying and shop around for the same product for the best price). www.amazon.com/HiLetgo-ATmega2560-16AU-Expansion-Ultrasonic-Communication/dp/B01DK7C1C4/ref=sr_1_5?dchild=1&keywords=arduino+sensor+shield&qid=1600937953&sr=8-5 If you're looking for the mega board then try here: www.amazon.com/ELEGOO-ATmega2560-ATMEGA16U2-Projects-Compliant/dp/B01H4ZLZLQ/ref=sr_1_4?dchild=1&keywords=arduino+mega&qid=1600938080&sr=8-
Hi Rob, I write with great frustration in that I cannot seem to get this to work. I'm running PanelPro 4.22 and using an Arduino Mega. I run the code on the mega and I can see the Tx light flicker when changing state of the input, but no change in the shown sensor state on the table. What confuses me is that the Mega is running on Port 7 on its IDE, but in setting up I'm only given Port 4. I have tried both Ports in the Python scripts, along with the script modifications with no result. I have tried this on two different computers and OS. It would be great if I could get this to work. Thanks for any input.
I should add that the sensor table always come up "Unknown" on all channels, which would seem that the states of the Arduino inputs are not being read.
Hi Rob great videos. I can’t get the sensor scanning script to work. I have the sensor hub working with sensors,servos and out put led. How can use this with part 2 automation Back and Forth .
HI rob, Have followed your Video Exactly. The bunza site link has changed and is not the same and sensor scan r2 and the 1,4 Zip has gone. Any clues on how to get it to work. Thought mega may be faulty so done blink text on various pins all o.k Robert
@@LittleWicketRailway For anyone else looking: Remove the closing parenthesis from the end of the link and it works. model-railroad-hobbyist.com/files/users/geoffbfiles/Sensor_Scan1_4.zip
##### IMPORTANT INFORMATION ##### A few people have pointed out that the link to the files (script and sketch) on Geoff Bunza's website no longer works. I have uploaded these files to my GitHub area ( github.com/LittleWicketRailway/Geoff-Bunza-JMRI-Sensor-Scan ), but all credit should still go to Geoff Bunza for developing this system. This is a simple way of adding sensor to a layout, but I would encourage anyone interested in this to explore the CMRI video series which uses the same hardware, but allows use of different sensor names, doesn't require a script to be run in JMRI and can be adapted to change inputs to outputs. CMRI Part 1 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OkXG3mfY6PE.html CMRI Part 2 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CUWFqFmO1Ng.html CMRI Part 3 - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WsfczIPbhsU.html ##### IMPORTANT INFORMATION #####
Would this work with a DIY current detector as in model-railroad-hobbyist.com/node/31270 as not sure I like the opto version as it would be better if I constantly knew if the block was occupied. I do think your series is fantastic, will definitely be using Arduino and JMRI. Thank you for sharing all this good stuff.