Це відео не доступне.
Перепрошуємо.

Arduino for Lego Trains #6: Controlled Junctions

Поділитися
Вставка
  • Опубліковано 18 сер 2024
  • Learn how to control train traffic through a pair of crossings with your Arduino. Program your own Finite State Machine to shut down each track in turn, using just two light sensors and a motor controller.
    Features Lego 9V train sets 4559 (Cargo Railway) and 4560 (Railway Express), as well as copious amounts of cranberry jam.

КОМЕНТАРІ • 83

  • @giuliafiore7821
    @giuliafiore7821 2 роки тому +1

    I know this video is 7 years old, but if you used 4 sensors (one on each side of the junction in each direction) you could tell when the junction was clear without the need for timers. This would easily scale up for people with larger train setups where timers would eventually cause crashes.

  • @dezzodarling
    @dezzodarling 7 років тому +2

    AWESOME! I think introducing technology to toys and hobbies is the best way to get kids (and grown-ups too, of course ! hahahah !) interested! Keep it up!

  • @VaupellGaming
    @VaupellGaming 8 років тому

    Both the Arduino Uno and Mega are capable of using IRQ, on atleast 2 pins.
    Meaning you can program a "interrupt" into any State.

  • @TheErolDude
    @TheErolDude 9 років тому +10

    love the little intro :D

  • @codaman127
    @codaman127 7 років тому

    Start: Yeah... alright, nice string and off camera work, fun little intro.
    second train loading: Heh... cute.
    Both trains progressively growing nearer to each other: Alright, this is going to be an intersection crash or a demonstration early on.
    Little before the crash: I never realized little lego motors made that noise.
    1:16: Ban-GAH! WHY?
    1:20 Oh my god! Why!? Did we need this as an example!?
    1:28 What even is Amberjam!? Why am I so distraught right now!?

  • @train-traum-madabouttrains5005
    @train-traum-madabouttrains5005 5 років тому +1

    Really cool!! ;-)

  • @magicguystudios7940
    @magicguystudios7940 3 роки тому +1

    It’s been 6 years why haven’t you uploaded any videos

  • @revis8024
    @revis8024 6 років тому

    Interesting tutorial.

  • @jeroendesmit7381
    @jeroendesmit7381 9 років тому +2

    I love your videos, the only problem is that i can't find the needed wiring :(Do you have a website or blog/forum with extra information some where?

    • @ArduinoLegoTrains
      @ArduinoLegoTrains  9 років тому

      +Jeroen de Smit Thanks for watching! All the wiring between the sensors and the Arduino is standard goldpin stuff - any store that sells Arduino stuff will have it. The only "special" wire you need is the motor-controller-to-Lego, cable, and I show how to make that in my Introduction video: ua-cam.com/video/gFDe3nqLHl4/v-deo.html

  • @logancooper6418
    @logancooper6418 9 років тому +3

    1:30 my reaction LOL

  • @mikosoft
    @mikosoft 8 років тому +1

    If I understood correctly you make the trains wait at the junction for a preprogrammed time. Wouldn't it be better to make them wait until the light sensor stops detecting the train and then make them move?

    • @ArduinoLegoTrains
      @ArduinoLegoTrains  8 років тому +2

      +mikosoft The timer starts once the sensor stops detecting the train. This gives
      the first train enough time to clear the sensor and the junction.
      This is also because the sensor needs to be a little way away from the junction, so that the second train has space to stop.

    • @mikosoft
      @mikosoft 8 років тому +1

      +Arduino Lego Trains AH, I see. I must have misunderstood the control logic then. THanks for the clarification

  • @God-CDXX
    @God-CDXX 8 років тому

    I DID THIS WITH A FLIP 4 FLOPS AND 6 AND GATS 4 OP AMPS NO SOFT WARE PS CMOS LOGIC CAN RUN ON THE SAME POWER AS YOUR MOTORS 9 VOLTS THESE WILL WORK WITH YOUR LIGHT SENCERS AND MOTOR DRIVERS THE OP AMPS WERE USED AS TIMERS I LIKE THEM OVER THE 555 OR 556 BECAUSE YOU CAN DO TOGGLE TIMERS WITH 1 IC LM1458

  • @stevenneighbors6714
    @stevenneighbors6714 7 років тому

    Hello, I am having some trouble with the coding. I keep getting lots of errors, even when I copy and paste from the website. Could you maybe email me the code for the 6th video.? Your Lego trains and coding are astonishing and amazing to watch.

  • @callybx
    @callybx 5 років тому

    I love these videos and am using them to automate my 7 yr old grandson's train set for him! I don't know if you're still answering here but the one thing I'm totally stuck on is connecting 2 trains to the motor to make this project work which I haven't seen in any of your videos - I've made 2 cables, one to join to each track connector, but when I connect the 2nd cable to the output 3 and 4 at the opposite side of the motor to the ones for the 1st cable that you use in your 1st video then connect up the 3 wires from the arduino to motor pin 1, motor pin 2 and the motor PWM (which I assume is the all I need to do), the 2nd train doesn't work. Is this wrong? Hope someone can help!!

    • @callybx
      @callybx 5 років тому

      OK, well I answered my own question because I traced the problem to a faulty track connector (I have 3 and only 1 still works now :-( ) and when I replaced it then each train worked fine - I'm waiting for another connector then hopefully they will work together!!

  • @ashtonkendall9163
    @ashtonkendall9163 8 років тому

    How can u use arduino with power fucntions

  • @JohnKessler
    @JohnKessler 8 років тому +1

    couldn't you add two more light sensors to tell when the train has moved past so you can start the other train. that way the wait will always work no matter how long the train is. additionally you could add extra cars to the trains without recoding.

    • @ArduinoLegoTrains
      @ArduinoLegoTrains  8 років тому

      Absolutely. It's simply a matter of code complexity vs wiring complexity. My solution shows how to achieve the simplest solution with the minimum number of parts, but with four sensors you could even code in speed calculations and bi-directional crossings too (if your train travels in both directions on the same loop).

    • @sarahrettensteiner4946
      @sarahrettensteiner4946 7 років тому

      j

    • @anikopagacs2694
      @anikopagacs2694 7 років тому

      John Kessler 🛩🛩🛩✈️✈️✈️✈️✈️🛩🛩🛩🛩🛩🛩🛩🛩🛩📲📲📲📲📲📲📲📲📲📲🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞📽📽📽📽📽📽📽📽📽🎞🎞🎞🚍🚍🚍🚟🚟🚟🚟🚟🚟🚟🌏🌏🌏🌏🌏🌏🌙⭐️🌙🌙⭐️⭐️⭐️🌤🌤🌤🌤🌤🌤⛅️💥💥🔥🔥🔥🔥🔥🔥🔥💥💥💥💥💥🔥🔥🔥🔥🔥🔥💥💥💥💥💥💥💥💥☄️☀️☄️☄️☀️☄️☀️☀️🌦🚒🚒🚒🚒🚒🚒🚒😌😊😚🚛🚛🚛

    • @user-dw5nq8oj1o
      @user-dw5nq8oj1o 7 років тому

      John Kessler ុតប

    • @silviaalonso4593
      @silviaalonso4593 7 років тому

      John Kessler ss

  • @poirot12345t
    @poirot12345t 7 років тому +1

    Can I use your videos to build my own railway Lego system?
    Thanks for answer

    • @ArduinoLegoTrains
      @ArduinoLegoTrains  7 років тому +2

      Yes! Follow all these tutorials and you'll learn how to build really complex layouts.

    • @poirot12345t
      @poirot12345t 7 років тому +1

      Arduino Lego Trains Thank you very much

  • @sabrinsayem7145
    @sabrinsayem7145 6 років тому

    can you send me the component of this circuit

  • @ziemur
    @ziemur 6 років тому +3

    Ten komunikat brzmiał dziwnie znajomo.

  • @bobtheoldoven5406
    @bobtheoldoven5406 7 років тому

    cool.

  • @carailphotography
    @carailphotography 6 років тому

    lol cranberry jam

  • @preethakarthick7023
    @preethakarthick7023 7 років тому

    my little son like train how much price this if u seller means give ur details pls

  • @KoW4LsKy
    @KoW4LsKy 6 років тому +9

    czeeeeeeekaj, ta zapowiedz brzmiała dziwnie znajomo

    • @bdshke
      @bdshke 6 років тому +1

      Tak po Polsku, nie? :D

    • @PKT718
      @PKT718 5 років тому

      @@bdshke no

    • @komunikacyjny_mix
      @komunikacyjny_mix 2 роки тому

      @@bdshke tak, po Polsku.

  • @kn2002wroc
    @kn2002wroc 8 років тому +12

    Komunikaty z polskiego PKP?

  • @michaelakopov845
    @michaelakopov845 8 років тому

    i am new to this and just starting. how you control 2 different trains?

    • @ArduinoLegoTrains
      @ArduinoLegoTrains  8 років тому

      +Michael Akopov Skip to the 3:00 section: ua-cam.com/video/YqTgpuXnWeI/v-deo.htmlm
      You can see we declare pins for IN1, IN2 and ENA - these are the motor control pins for Train 1. Then IN3, IN4 and ENB are the motor control pins for Train 2. This requires each train to have its own piece of track.

    • @michaelakopov845
      @michaelakopov845 8 років тому +1

      thanks a lot for quick response. understood now

    • @user-yv4uh2fm2f
      @user-yv4uh2fm2f 7 років тому

      Michael Akopov 😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😠😈😈😈😈😠😡🙅🙌🙋🙆🙆🙅🙇🙎🙇🙆🙍😫😿😽😻🚋🚋🚋🚋🚋🚋🚋🚋🐏🐑🐐🐺🐃🐂🐦🐧🐧🐧🐧🐧🐧🐧🐧👑👟👞💄💄👓👔👖💼👜💣💣💣💣💣💣💣🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋😻😻😽😿🙍😫👓🐂🐦👔🐃🐦🐺🐺👓🐂🐂🐂🐃🔫💰🐂🐃🐂🐃🐃🐂🐂🐃🐃🐃🙍🙍🙍🙍🙍🙍🙍👟👟👟👟👟👟👟👟👟👟👑👑👑👞👞👞👞👞👞👞👞👞👞👞👞

    • @JulienMagne
      @JulienMagne 3 роки тому

      Hello, there is something I misunderstand in your setup. In order to control both trains separately, did you have to make some electrical isolation on the crossing?

  • @SR_superior_1000
    @SR_superior_1000 7 років тому

    Forgot my password in Legos so I am sending my updated resume

  • @Cranberrie123
    @Cranberrie123 7 років тому +1

    hello from reddit

  • @Airtightdaddy
    @Airtightdaddy 7 років тому

    Release coool

  • @Minecraftmigapiku
    @Minecraftmigapiku 7 років тому

    you are from poland

  • @artiz8985
    @artiz8985 8 років тому +3

    нитку бы хотя бы скрыл!!!

  • @TheUazizo
    @TheUazizo 8 років тому

    😙😵

  • @alexandergomez8770
    @alexandergomez8770 8 років тому

    k

  • @user-sx3rf3ix6i
    @user-sx3rf3ix6i 7 років тому

    뉴스톡톡

  • @jameslegg3969
    @jameslegg3969 8 років тому

    X

  • @martinweager8857
    @martinweager8857 6 років тому

    Blah blah blah ha ha