Arduino Model Railroad Crossing Signal With Current Sensing!

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ค. 2024
  • Today we are doing another upgrade of an Arduino Model Railroad Project. We are modifying the Arduino Crossing to work with current sensing. This allows for much simpler coding when writing the program. I hope you guys enjoy this Arduino Model Train Project!
    Arduino Sketch
    github.com/DIYandDigitalRR/BD...
    Check out my Facebook page
    / diyanddigitalrr
    Support the channel on Patreon
    / diyanddigitalrailroad
    Check out my Instagram
    / diydigitalrailroad
    Check out my Etsy Store
    www.etsy.com/shop/DIYandDigit...
    Original Crossing Signal System With Infrared Sensors
    • Arduino Crossing Signa...
    Upgrade of Original Crossing Signal
    • Arduino Crossing Signa...
    Arduino UNO
    amzn.to/2QbqhMx
    Arduino Wires
    amzn.to/30ZMRxK
    LEDs
    amzn.to/2PYrDKi
    Flasherboard
    amzn.to/2DVjwf0
    Breadboard
    amzn.to/3auk6wc
    Arduino Starter Kit
    amzn.to/34cWIlA
    NCE BD-20
    www.trainworld.com/manufactur...
    N Scale Train Set
    amzn.to/33TzsbS
    HO Scale Train Set
    amzn.to/311N17g
    O Scale Train Set
    amzn.to/3lAZCGu
    G Scale Train Set
    amzn.to/312Cn09
    I do a lot of 3D Printing. Here are some great printers
    Anycubic Photon
    amzn.to/2SAnJZn
    Creality Ender 3
    amzn.to/3lkMogX
    Camera I use
    amzn.to/2SyuPh5
    Support the channel with some Merchandise!
    teespring.com/shop/diy-digita...
    Connect with me at ddrrcommunity@gmail.com
    I do a lot of 3D Printing. Here are some great printers
    Anycubic Photon
    amzn.to/2SAnJZn
    Creality Ender 3
    amzn.to/3lkMogX
    Original Prusa Mini
    shop.prusa3d.com/en/3d-printe...
    Elegoo Mars
    amzn.to/386NZSa
    Anycubic Mega Zero
    amzn.to/3mHfdpi
    Qiditech Shadow S 5.5
    amzn.to/3cZl059
    Samaritan’s Purse
    www.samaritanspurse.org/
    Camera Used
    amzn.to/2X87yWR
    “The godly may trip seven times, but they will get up again.
    But one disaster is enough to overthrow the wicked.
    Don’t rejoice when your enemies fall;
    don’t be happy when they stumble.
    For the Lord will be displeased with you
    and will turn his anger away from them.
    Don’t fret because of evildoers;
    don’t envy the wicked.”
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 59

  • @chriszalenski9443
    @chriszalenski9443 ปีที่แล้ว +3

    Question: On your sensing track you did not elaborate on if the sensor track was insulated or not. Also it looked like you had 3 detection wires going up to the track and you did not elaborate on if all three wires went through ( don't know the technical term it looked like a chock) the chock(?) but can you have a little more video on the sensor wires.

  • @TheTrainFreak
    @TheTrainFreak 3 ปีที่แล้ว +1

    This is very cool Jimmy! I use NCE BD20's on my layout for block detection on my layout so I will most likely I have to use IR sensors on mine. Whether using this for grade crossings or block detection, resistor wheels are a must and if you make your own, do each truck's inner wheel so the back 1/2 of the car isn't still in the grade crossing area when it cuts off. Great video! - Jason

  • @JoeG-firehousewhiskey
    @JoeG-firehousewhiskey 3 ปีที่แล้ว

    Very nice and easy. I really like the use of the BD20

  • @chazco
    @chazco 3 ปีที่แล้ว

    Great video.

  • @1sparkloc
    @1sparkloc 3 ปีที่แล้ว

    Love this one tried it with ir sensor didn’t work for me my rolling stock kept tripping the ir sensor and turned the flashers back on tried playing with the sketch but no change. I asked about it and Jimmy got back to me within a day said he was working on it. This is a much better way for my needs at $12 bucks for a sensor I’m good with it. Thanks for your time and your post please keep up the great work. I’m learning a lot about what can be done with a Arduino I would say for a fair investment. Again thanks for your time.

  • @user-fr5ez9yi1o
    @user-fr5ez9yi1o 3 หลายเดือนก่อน

    Hi Jimmy love your videos. Where can I find those flasherboards? Thanks

  • @oregonsignalfan
    @oregonsignalfan 2 ปีที่แล้ว +1

    have you figured out how to make specifically a grade crossing predictor using arduino? something to give the same warning time regardless of train speed.

  • @darrentecklenberg4280
    @darrentecklenberg4280 21 วันที่ผ่านมา

    Hi Jimmy, do you have any TH-cam videos on linking multiple Arduinos together in cases where there are not enough input or output sensors on one board. The reason I ask is that I have 54 signal box levers that I want to introduce interlocking using Arduinos that will show a green LED next to each signal lever that will illuminate if that lever can be pulled, or a red LED if it needs to be put back into the frame, normally when the track sensors reports occupied in the block ahead of the signal that is pulled off, thus prompting to put the levers back. Also are there any AC current sensors that can be used with the Arduino that are cheaper than the NCE ones you use?

  • @TheKenWiley
    @TheKenWiley 2 ปีที่แล้ว

    In my opinion, the use of current detection means either the flasher is on or off depending a train presence. How big a block are we talking, 6" on either side of the crossing, or a block that spans several (1:1) feet? A separate block just for each crossing? Secondly, the blocks are already in place and have other uses and duties. Adding more blocks in the middle of blocks is sure to complicate track wiring and trouble shooting. I'd rather insulate the entire subsystem from the rails. With IR sensors you control exactly where the action occurs, and it's a lot more than an on off switch.

  • @Vman7757
    @Vman7757 3 ปีที่แล้ว +1

    Wow That's cool. How will it work with a train? Do you have to add resistance wheels to your car for detection? Wow looks like I could do this.

  • @GuyMasong1
    @GuyMasong1 3 ปีที่แล้ว +2

    Can't you just use the arduino to do the flashing?

  • @eXtremeFX2010
    @eXtremeFX2010 ปีที่แล้ว

    Hi just getting interested and started.
    Any updates since making this tutorial?
    😊
    Also... is there a recent tutorial on creating resistor wheel sets?

  • @thomasbanks1133
    @thomasbanks1133 3 ปีที่แล้ว

    Just wanted to let you know that these Arduino project videos sparked me to learn and build a rather elaborate n scale power and control circuit with a 12v dedicated PSU, a DCC++ base station, Arduino based layout signal/switch control/block sensing circuit. The latter performs switch duty on two switches, controls signals for the entire layout using PWM LED control boards (depending on block status and switch position), and uses circuit sensor coils to block sense 4 different blocks, all with one Arduino Uno.
    Let me know if you want any details on my setup.
    Thanks again and keep the videos coming!

  • @paulsharpe3794
    @paulsharpe3794 3 ปีที่แล้ว

    Hi there just a quick one to say that I have seen 10k serfice mount resistors fitted to a carege axle with a bit of conductive paint or conductive epoxy. This is ferly cheep and quick

  • @jvanamb
    @jvanamb 3 ปีที่แล้ว

    IF "there is sharp stuff on the floor" than tell the DIY-babies to go to their room. Daddy is playing Casey Jones.
    ~Jim

  • @kimgeddes3032
    @kimgeddes3032 3 ปีที่แล้ว

    How many nce bd20's do you think you could run off 1 Arduino?

  • @billyjohnson4335
    @billyjohnson4335 5 หลายเดือนก่อน

    Is there away to use sensors to keep 2 trains running on same tracks from derailing each other

  • @dinoap
    @dinoap 9 หลายเดือนก่อน

    Could this be done with a Nano instead of an Uno?

  • @SATODEN
    @SATODEN 3 ปีที่แล้ว

    Another great tutorial. But I wonder if this detection only works for the loco and not on non powered cars since they won’t be drawing any current. If so flashing light will stop before all the train passes unless expanding the detection zone to be able to contain the entire train before and after the crossing.

    • @dazrich20
      @dazrich20 3 ปีที่แล้ว

      seen somone just solder tiny resistors to the metal wheels

    • @SATODEN
      @SATODEN 3 ปีที่แล้ว

      Odd Fellow I see but that’s a lot of work if you’re running many cars

    • @dazrich20
      @dazrich20 3 ปีที่แล้ว

      @@SATODENWhy I went for 38k infrared sensors. but not using em for block detection yet. made a dc run in shuttle instead. not got the video uploaded tho.wired infrared leds under the track point up at a gantry with a 38k sensor attached.wired Leds in pairs for 6 sensors due to the amount of light bleed interfering with sensors.

    • @SATODEN
      @SATODEN 3 ปีที่แล้ว +1

      Odd Fellow I did the same. Block signals I wired are all IR sensor. Placed Ir sensor leds sandwiching the track.

    • @patp3177
      @patp3177 3 ปีที่แล้ว

      Just remember, if you have a loco without sound, and you haven't turned on the lights, it doesn't pull any current when stopped. Just one of those things.

  • @stephengoodall2390
    @stephengoodall2390 3 ปีที่แล้ว +1

    Can the bc-20 not drive the flasher board directly without the Uno?

  • @devoiddude
    @devoiddude ปีที่แล้ว

    Is that programming language C ?

  • @ravzir
    @ravzir 3 ปีที่แล้ว

    I don't understand. What wire are you looping inside BD20? Where is that wire connected?

    • @patp3177
      @patp3177 3 ปีที่แล้ว

      It's Jimmy's page but, that should be a single feeder to a track rail. You would come off the power source, loop through the BD20 and continue on to the rail. In the case of DCC it doesn't matter which. If you're measuring DC it needs to be the positive, not sure if the BD20 can read DC current. Some CT's only read AC.

    • @ravzir
      @ravzir 3 ปีที่แล้ว

      @@patp3177 oh this makes sense. Thank you. But this would assume you have isolated sections of tracks? I'm sorry, I'm not too familiar with complicated layouts. I only had one switching layout with just one pair of feeders.

    • @patp3177
      @patp3177 3 ปีที่แล้ว

      @@ravzir You are correct on the isolated sections of track would be the safest. Clean breaks between blocks and all. It doesn't have to be separate wires all the way from the source, just a main buss with section feeders will work, measuring each feeder.

  • @chriscox4023
    @chriscox4023 3 ปีที่แล้ว

    Hi, I copied the sketch verbatim but the last line won’t compile , namely if(Sensor

    • @DIYDigitalRailroad
      @DIYDigitalRailroad  3 ปีที่แล้ว

      Hey Chris. I just duplicated your error. There needs to be a comma between 6 and HIGH so it needs to read digitalWrite(6,HIGH); I hope this helps!

    • @chriscox4023
      @chriscox4023 3 ปีที่แล้ว

      Sorry, I missed the comma out of my note to you so that was not the problem. I have just reverified and it now says ‘,’ expected before { token. I presume the highlighted line is the one at fault if so it’s still the last line before the double }}

    • @DIYDigitalRailroad
      @DIYDigitalRailroad  3 ปีที่แล้ว

      Try using the code at this link. If that doesn't work, then email me at ddrrcommunity@gmail.com drive.google.com/file/d/1c1w7oVQjng3j50tUEQksxPxzOP7T8uwS/view?usp=sharing

    • @JacksonSubNScaleModelRailroad
      @JacksonSubNScaleModelRailroad ปีที่แล้ว

      ​@DIY and Digital Railroad is the detection zone insulated on one rail?

    • @JacksonSubNScaleModelRailroad
      @JacksonSubNScaleModelRailroad ปีที่แล้ว

      How do you wire it to the track?

  • @richardray6827
    @richardray6827 3 ปีที่แล้ว

    The arduino is not needed. The lights can be controlled through the BD20. See page 3 of the BD20 instructions.

    • @DIYDigitalRailroad
      @DIYDigitalRailroad  3 ปีที่แล้ว +1

      Yes you are correct for this specific project. A BD20 can control a single output. This was part of a larger project where I updated a few of my older arduino sketches to use current sensing instead of IR sensors. I actually ended up building my own arduino based DCC Current sensor that is significantly less expensive than a BD20 th-cam.com/video/I_G2AsMq5vk/w-d-xo.html

  • @FredE528
    @FredE528 3 ปีที่แล้ว +1

    Can you tell me if the BD20 can be used directly with DCC++ and JMRI as sensor just like an IR sensor? Thanks.

    • @TheTrainFreak
      @TheTrainFreak 3 ปีที่แล้ว +1

      The BD20 from NCE unfortunately can't be used as a IR sensor as it's only designed to detect current. I use these for block detection on my layout.

    • @FredE528
      @FredE528 3 ปีที่แล้ว

      Sorry, I wasn’t clear. I’m wanting to use the DB20 as current sensor. Plug it into Arduino, then define the PIN number in the DCC++ setup on JMRI and in the sensor table in JMRI. I just don’t know if the DB20 signal to the Arduino will be interpreted by DCC++ and treated correctly.

    • @daveb1365
      @daveb1365 3 ปีที่แล้ว

      That’s exactly how it works. The sensor will detect the block occupation (by a loco or lit car), not just a single point in the block

    • @FredE528
      @FredE528 3 ปีที่แล้ว

      Dave, You are saying that BD20 will work with Arduino running DCC++ connected to JMRI?

    • @daveb1365
      @daveb1365 3 ปีที่แล้ว +1

      Fred, It works great. It’ll change the status of blocks, and everything else a block detector is supposed to do.

  • @kgee2111
    @kgee2111 3 ปีที่แล้ว

    Insanely, insanely simple? Flasher boards, arduino, power supplies, coding etc, etc. Right.

  • @TimberSurf
    @TimberSurf 3 ปีที่แล้ว +2

    Why use a flip flop when the arduino is perfectly capable of doing that function (cheaper/less hardware)!!! DB20 is expensive ( for lots of block detection), we need to find a way for the arduino to do the detection just using a current transformer!

    • @DIYDigitalRailroad
      @DIYDigitalRailroad  3 ปีที่แล้ว

      My first attempt was with a regular arduino current sensor and I couldn't get a consistent reading. The BD-20 is a sure thing right now and I won't put out at tutorial unless it works well. I am still working on it though because I understand the cost issues.

    • @KenN.OXN.805
      @KenN.OXN.805 3 ปีที่แล้ว +2

      Additionally, isn’t the arduino capable of controlling 8 led’s giving the ability to use at 2 crossings with only the need to find an old power source for the led’s? For a couple dollars more than the flasher circuits, I could buy another eloogo brand uno to do another two crossings or maybe even another project like servos for turnout control.

    • @TimberSurf
      @TimberSurf 3 ปีที่แล้ว +1

      @@KenN.OXN.805 In fairness to Jimmy, he is just demoing the principle, but yes many other actions could be implemented with one arduino! Even on a smaller arduino, 18+ pins can be used (=6 x crossing with LED's directly driven or 9 x crossing with the external flip flop)

    • @KenN.OXN.805
      @KenN.OXN.805 3 ปีที่แล้ว

      I’m not trying to be critical. Just trying to point out what could be done with not a lot more spending. Hopefully Jimmy can show us beginning coders these alternative methods.
      (Edit)
      Oh, forgot...
      I’d even given a thumbs up for doing this for us🙂

  • @1sparkloc
    @1sparkloc 3 ปีที่แล้ว

    I have tried both of your both of your methods spent a bunch of money and so far I have nothing that works valid your code downloaded your update code got your BD 20s flashers lights and I still get nothing the lights just come on they never flash or use the other method with the sensors waste of money I still have nothing that will work the way you show on your TH-cam videos am I doing something wrong I fell just scared Word for Word line for line and the last one I bought what you said bye and all I get is the flash board to come on all the way through never changes is there something I’m doing wrong I followed you Word for Word but all the stuff you recommended

  • @tomraschke617
    @tomraschke617 2 ปีที่แล้ว

    The background music is not needed.

  • @rayr1952
    @rayr1952 4 หลายเดือนก่อน

    Stop the background music!

  • @scottericcatalano596
    @scottericcatalano596 3 ปีที่แล้ว

    Sharp stuff on the floor...not baby safe!