Subject:
|
Re: "No Contact" Homebrew Train Sensor for Mindstorms
|
Newsgroups:
|
lugnet.trains, lugnet.robotics
|
Date:
|
Wed, 6 Dec 2000 09:33:21 GMT
|
Viewed:
|
84 times
|
| |
| |
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...
|
|
Message has 1 Reply:
Message is in Reply To:
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
|
|
|
|