4

We are currently doing a project with DCC locomotives, involving a micro controller LPC1768.

Now the scenario is that we have a railway and under the railway we have hall effect sensors which the locomotives crosses over. Since we will have two different locomotives running on the track, is it possible to identify which one is currently crossing a particular sensor, since the trains do have their specific addresses in an address byte would it be possible to measure how the magnet(one magnet is in the form of a cylinder and one of a cube, and we are assuming they should affect the voltage or current differently) on each train affects the hall sensor. Another solution we have already thought of is to run the trains and measure where they are based on the magnets it has crossed. But for a nicer implementation a solution like the one ask for would be far easier to implement.

placeholder
  • 29,982
  • 10
  • 63
  • 110
  • 1
    Ideas: (1) Use a polarity sensitive Hall sensor and mount one magnet N-side up and the other S-side up. (2) Put two magnets on one loco. Use two sensors to detect one or two magnets ... But: watch out for stray field from the motor magnet. – Transistor Jun 03 '16 at 16:31
  • Read the rules. Remove the silly salutation and the "thank you" at the end. Ping me when you fix this, and I'll undo the downvote and then maybe even read the rest of your question. Otherwise, those that can't be bothered to read the rules or to follow them don't deserve what they came here for. – Olin Lathrop Jun 03 '16 at 16:38
  • Magnets aren't a very good communications medium, which is what you are trying to do- communicate information (the locomotive identity). I'd be inclined to think of something like LEDs pulsed at different frequencies under the locos, with appropriate sensors on the track. The other possibility might be pulse-fed electromagnets. – Ian Bland Jun 03 '16 at 20:44
  • Thank you for your advices, I will look into your ideas @transistor. – Velija Povlakic Jun 04 '16 at 00:13
  • I reckon my question being a bit vague, and I will have it in consideration next time. Sorry I like being polite won't remove them. I understand your statement and could not agree with you more, thank you for pointing that out to me :) @OlinLathrop – Velija Povlakic Jun 04 '16 at 00:26
  • Yea I have realized that, they are a real pain in the ass to work with as a newbie. @IanBland – Velija Povlakic Jun 04 '16 at 00:26
  • @VelijaPovlakic: The site home page gives a question summary when you hover over the question. If there's a greeting on the opening line of the question followed by a blank it wastes half the summary. I had to learn this too. – Transistor Jun 04 '16 at 01:28

5 Answers5

4

Look at RFID tags. They can be microscopically small (and lightweight). And cost only a few pennies for guaranteed unique identification. You could put a tag in each piece of rolling stock and use inexpensive sensor kit(s) to monitor/record/control the complete makeup of trains.

Ref: http://www.pcrnmra.org/pcr/clinics/RFID-in-Model-Railroading-20130123.pdf

Richard Crowley
  • 14,382
  • 2
  • 20
  • 37
2

Its possible assuming a few things: That the magnets are different (your question wasn't quite clear on that). That your hall effect sensor can pick up the change in magnetic field with out saturation and with sufficient sensitivity.

If the magnets have different field strengths then you could differentiate the magnets by the difference in voltage from the sensor (assuming its not saturation, the voltage output of the sensor is proportional to the magnetic field strength). You could detect the voltage difference with a voltage discrimination circuit built from comparators

If the magnets are like a 'barcode' (like your post might suggest) then it would be more complex. The solution wouldn't be easy to implement, because you would have to monitor the voltage from the hall effect sensor and sample fast enough with an analog to digital converter to see the magnet go by, you would have to develop an algorithm to do this.

Voltage Spike
  • 75,799
  • 36
  • 80
  • 208
  • Keep in mind that in a model railroad layout, there are going to be many sensors, at least one per control block in the track. Sensing the field strength of each magnet would have to be separately calibrated for each sensor. – Dave Tweed Jun 03 '16 at 20:21
  • Thank you for a lot of time saving, we will definitely be not identifying based on the signal from the sensor. – Velija Povlakic Jun 04 '16 at 00:42
1

Single magnets, no.

However, you might try something like placing a pair of magnets in line, with sufficient spacing that a double magnet would produce a double pulse.

WhatRoughBeast
  • 59,978
  • 2
  • 37
  • 97
1

You need three magnets. Mount one of them under the fist locomotive. Place the other two under the second one at some small distance from each other.

Now count how many magnets were sensed in 2 seconds after sensing the first one. If 0 - it's a locomotive 0. If one - the other one.

If you need more locomotives use more magnets and also use different distances between them.

BartoszCki
  • 11
  • 1
0

You are getting into the overall problem of occupancy detection. There are no easy answers. Some solutions are:

  1. Light detection. IR or visible light detectors are put under the track in various places. Either some ambient illumination is assumed, or IR LEDs are put overhead. Rolling stock on the track is detected by the shadow it casts.

    This has the advantage of working with any rolling stock without modification, but is susceptible to noise, changes in ambient illumination, and has problems with steady state levelling. Accumulated dirt is a never-ending problem. It also only measures occupancy at specific points.

  2. Current sensing. This measures the current draw from different sections of track. Some friends of mine are into model railroading, and I designed them a advanced DCC current sensor. It worked so well that I even made a product out of it.

    Advantages are that it senses whole sections of track regardless of where the rolling stock is. Problems are that unpowered cars aren't sensed unless you put deliberate resistors across wheel sets. 10 kΩ is sufficient for the OC1.

  3. Magnetic sensing. This is probably the least popular from what I can tell.

    It doesn't have the problem of adjusting to the ambient level as light detection does, but not all cars have a sufficiently large magnetic signature. It also requires more circuitry at each point, and is point-based like the light method.

All these methods as usually employed only tell you something is there, not what is there. The most common method I've seen to know what is where is to track it in clever software. As long as the software initially knows what's where, it can track it as it moves between sensed segments or points. There is a module in JMRI that already does this, and I've seen it work.

You could theoretically have each locomotive pulse a magnet with a unique ID, then detect that with the Hall sensors. However, if I wanted to do that I'd probably use IR pointing down with sensors below the track. That makes both the transmission and detection circuitry simpler.

With good software tracking, you only need occasional identification. I'd look into a combination of the two to keep track of where things are.

Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915