NFC/RFID Block Detection

dimonic Jul 12, 2016

  1. dimonic

    dimonic TrainBoard Member

    23
    15
    2
    As per request, I am setting up a new thread for this topic.

    I am experimenting with RFID for block detection on my budding n-scale 1860's era model railroad. My reason for wanting block detection is that I am also implementing sound using surround-sound system approach, and I need loco location to do this. (Basically I am re-implementing the SurroundTraxx system without requiring the Digitrax block detection system).

    My goals are:
    • Small enough for n-scale (or less).
    • Low cost (compared to alternatives).
    • Works with DCC+ (Arduino + PC).
    My initial research prices out 13.56 MHz NFC/RFID detectos at $30 (Grove), and RFID tags at about $2.50. I am ordering a detector and some tags on Thursday so within a couple of weeks I will be testing on my newly laid track-bed.
     
  2. mrp

    mrp TrainBoard Member

    22
    4
    13
  3. dimonic

    dimonic TrainBoard Member

    23
    15
    2
    One of the tags I am ordering is this one: <http://www.digikey.ca/product-detail/en/atmel/AT88SC0808CRF-MR1/AT88SC0808CRF-MR1CT-ND/3789379>, which is 8.00mm x 5.06mm x 0.38mm. and this one: <http://www.digikey.ca/product-detail/en/atmel/AT88RF04C-MVA1/AT88RF04C-MVA1CT-ND/4146888>, which is 18.10mm x 8.60mm x 0.75mm.

    My experiments will determine fit, range, speed (how fast stock can pass the detector and work reliability etc).
     
  4. dimonic

    dimonic TrainBoard Member

    23
    15
    2
  5. dimonic

    dimonic TrainBoard Member

    23
    15
    2
    And... they are here! Next day delivery is a wonderful thing (especially when that next day is a Friday), leaving me the weekend to play with my new toys.

    The RFID tags and detector:

    https://goo.gl/photos/3b4wPFbRpgDQpMbEA

    I will probably do initial tests in serial (uart) mode for speed and ease of configuration, but the eventual integration will be I2C. Something like this:
    1. Connect reader to Raspberry Pi, install libraries.
    2. Test reader / tag in air (direct range determination).
    3. Test reader below track, tag (hand) held in air above.
    4. Reader below track, tag on bottom of rolling stock.
    5. Reader below track, tag on bottom of loco / tender (metal interference issues etc).
     
    Last edited: Jul 15, 2016
    Simon Mitchell likes this.
  6. Will G

    Will G TrainBoard Member

    19
    13
    2
    Dimonic,
    Did you get any further with this? I'm about to try exactly the same but with a cheap (£2) reader. I'm particularly interested in whether the reader worked under the track.

    Ultimately I'm hoping that I can modify the DCC++ code to allow the tracking of locos/trains.


    Sent from my iPhone using Tapatalk
     
  7. dimonic

    dimonic TrainBoard Member

    23
    15
    2
    Hi - sorry for the hiatus. Real life intervened. Right now I cannot realistically schedule the time to work on this, but I will return at some point this year. The hardware is sitting in a box awaiting that happy moment.
     
  8. Will G

    Will G TrainBoard Member

    19
    13
    2
    I know the problem well.

    I experimented with a MFRC522 reader yesterday and have tried modifying the DCC++ code to incorporate a call to the reader but have yet to test it.


    Sent from my iPhone using Tapatalk
     
  9. Will G

    Will G TrainBoard Member

    19
    13
    2
    It looks like it should work. DCC++ appears to be sensitive to exactly which pin is set as the RST pin for the MFRC522: if certain pins are selected, sending the serial command to turn on track power results in a brief (<0.5s) flash of the motor shield LEDs, and a return of p1 p2 or p1 p3 in the serial monitor. Pin 5 seems to work, I haven't yet tried working out why some work and some don't.

    Time to add more RFID readers...

    Sent from my iPhone using Tapatalk
     
  10. Will G

    Will G TrainBoard Member

    19
    13
    2
    I can read the tags fine from within the DCC++ code, even with the reader under the track, as long as the tags are not right up against the bottom of the loco (an old Farish 08 diesel). It might be different on a loco without a cast metal frame.


    Sent from my iPhone using Tapatalk
     
  11. GFG

    GFG New Member

    2
    0
    6
    Hi Will and Dimonic

    I have just come across this Blog...just what I have been looking for!

    I also have N stock that I am wanting to track on my single track layout.

    I'm awaiting the delivery of a PN532 reader kit https://www.ebay.com/itm/263200023288

    Admittedly the tag is too large, but I'm looking at stripping the housing down to perhaps fit the contents inside the cab of a Dash 8 diesel loco or in trailing rolling stock. There appear to be an assortment of other tags about that are 25mm diameter, flexible, and rectangular.
    At this stage, I am primarily interested in the range and performance of the reader as it is within my budget !

    The intention is to work it with an Arduino.

    I will be very interested in any comments from both of you, or indeed anyone else working with this media in this scale.

    Regardss

    Gary
     
  12. GFG

    GFG New Member

    2
    0
    6
  13. FlightRisk

    FlightRisk TrainBoard Member

    548
    237
    14
    I hope this project stays alive. Like a lot of things I am very interested in, I find a thread about them and then get disheartened when I see the last post was years ago.
     

Share This Page