RFID Chess: One reader + many antennae - arduino

I'd like to read a playfield of RFID token equipped chess pieces. For cost and simplicity, I'd like to use ONE reader and many antennae.
I'm planning to purchase the following:
ArduinoMega; large enough to just let me program and debug without
optimizing for space or speed
standard 8x8 chess board; size may be determined by coil diameter (see below)
standard 16 pc chess set
16 RFID tokens of a given frequency; each with a different "value" or serial number that when glued to the bottom of the chess pieces would uniquely identify each piece to the system
64 RFID coils (initially) designed for correct frequency of RFID tokens; mounted to bottom side of playfield
1 RFID reader compatible with RFID frequency selected
some sort of multiplexor (or set of multiplexors) for the Arduino to step thru connecting all 64 of the coils for the playfield
My overall system design would be to connect the reader to each coil in turn via the multiplexor(s) and read the token found at each location of the playfield, if any. The Arduino would read the output of the RFID reader and step thru the various field positions, monitoring which chess piece was at which location.
Before I just buy all the parts and go for it, I'm wondering if anyone here has any initial advice or criteria to consider.
My specific questions are:
Would one RFID freq set be better than another?
How long should the Arduino have to "wait" at (row x col) position to read a token - if a token is even there - before trying to read the next one?
Is it better to use one big multiplexor vs many small ones tied
together? Why?
Part of this question was originally asked here: https://electronics.stackexchange.com/questions/9255/rfid-antenna-array
Moderators requested that the author start a new question instead of asking a new question in the replies of an existing question. But I can't find that they ever did. So, here we are.. :^)

Your design is completely valid. Sometime ago, i play with RFID using arduino and found that RDM xxxx, using Wiegan standard, is very hard to code. The simple and working one is MFRC-522, mifare family. For easiest use on maintenance, you should uses writeable RFID card, so if one of chess your pieces is lost, you can easily replace it.

Related

Can't get temperature reading out of ble beacon .. at my wits end now. This needs a super-hero I guess

