I am currently working on a RFID tracking project. In short, I am using Arduino Mega 2560's with an Adafruit Data Logger and XBee Shield with a Series 1 antenna to monitor a number of RFID 125 kHz antenna's (via an antenna microchip). Hope that makes sense.
Currently, the Mega 2560 limits me to 4 Serial Hardware RX ports, I don't require the TX ports. I am pretty sure the answer is no to my first question but I will ask anyway. Is there a way to expand the number of serial ports on the Mega 2560. In a perfect world, I require 40 RFID antenna's per board, but even if I could double it to 8, I would be happy.
If not, can anyone recommend another solution that I could add to the Mega 2560? Or maybe another solution outside of the Mega 2560?
If the "senders" don't all send at the same time you could connect several senders to a single Rx pin - but you need some external hardware because the Serial prototocol holds the line HIGH when idle and if they are all holding the line HIGH you won't be able to receive anything. I can't immediately remember how to deal with that - I think it involves a diode on each line so that the "sender" can pull the Rx line LOW but cannot drive it HIGH.
A more "sensible" approach would be to use SPI or I2C which allow several devices on a single "bus"
Unfortunately I require each antenna to represent a certain location. In short, I have a series of small antenna's sitting side by side. I would need to identify each antenna as well as the RFID tag. If we combined them into one RX, they would all read as the same location and there would be no way to differentiate between the antennas.
What is the output/format of the RFID tags? Is it serial TTL? You might be able to use a multiplexing chip like below to multiplex input from a number of tag data pins into a single rx pin.
zoomkat:
What is the output/format of the RFID tags? Is it serial TTL? You might be able to use a multiplexing chip like below to multiplex input from a number of tag data pins into a single rx pin.
I am not sure if this is the right answer to the question but the RFIDs use UART. I scraped together code from a number of different forums but I need more serial ports that support UART (i.e I need more RX ports). I am a complete newbie so I apologize if I'm not answering the question correctly.
DrDiettrich:
Do your RFID chips support hardware handshake (RTS/CTS)? Then a multiplexer can be used to select/enable one chip after another (polling).
Sorry, total newbie here. Maybe I am misunderstanding what you are saying but how does adding a semiconductor increase the number of SPI/RX/UART ports I have? I only have 4 ports currently (0,15,17,19). Also where do I solder these semiconductors? What ports would I use once I added them? I apologize if I am totally lost. Maybe there are some instructions out there on how to apply this solution?
The semiconductor you add is a chip that will provide you with an extra UART, that means an extra serial port. You attach them to the I2C bus, on a UNO that is pins A4 & A5. You can attach many devices to these same two pins and have many extra serial ports.
Maybe you should hold off on such a complex project untill you have a bit more experience.
Thanks for the advice. I would love to hold off but unfortunately we are building the lab in the next month, so I have to learn quickly
I have learned to put things together pretty quickly. For example, using some existing XBee code I found floating around the interent, I was able to add XBee functionality to my RFID antenna's within a few hours; something that I was told would take much longer to do by the original developer of the code.
The key thing I require is a healthy amount of resources for what I am doing. I will take a look into what you are suggesting. If there are any resources you can point me do, please do. Thank you
mart256:
Why dont you do a multipoint network with the xbee?
What do you mean? How can I collect data from more than 4 RFID antenna's using the RX ports but then have the XBee collect additional data from a 5th or 6th antenna? If the code that reads the antenna's sit on the Arduino Mega, don't I have to run everything through the RX ports on the Arduino first?
Grumpy_Mike:
The semiconductor you add is a chip that will provide you with an extra UART, that means an extra serial port. You attach them to the I2C bus, on a UNO that is pins A4 & A5. You can attach many devices to these same two pins and have many extra serial ports.
Maybe you should hold off on such a complex project untill you have a bit more experience.
So let me know if I have this correctly after doing a bit of research.
I would buy an I2C/SPI to UART Breakout: Breakout Chip
I could then attach multiple breakout chips to the 20 (SDA) & 21 (SCL) on my Arduino Mega 2560 (Arduino Reference); this is the same as the A4 & A5 ports on the Uno.
However, currently my Adafruit data logger RTC is using the SDA and SCL ports (Data Logger Reference).
Is it possible to use the SDA and SCL ports for both the Adafruit Data Logger & for breakout board?
Once you add the extra UARTs then you have to write your own code to access them you can no longer use the Serial calls. Each UART has its own buffer so it is a matter of talking to the right register on the I2C bus. I have not seen any libiary that will do this although that is not to say one dosn't exist.
So first off learn about I2C devices and how to talk to them. Get the data sheet of the external UART you want to use and see what registers you need to talk to. Don't forget to add pull up resistors on the lines and decoupling capacitors on each chip you use. I would advise against using solder less bread board and use strip board to make the board with the extra chips. Look at the chip's external address lines to see how many chips you can use at the same time without bank switching the bus.
This is a very steep learning curve, I would say it is greater than vertical, good luck.
However I have one quick question, maybe you answered this above already so I do apologize if I'm making you repeat yourself but it's all a little over my head at this point.
I was wondering if there is a way to identify each of the additional UART breakout boards? For example, if I had 4 extra breakout boards, I would like to know which one is being triggered.