Jump to content


Lego train crossing


11 replies to this topic

#1 Kolaf

Kolaf

    Posts: 24
    Joined: 25-December 09
    Member: 8735

Posted 28 December 2009 - 03:28 PM

Posted Image

The next chapter in my Lego prototyping quest has completed. I have created an automatic train crossing using two sensors, two servos, and an Arduino board.

There is one sensor at either end of the crossing which can detect when a train passes. As soon as either of them detect the train the gates are closed. The gates remain closed until the sensor the other side first has detected the train as it passes and then no longer detects any trains. In this way the gates remain closed until the entire train has passed regardless of the number of cars and the speed of the train.

Once I get longer leads I can place the sensors farther away from the crossing and thus slow the speed of the gates. I apologise for the very crude design, but given time bubble builds everything into neat Lego constructions which hides everything from sight. Also, the servos I use are a bit old, which is why things seem to shake. These will be replaced by new ones later on.

The video is included below:

Edited by TheBrickster, 08 January 2010 - 03:59 AM.


#2 Selander

Selander

  • Swedish Train Engines Extraordinaire


    Posts: 327
    Joined: 07-July 09
    Member: 6607
    Country: Sweden

Posted 28 December 2009 - 07:52 PM

I am not very familiar with those automated things....but it looks as you have done a great job.
If you could integrate it a little bit better in your city, e.g hiding cables and making it more rigid,
it will certainly look even better.  :tongue:
My Flickr and brickshelf accounts:

Flickr link

Brickshelf link

Posted ImagePosted ImagePosted ImagePosted Image

#3 Sir E Fullner

Sir E Fullner

  • The Admiral's croissants smell delicious!


    Posts: 553
    Joined: 04-September 09
    Member: 7307
    Country: United States

Posted 28 December 2009 - 09:48 PM

:sceptic:
It kind of reminds me of the 12v's

My MOCPage Ett. FullnerMy Brickshelf

Eat yer spinach, kiddies! However, don't forget the fish.
Posted Image


#4 Holodoc

Holodoc

  • Welcoming assassin


    Posts: 3670
    Joined: 24-November 06
    Member: 1094
    Country: Germany

Posted 29 December 2009 - 03:07 PM

That's exactly what I always wanted to build: An automatic train crossing! :wub:

But I would like to build it with Lego only. Guess I will have to use Mindstorms bricks for that.

Thanks for sharing your pics. :thumbup:
Posted Image Days to the 10th Eurobricks event in Billund: IIIII IIIII IIII

#5 Kolaf

Kolaf

    Posts: 24
    Joined: 25-December 09
    Member: 8735

Posted 29 December 2009 - 05:18 PM

I completely agree, things would look much better in the Lego style. The problem with Lego mindstorms is that it is much more expensive than buying cheap servos. I am working on addressing things up and hiding cables, and I will show you more details once everything is completed.

My problem is that I am more into the technical stuff them into Lego building (although I like that as well), so all the technical stuff is done first regardless of the cosmetics :-/

#6 Holodoc

Holodoc

  • Welcoming assassin


    Posts: 3670
    Joined: 24-November 06
    Member: 1094
    Country: Germany

Posted 29 December 2009 - 06:07 PM

View PostKolaf, on Dec 29 2009, 06:18 PM, said:

My problem is that I am more into the technical stuff them into Lego building (although I like that as well), so all the technical stuff is done first regardless of the cosmetics :-/
I wished I could say something similar about myself.  :sadnew:
I' m more the Lego guy rather than the technician.
Posted Image Days to the 10th Eurobricks event in Billund: IIIII IIIII IIII

#7 AllanSmith

AllanSmith

    Posts: 556
    Joined: 06-February 07
    Member: 1340
    Country: New Zealand

Posted 30 December 2009 - 07:30 PM

In  2000 I designed an  automated train crossing with flashing lights and bell (round siren module). It had a red micro motor for each barrier arm. It was powered by a Technics Control Centre II 8485. I would run a train at constant speed around the display and program the time delays into the controller.

Posted Image

#8 Kolaf

Kolaf

    Posts: 24
    Joined: 25-December 09
    Member: 8735

Posted 30 December 2009 - 09:15 PM

Nice, it's a much cleaner design than my own. The problem is, as I have stated previously, that I am inexperienced with building things that look nice from scratch. This can be exemplified by a couple of pictures that are included here of the silo that comes with a farm set. I have automated the unloading mechanism in it with a servo controlled by my remote control. In the first picture the mechanism is bare, and in the second picture I have tried to cover it up. As you can clearly see I have not done a good job. Do You guys perhaps have any ideas/suggestions as to how this can be achieved in a more elegant manner?
Posted Image
Posted Image