I have a task where I need to read 2 parameters from a BLE Beacon. The documentation was seriously lacking and after a fair amount of effort, I managed to get some basic information about reading the data from the BLE Beacon.
The parameters to read are
1) Battery Voltage of the sensor
2) Temperature the beacon has a built in temperature sensor.
I think I have tried almost every popular Python BLE library out there but I just can't seem to get the temperature reading out of the beacon. "I think" I am able to read the voltage. The reason why I said "I think" is because the value seems to match what was provided in the minimal document. And also when I put the beacon into the charger, I can see the value go up - an indication that it is the voltage reading. As I could not read the temperature ( because the UUIDs that are mentioned in the document, the value doesn't seem to change ). I have tried enabling the sensor in every possible way and method described - by writing 01:00 etc. I spent a fair amount of time to reverse engineer the thing. I ran a packet sniffer and managed to capture the data that was being transferred between the beacon and the mobile app ( They have a mobile app ). But then again I am not able to figure out how the temperature readings are being communicated between the beacon and the app. Let me break the whole stuff in smaller blocks.
Hardware: BLE beacon from which voltage and temperature can be read. The temperature sensor is built into the beacon. And the beacon itself is from Texas Instruments but the temperature, voltage sensing part is done by a third party. They provided us with some minimal information and it was difficult to make sense of some of the sentences as they have trouble communicating in English.
The sequence to get the data goes like this
Scan for beacons
When the beacon is found then connect to it
Enable notification
Set notification interval
Get the voltage and temperature reading.
I have been able to do the first 4 real fast, and "half" of No. 5, i.e getting the voltage part. When I say real fast I mean I got that stuff with nearly no documentation available at that time.
As per the info that I have the data resides in these characteristics/UUIDs. Also please note that the UUID are not standard 128 bit and this caused me issues when using certain libraries. But after some tries I got to read/write to them using handles etc. The handles and other stuff I printed are ones that I read using PYGATT (A Python wrapper for gatttool).
The UUIDs are marked as 1st, 2nd, 3rd and 4th parameters and it has the following to say about the parameters
- A: 1 byte (2nd Param)
- B: Maj + Min values, 4 bytes (4th Param)
- C: 4 bytes (3rd Param)
- D: Enable/disable notification ( I have been able to turn this on )
- E: Set notification interval ( I have been able to set this and can notice the change in notification interval )
This is minimal so as to not have a large file. All it does is this - the mobile app connects to the beacon, then the notifications start and the temperate readings are retrieved by the mobile app. Like I had mentioned, I don't seem to have problem reading the voltage, it's only the temperature that I am getting stuck at. I have been at it for a week now. I think I have tried nearly everything that I could think of. I even enumerated all the writable characteristics and tried writing numbers like 1 ( enables the sensor? ). I could have offered a bounty for this straight away if it were possible. I rarely get stuck for so long with a problem. This is driving me a little crazy. I am getting close to my wits end - I guess it's time for a super hero - anyone out there? :) I can provide for every bit of information needed if someone could indicate what is wrong. I even wrote a cordova app ... and tried a bunch of stuff from my Android phone. I can connect ... write to characteristics, read stuff etc but temperature ready, nah!!! It just won't budge. All I get is the same set of values ( I used a JSON.stringify to display A, B and C). I can bother about the byte order later. I guess that is a smaller problem.
The communication between the beacon and a third party mobile app is fine, it is able to read the temperature info just fine.
I have been looking at wireshark data and I am fairly sure that the temperature data is being communicated at this stage. But then when I decode the "value", it looks like it's the voltage. It mentions l2cap but I am not sure how that is being used here to send the temperature readings ( if it is using that in the first place ).
Update: Wrote to every writable characteristics. Wrote values like 1, 0100, 2, 7 on every writable characteristics. At the same time I was reading every readable characteristic ( in a loop ) and doing a comparison (just true/false) with the previous set of values. This seemed like a quick and easier way to know if something changed. Didn't want to take chances with converting the hex to a float. I can figure out the byte order later.
From the sniffed data (wireshark) I can only see 3 writes happening on the beacon.
I am not fully sure, even after a long discussion, but it seems that the four bytes of the notification are used for the voltage as well as the temperature, since the temperature can most probably be derived from the voltage.
From the values it seems that those four bytes represent the voltage in float (if you ignore the absurd factor of 10^-38 that comes in because only 4 bytes instead of 8 bytes are used).
Since typically the temperature T is derived from a resistivity measurement, where the resistivity R is proportional to the voltage U (if the current is constant), you can in principle calculate the temperature T from the voltage U.
The problem is that T(R) is relatively linear, but not perfectly (in contrast to U(R) which is assumed to be U=RI). So you may need to plot the values for T(U) to find out the curve that they are using.
To add to the confusion, I got the best results when only using the first five bits of the third byte and the eight bits of the fourth byte. I am not aware why this is the case, and it might point to some trouble still.
The best option is to ask for their function T(U) that they are using. If they can and will provide it for you...

Using BLE on Arduino to control multiple LEDs

I am trying to start a project in which I would create my own app on iOS using Swift to communicate with an Arduino 101 to control multiple LEDs. I have used this project as a base point.
After getting this to work with my custom app, I wanted to figure out how to make this work with multiple LEDs instead of just one. Currently, I am just performing writeCharacteristic to send a 1 or a 0 to the Arduino depending on which button I press (ON/OFF). However, for the new project, I need to be able to select one of the lights (select one of four output pins), and write a 1 or a 0 to turn it on and off. I didn't know what approach I should take to do this.
I don't need any code, just suggestions on how I can make this work through swift/Arduino code.
Thanks.
It's all explained in the manual.
https://www.arduino.cc/en/Reference/CurieBLE
Service design patterns
A characteristic value can be up to 20 bytes long. This is a key
constraint in designing services. Given this limit, you should
consider how best to store data about your sensors and actuators most
effectively for your application. The simplest design pattern is to
store one sensor or actuator value per characteristic, in ASCII
encoded values.
So either create a separate BLEBoolCharacteristic instance for each LED or combine the switch state of all leds in the same BLECharacteristic. For example you could encode 8 LED states in a single byte (1 LED per bit).
Do whatever you prefer. But read manuals...

How to make a FSK Rfid Tag that works at 125 kHz?

