I want to make a electronic chessboard that detects the position of every piece on the chessboard.
Every chess piece will have RFID tag.
My idea will be to have 2 multiplexers(1*8) one for the rows and another one for the columns. When I want to read the position of a piece I just activate the corresponding row and column of this piece.
I don't know how to user 125kHz RFID reader with traditional analog multiplexer and to sent the signal from antennas to multiplexer and then use the multiplexer to read the tags.
I tried to use the multiplexer for only one antenna, I connected the antenna to multiplexer and then I read the signal from multiplexer, but here I am stuck, I don't know how to take the signal from multiplexer and send it to RFID reader for being read.
I tried in next example to copy the signal from multiplexer in to another analog pin(A1) and to connect this pin to RFID instead of antenna but it didn't work.
This is how is looking the electronic scheme for what I did:
Here is the fritzing version of previous electronic scheme: https://github.com/neac-andrew/MUX-RFID-Reader/blob/master/MUX-RFID-Reader.fzz
And here is a corresponding Arduino code:
#include "RFIDRdm630.h"
#include "MUX74HC4067.h"
MUX74HC4067 mux(7, 8, 9, 10, 11);
#define RX_PIN 12
#define TX_PIN 13
#define TAG_ID_BUFFER_SIZE 14
RFIDRdm630 RFID(RX_PIN, TX_PIN);
RFIDtag rfidTag;
char rxData[TAG_ID_BUFFER_SIZE]; // buffer array for data receive over serial port
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(A1, OUTPUT);
Serial.begin(9600);
// Configures how the SIG pin will be interfaced
// e.g. The SIG pin connects to PIN 3 on the Arduino,
// and PIN 3 is a digital input
mux.signalPin(A0, INPUT, ANALOG);
}
// the loop function runs over and over again until power down or reset
void loop() {
analogWrite(A1, mux.read(0));//Here I tried to copy the signal from multiplexer in to another analog pin
readRFIDTag();
delay(500);
}
void readRFIDTag() {
if (RFID.isAvailable()) { // tests if a card was read by the module
rfidTag = RFID.getTag(); // if true, then receives a tag object
Serial.print("TAG: ");
Serial.print(rfidTag.getTag()); // get TAG in ascii format
Serial.print(" Card Number: ");
Serial.println(rfidTag.getCardNumber()); // get cardNumber in long format
Serial.println();
}
}
This is the library for RFID reader: https://github.com/electronicdrops/RFIDRdm630
This is the library for interfacing the 74HC4067 multiplexers: https://github.com/nlamprian/MUX74HC4067
Here is the datasheet for RFID reader http://www.mouser.com/catalog/specsheets/Seeed_113020002.pdf
This is the model of multiplexer http://www.logicware.com.au/CD74HC4067-16-Channel-Analog-Digital-MUX-Breakout-Board-Multiplexer
I did some research and I found her some related questions but the answers couldn't help me to much:
https://forum.arduino.cc/index.php?topic=472479.0
Thank you in advance and I will appreciate any help.