This third picture is of the mechanism I plan to use to encodecommands along the tracks to be read by my automatic locomotive. The strip of Lego can encode one of 15 different commands that will be read by the locomotive using the small black sensor in the picture.
Posted Image
Finally, I have included a short video of my entire setup as it is now. There is one remote controlled switch, the remote controlled self unloading silo, and finally train crossing with updated software. There are still a few bugs in this video which have been ironed out in later versions. Please, if anyone has suggestions on how this can be beautified, e.g. making it look like Lego and hiding the cables I would be grateful.

Edited by Kolaf, 30 December 2009 - 09:17 PM.


#9 Grimmy

Grimmy

    Posts: 288
    Joined: 27-November 09
    Member: 8354
    Country: USA

Posted 30 December 2009 - 10:35 PM

Very nice. I left you a comment and 5 rating :grin: Nice to see some people using micro controllers. Did you build that one from scratch or is it one of those built from a kit from online? You mentioned it is remote control, where did you buy it from? I want to replace the Infer Red Power Functions control system with a Radio Frequence Remote Control but I was just going to buy one of those cheap mini RC RF cars as they only cost $10-20. Then rip out the RC functions.

#10 Kolaf

Kolaf

    Posts: 24
    Joined: 25-December 09
    Member: 8735

Posted 30 December 2009 - 10:44 PM

View PostGrimmy, on Dec 30 2009, 11:35 PM, said:

Very nice. I left you a comment and 5 rating :grin: Nice to see some people using micro controllers. Did you build that one from scratch or is it one of those built from a kit from online? You mentioned it is remote control, where did you buy it from? I want to replace the Infer Red Power Functions control system with a Radio Frequence Remote Control but I was just going to buy one of those cheap mini RC RF cars as they only cost $10-20. Then rip out the RC functions.
Thanks!

I'm sorry to disappoint you, but the remote control is an Infrared remote control (Logitech Harmony one), and not RF. Interfacing the IR to the microcontroller was quite simple, and as I already have the transmitter the solution turned out quite cheap. I believe an RF solution would be more expensive/complex. Anyway, I have found that the reach and sensitivity of the IR system is not bad, I can point my remote control in the opposite direction and signals are still received by the controller. For what I am planning a simple RC car system will not afford minimal out of control I want to have from the system, e.g. running multiple switches, signal lights, and also various functions on the engine itself when I get that far.

The board is preassembled, I do not have the patience to solder such small things :-/. I bought it from Trossen Robotics and they shipped it and some more stuff to me in Norway.

#11 -The Hyphen-

-The Hyphen-

    Posts: 38
    Joined: 27-May 09
    Member: 6212
    Country: USA

Posted 31 December 2009 - 06:57 AM

All of your work is great. It's neat to see people thinking outside the box and incorporating stuff like this into Lego.

View PostKolaf, on Dec 30 2009, 04:15 PM, said:

This third picture is of the mechanism I plan to use to encode commands along the tracks to be read by my automatic locomotive. The strip of Lego can encode one of 15 different commands that will be read by the locomotive using the small black sensor in the picture.
Posted Image

This I'm particularly intrigued by. Correct me if I'm wrong, but isn't that essentially a Lego barcode and reader?

View PostKolaf, on Dec 30 2009, 04:15 PM, said:

Please, if anyone has suggestions on how this can be beautified, e.g. making it look like Lego and hiding the cables I would be grateful.
I can't tell from the video what your layout is built on, but the standard model railroading method for hiding wires is to drill a hole through the tabletop and route the wires under the surface.

If you're not adverse to "modifying" your bricks, you could use a dremel to hollow out a few pieces (or even glue together a few bricks, then hollow out the resulting structure), to hide your components in.
Never stop seeking that which seems unattainable.
-The Hyphen-

#12 Kolaf

Kolaf

    Posts: 24
    Joined: 25-December 09
    Member: 8735

Posted 31 December 2009 - 10:54 AM

View Post-The Hyphen-, on Dec 31 2009, 07:57 AM, said:

All of your work is great. It's neat to see people thinking outside the box and incorporating stuff like this into Lego.



This I'm particularly intrigued by. Correct me if I'm wrong, but isn't that essentially a Lego barcode and reader?
I guess you could put it that way, although I'm not sure how numbers are encoded in barcodes. The encoding I plan to use is similar to what is used in IR codes. Each "high" (H) delimits a series of lows (L). The length of lows determines whether a 0 (LLL) or 1 (LL) is encoded. For example, HLLHLLHLLLHLLH translates to 1101.

Since the train travels at varying speeds and we know the length of each high, we can use this to calibrate and correctly determine the length of the low assuming that the rates of the change in speed of the train is slow compared to the length of the low portions of the code.

This can then be used to have the train stop at stations, decelerates realistically toward stations, slow down in curves or downhill, and even differentiate between stations.

With regards to the layout, it is currently on my dining room table so drilling holes is out of the question. I'm planning on building a separate table so I will have to wait until then to get everything perfect :-)

Edited by Kolaf, 31 December 2009 - 10:54 AM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users