I am trying for some time to make my own rfid reader following the ideas on the DIY FSK RFID Reader. My primary problem now is that i do not have a specific rfid tag to test the reader so i decided to make my own using also an arduino uno. The only information on the internet which i found is at FSK MODULATED SIGNAL.
I really need to know how to write the code to transmit the id from the tag to the reader. I mention again that the tag needs to work at a 125 kHz frequency and needs to use FSK modulation.
You won't be able to send data to the Reader without special hardware, just adding a wave on some antenna doesnt work for RFID systems with passive tags.
Reason is, RFID-Tags do not actively 'send' waves to the reader, instead they 'modify' (modulate) the reader's field by producing load on the antenna.
Imagine when the tag had an LED switching on and off while receives energy from the reader's RF field by inductive coupling. The reader will notice a change in it's own field when the LED on the TAG turns on/off as the more/less power is drained from the RF field.
This method is used for the TAG -> Reader communication, which is nice for several reasons:
TAG gets power from inductive coupling anyways, modulating the signal through load is alot more power efficient than using power for actively sending.
Smaller/Easier/Cheaper, needs less hardware on the TAG, might even need a separate antenna for sending
Harder to snoop communication as the modulation is harder to detect from distance
tl;dr
A bare ardouino doesn't have the required hardware onboard to modulate the reader's RF field.
Sidenote: transponders are not expensive, you get them for a few bucks. The LF transponders based on T55x7 are really nice for playing around as the can be configured for various modulations (PSK/FSK/etc in different modes), bitrates and more, however the usually come with Manchester modulation enabled by default.

AdaFruit pn532 NFC/RFID detecting multiple tags?

I am working off an Arduino UNO with an AdaFruit pn532 NFC/RFID shield. The Goal is to have a shoe box, with a false bottom. Under that false bottom would be my prototype, which hopes to be able to tell every mifare tag (up to 6) that is in the box, above the false bottom.
I started with one shield, and had it detecting up to two tags with in range..
If i placed one tag it logged that one tag over and over again in the loop() of my sketch.
If I placed two tags above the shield it logged the two tags in an alternating pattern. ("tag1","tag2","tag1"....)
But when I placed three tags, it only logs the third tag.. This is essentially using the adaFruit mifare example.
I then set up the UNO with two shields and in the loop() checked both.. worked exactly the same. Once there were three tags, regardless of which pn352 they were placed on (2 on one, and 1 on another, or all three on one) it only logs one tag.
Has anyone tried to create anything that would detect up to 6 tags in range? If so could you share your discoveries?
New to Arduino..
thanks
The answer to your question leads into the technology of RFID. The reader emits radio waves at the operating frequency (usually 125kHz or 13.56MHz). When you bring an RFID tag to the reader - it accumulates the energy of the magnetic field of the reader and use this energy to transmits the ID at the same frequency back to the reader. The key point is that the RFID protocol does not provide for work with several tags at once.
So, if you bring 2 or more tags to the reader - they simultaneously start to generate RF signal, each with its own ID, thus "interrupting" each other. As a result, your reader gets garbage instead of the correct ID payload.

How is this data from a magnetic card encoded?

I have some information about magnetic cards that control the building access, and need to reverse engineer the way the software stores data on the cards to make something with more features. (We have lost contact with the original programmer.)
I have no idea how writing the order is done; I'm no magnetic card expert.
I know a few things:
Data is on the third track.
all readers are standalone and have batteries.
There is a master card that can add or remove some cards for a reader(currently, you need to go through all the doors to add or remove a card from the system).
Each card is different, and must have a unique identifier.
There is a expiration date, but I have no idea if it's a date format or just a number incrementing in the door readers.
There is a "flag" which gives access to special places (parking) and it isn't affected by the expiration date... weird.
I've got a reader and some software to read it. It gives me hexadecimal numbers.
As example here is a few cards I've got.
BAC716863B8CB32832BABAB40E1739BAB677563B3AF8BA3ABABABEBABABABABABAC0 (card with parking)
BDC011813CB9B4CBB53DBDB21FD2BCBDBEEA3EBDBDFFBD3DBDBDB1BDBDBDBDBDBDC0 (card with parking)
9DE031A11CA9912E951D9D9225369D1D9FCE6C9D1DDF9D1D9D9D9D9D9D9D9D9D9DC0 (normal card, no special access)
I just hope it's not secured by anything that could make this impossible to reverse-engineer.
This question comes up high on google, i experienced a similar issue and solved it.
Data on magnetic card encoded in ANSI/ISO ALPHA Data Format (on Track 1) and ANSI/ISO BCD Data Format (on Track 2 and 3). Most magnetic card readers decode this data before returning so you don't have to but some reader don't and here we are.
You can find encoding table and more information here: http://www.abacus21.com/Magnetic-Strip-Encoding-1586.html

Resources