Це відео не доступне.
Перепрошуємо.
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.
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.
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!
Both the Arduino Uno and Mega are capable of using IRQ, on atleast 2 pins.
Meaning you can program a "interrupt" into any State.
love the little intro :D
TheErolDude
TheErolDude t
TheErolDudMmkMe mmnvbn vcfykl,m.jkjBzeAsgtun
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!?
Really cool!! ;-)
It’s been 6 years why haven’t you uploaded any videos
Interesting tutorial.
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?
+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
1:30 my reaction LOL
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?
+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.
+Arduino Lego Trains AH, I see. I must have misunderstood the control logic then. THanks for the clarification
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
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.
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!!
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!!
How can u use arduino with power fucntions
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.
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).
j
John Kessler 🛩🛩🛩✈️✈️✈️✈️✈️🛩🛩🛩🛩🛩🛩🛩🛩🛩📲📲📲📲📲📲📲📲📲📲🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞📽📽📽📽📽📽📽📽📽🎞🎞🎞🚍🚍🚍🚟🚟🚟🚟🚟🚟🚟🌏🌏🌏🌏🌏🌏🌙⭐️🌙🌙⭐️⭐️⭐️🌤🌤🌤🌤🌤🌤⛅️💥💥🔥🔥🔥🔥🔥🔥🔥💥💥💥💥💥🔥🔥🔥🔥🔥🔥💥💥💥💥💥💥💥💥☄️☀️☄️☄️☀️☄️☀️☀️🌦🚒🚒🚒🚒🚒🚒🚒😌😊😚🚛🚛🚛
John Kessler ុតប
John Kessler ss
Can I use your videos to build my own railway Lego system?
Thanks for answer
Yes! Follow all these tutorials and you'll learn how to build really complex layouts.
Arduino Lego Trains Thank you very much
can you send me the component of this circuit
Ten komunikat brzmiał dziwnie znajomo.
cool.
lol cranberry jam
my little son like train how much price this if u seller means give ur details pls
czeeeeeeekaj, ta zapowiedz brzmiała dziwnie znajomo
Tak po Polsku, nie? :D
@@bdshke no
@@bdshke tak, po Polsku.
Komunikaty z polskiego PKP?
+KrisMaster Tak, z dworca Katowice
You propably answered to the wrong comment.
where do you get it
0:27
I
i am new to this and just starting. how you control 2 different trains?
+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.
thanks a lot for quick response. understood now
Michael Akopov 😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😠😈😈😈😈😠😡🙅🙌🙋🙆🙆🙅🙇🙎🙇🙆🙍😫😿😽😻🚋🚋🚋🚋🚋🚋🚋🚋🐏🐑🐐🐺🐃🐂🐦🐧🐧🐧🐧🐧🐧🐧🐧👑👟👞💄💄👓👔👖💼👜💣💣💣💣💣💣💣🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋🚋😻😻😽😿🙍😫👓🐂🐦👔🐃🐦🐺🐺👓🐂🐂🐂🐃🔫💰🐂🐃🐂🐃🐃🐂🐂🐃🐃🐃🙍🙍🙍🙍🙍🙍🙍👟👟👟👟👟👟👟👟👟👟👑👑👑👞👞👞👞👞👞👞👞👞👞👞👞
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?
Forgot my password in Legos so I am sending my updated resume
hello from reddit
Release coool
you are from poland
+Michal Pietrzak nie, ale mieszkam w polsce
Ok. Ale dźwięk polskich dworców się narzuca
+Arduino Lego Trainsㄷㄱㅌㄱㄷㄱ
нитку бы хотя бы скрыл!!!
😙😵
k
뉴스톡톡
X
Blah blah blah ha ha