Shop OBEX P1 Docs P2 Docs Learn Events
Multiple RFID reader network — Parallax Forums

Multiple RFID reader network

mhewett737mhewett737 Posts: 4
edited 2013-11-26 20:44 in Accessories
I have a large O scale model train layout that is controlled by a PC using CTI Train Brain software and hardware network. It controls, engines, switch track and accessories for automatic or manual control from the PC/ touch monitor..
The lay out uses various photo/infrared sensors to provide feed back to control operations. The problem has always been how to determine which engine is over what sensor. This CTI hardware contains modules in a rs232 daisy chained net work. These individual modules can control relays, motors and feed back sensor data or any combination depending on the module. I have developed Stamp software that allows me to insert a BS2 stamp hardware into the network and emulate any one of these modules without interrupting the network..

This network outputs and receives data back to the PC at about 80 times per second.

I have purchased small RFID R6630 modules from China that output serial TTL . The modules have small (2") antenna loops that are placed under the road bed of the track.
I have used the BS2 Stamp to successfully capture RFID data from a small round tag placed under the railroad /engine/car. . As the train car passes over the antenna the RFID reader sends a 10 byte data string to a SERIN pin on the stamp which in turn outputs a value that represents a specific train into the CTI Train Brain network to be used for controlling that specific train..

The problem is that as every one knows the Stamp does not have interrupt capability. Using SERIN with a time out I can capture the RFID data about 50 % of the time while the Stamp is off trying to emulate the CTI module requirements of inputting and outputting serial data. involving the other CTI modules.

So I have solved this problem by using a second Stamp to handle the RFID data capture ., It creates a byte that represents the appropriate engine/car and sends that byte string to the other Stamp (in the CTI network) continuously for a time period that gives me 100% capture rate.

Works great no matter what speed (reasonable speed) the car moves over the sensor.

What I need now is a way to have multiple RFID modules read. I realize I could assign individual RFID readers to specific pins on the stamp and write anti collision software to handle it, but It creates a wiring nightmare(for me anyway). I would like to use a RS 485 network and just one serial input to the Stamp.. I know there are RS485 to serial TTL converters available. Does any one have experience using a stamp to control a RS485 net work? If so , these particular read only RFID modules only output RFID TAG data. It does not output its own ID. How do I handle the fact that the RFID does not have an address to identify it in the rs485 network protocol??
I am a bit over my head on RS485 !

Any specific suggestions , alternative approaches or a place to look for info would be appreciated.

Mike

Comments

  • kwinnkwinn Posts: 8,697
    edited 2013-11-22 17:36
    Time to upgrade to the propeller chip. It could be used to read data from multiple RFID readers, append a reader ID to the tag data, and pass that on to the stamp.
  • mhewett737mhewett737 Posts: 4
    edited 2013-11-23 09:25
    Kwinn,
    Thank you for the response. . I am not all that knowledgeable about the propeller chip. I believe it does have interrupts , however wouldn't I still have to wire every RFID reader to it in order to know which reader the data came in on? Or is this a inexpensive enough chip to put at each RFID reader and then put on a serial bus to the stamp with ID and tag data?
    I am looking at 20 or more RFID readers that's a lot of wire to run. That's why I was hoping for some help with a RS 485 type of solution..
    Mike
  • kwinnkwinn Posts: 8,697
    edited 2013-11-23 15:19
    My response was based on connecting several card readers to a single propeller so that it acted as a combination of data buffer/router and RFID identifier. The chips are $7.99 each, so a bit costly to add one to each RFID reader, although the software objects and support available go along way to making up for the extra cost.

    Perhaps you could connect several RFID readers to a few propellers to reduce the wiring to a more manageable level, and then connect them to an RS485 bus or directly to each other and the Basic stamp. If that is not practical there are quite a few small chips available near the $1.00 mark that could be used for your application as long as you are willing to write the software.
  • kwinnkwinn Posts: 8,697
    edited 2013-11-23 15:32
    BTW, RS485 is more of an electrical signalling interface than a protocol. It uses 2 wires in a differential voltage mode for greater noise immunity, and transmits serial data. The software has to control access to the serial bus and the sending of data.
  • mhewett737mhewett737 Posts: 4
    edited 2013-11-25 01:30
    It seems I could do what you suggest with a dedicated stamp module having 14 pins available for RFID inputs and one left to output to the other stamp in the train network.
    I could write the software to buffer rand handle possible data collisions. How far do you think I can run a wire from the output of the RFID to the stamp SERIN pin??
  • kwinnkwinn Posts: 8,697
    edited 2013-11-26 20:44
    As I said previously I am not a Basic Stamp user, but from what I read in the BS manual I do not think you could monitor multiple serial inputs without dropping some data. Basic can look for serial data on multiple pins, but only one pin at a time, so it has to scan each input pin in turn. If the program is looking for data on pin 10 and a tag is passing over the reader attached to pin 4 some data from that reader will probably be lost unless the reader has a buffer. Do you have a data sheet for the RFID R6630 module you can post? That might be a lot of help.

    I do know for sure that the propeller chip can handle 8 simultaneous serial I/O's, and see no reason why it could not be expanded to 16, 20, or even 24 inputs.

    As to how far the TTL serial data can be sent from the RFID to the receiver, it depends on how electrically noisy the trains are and how fast the data is sent. I have sent TTL level serial data at 1200 baud about 16 feet over a twisted pair with no problems. If noise/distance is a problem placing an RS422/485 transmitter at each RFID and a receiver at the other end of the wires will solve that.
Sign In or Register to comment.