To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 15529
15528  |  15530
Subject: 
Re: "No Contact" Homebrew Train Sensor for Mindstorms
Newsgroups: 
lugnet.trains, lugnet.robotics
Date: 
Thu, 31 May 2001 19:21:01 GMT
Viewed: 
58 times
  
In lugnet.trains, Mario Ferrari writes:
Hi Chris, thanks for sharing this.

I had the same positive results with reed sensors in my automated rail
station. The station actually detects the incoming train through the well
known light sensor + lamp method, but I wanted a way to distinguish
passenger trains from freight trains, so a couple of months ago I asked for
some help to John Barnes and Sergio Lorenzetti. During  a short discussion
where we examined many interesting ideas (including bar codes, transponders
and other sophisticated stuff), Sergio suggested to use the good old reed
switches and a small permanent magnet on the train. So did I and... it
works! In my set up the reed switch is incapsulated into a standard brick
and looks like a very standard Lego sensor with its cable. That brick is
incorporated into the platform of the station and connected to the (hidden)
RCX. I placed a Lego magnet on the side of the passenger trains, just below
the car plate. When a train triggers the reed contact the RCX knows that
train must stop at the station.
I still continue to detect all the trains with the light sensor, because the
RCX also controls semaphores and insulated sections of tracks to separate
trains, but just now from your post I realize I can use reed sensors at rail
level for this purpose too :-)

Ciao
Mario

"Chris Phillips" <chris.phillips@computerboards.com> wrote:
As has already been reported by others, I built an automated railroad
crossing for the NELUG train display at last weekend's Greenberg show.  I
wanted to take a moment to describe the "homebrew" sensor that I used to
detect an approaching train so that others might benefit in their own • layouts.

I originally tried several techniques to detect the presence of a train,
including the touch sensor, the light sensor opposite a light source, and
the good old infrared "radar" technique that has been well-documented on • the
robotics forum in the past.  I also considered using Vision Command, but I
didn't want to have a PC in the loop if I could avoid it.  None of these
techniques was very reliable: I couldn't find a good way to trip a touch
sensor without derailing the train, and the other techniques required a • lot
of highly visible and unsightly "plumbing" somewhere along the track.  I • had
pretty much abandoned the idea of using an RCX to detect a train before I
remembered an idea that I had awhile back but never tried, due to my
semi-irrational aversion to non-LEGO solutions.

I used reed switches which are small switches encased in glass that close
whenever a magnetic field is present.  I simply chopped a long electrical
connector in half, (ouch!) soldered the reed switch to the bleeding end, • and
connected it to an RCX sensor input which was configured as a touch • sensor.
Voilla!  The RCX could easily detect the presence of a magnetic field as • if
a touch sensor were being pressed.

I then placed the touch sensor _lengthwise_ along the track, and found • that
the magnetic couplers between the train cars were strong enough to trip • the
reed switch.  (At first, I placed the reed switch perpendicular to the
track, but this didn't work due to the alignment of the magnetic field • from
the train magnets.)  It was then a simple task to program the RCX to close
the drop-gates and turn on the signal lights at the crossing.

I went to Radio Shack to buy the reed switches.  The 'Shack used to sell
reed switches in a pack of four, but they don't any more.  Instead, I • looked
at their home security stuff and found a sensor/magnet pair for $4 that I
was able to extract the reed switch from.  If I had more time+patience, I
would've gone to a larger electronics store and bought a pack of reed
switches instead.  It would've been a lot cheaper, and also I broke 2 out • of
4 switches during the extraction process -- they are _very_ delicate!

At first, I didn't think the train magnets were strong enough to trip the
reed switch, so I stuck one of the Radio Shack magnets onto a 2x4 plate
(using the double-sided tape supplied with the magnet) and attached it to
the underside of the locomotive.  This worked great.  But later, we • removed
the non-LEGO magnet from the train and found that it worked anyway.  I • think
the reason this didn't work the first time I tried it was that I had the
reed switch oriented perpendicular to the track, because it fit between • the
ties better that way.  However, I soon discovered that even the more
powerful magnet would not trigger the reed switch unless the N-S poles • were
aligned lengthwise with the switch, and by then we had already attached • the
stronger magnet to the train.  We turned the magnet and reed switch
lengthwise because we wanted to hide the offending non-LEGO magnet
completely on the underside of the loco; otherwise we might never have
discovered that the LEGO magnets alone will do the job!  So I must • emphasize
that, although it is tempting to lay the reed switch between two ties, it
will only work with the train coupler magnets if the switch is lying
lengthwise along the track.  Otherwise, you'll need to add extra magnets
that are aligned side-to-side in order to trip the switch.

For the show, I simply used the RCX to close the gates for a fixed length • of
time whenever it sensed the train coming.  This worked OK, as long as the
speed and length of the train remained constant.  But for our next show
(which I have now been tasked with creating several more crossings for) I
will improve the software to sense each train coupling as it passes to
determine how long to keep the gates down.  I also plan to use multiple • reed
switches at each crossing in order to detect a train approaching from • either
direction, and also to detect the actual speed of the train on-the-fly.

Anyway, I was amazed at how well this technique worked once I figured out
the alignment thing.  Maybe LEGO will add a reed switch sensor to the
Mindstorms product line so that I won't have to feel guilty about using a
non-LEGO component in our otherwise pure-LEGO train display.  Here's
hoping...

Hi everyone.

My name is Tony Hedglen and I’m very interested in automated Lego railroads.
I am a member of Michlug and we are one of the newer clubs. We have done one
train show so far and we won second place. I read these posts on sensors and
I think it’s awesome. I’ve been searching for some time now on how to
automate Lego trains. This is the first I seen someone talk about the
subject. I wold like to learn more. I have no idea on how mindstorms work
and I have basic electrical knowledge. Could someone please help me out on
this subject? Thanks.

Tony



Message has 2 Replies:
  Re: "No Contact" Homebrew Train Sensor for Mindstorms
 
(...) Hi Tony - I haven't had a Mindstorms for long, but I've already built an automated level crossing. The Mindstorms is based around the Lego 'RCX'. This is a large brick, about the size of the old 4.5V battery boxes, but with some very special (...) (23 years ago, 31-May-01, to lugnet.trains)
  Re: "No Contact" Homebrew Train Sensor for Mindstorms
 
(...) Tony, If you search back through the .trains and .rcx newsgroups, you'll find a few scattered gems on the topic of RCX control of 9V trains. I'll summarize some of the basics for you here: The Mindstorms RCX microcontroller brick provides (...) (23 years ago, 31-May-01, to lugnet.trains, lugnet.robotics)

Message is in Reply To:
  Re: "No Contact" Homebrew Train Sensor for Mindstorms
 
Hi Chris, thanks for sharing this. I had the same positive results with reed sensors in my automated rail station. The station actually detects the incoming train through the well known light sensor + lamp method, but I wanted a way to distinguish (...) (24 years ago, 6-Dec-00, to lugnet.trains, lugnet.robotics)

21 Messages in This Thread:








Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
8 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR