I would like to add a NFC-reader beside the magnetic card reader, faking the MagTek-output so we could use both at the same time: NFC and magnetic cards.
What do you think? Something that can be done with Arduino, a nfc shield and some couple of well-thought pages of code? Too tricky?
I think the only 'hard' part will be figuring out how to get the two devices to share the wire. All the signals seem to be "active low" so AND gates on the signals should be enough:
You shouldn't have to implement both TK1 and TK2 since only one is ever used at a time (depending on which way up the card is inserted).
The output looks a bit like SPI: Pull down Card Present and shift out data with Strobe and Data lines. The 'Rear Sensor' might be used to tell the receiving equipment that the card is fully inserted and to look for data.
I understand what you write about the AND. But I guess this can be easily done within the Arduino board? Like having the Card-Reader signals 1,2,4 as analog input and implementing the ANDs; connecting the Arduino to the black box behind.
(I come more from the programmers site, this gonna be my first electronic experience since college…)
The component behind the card reader would not use the “Card Present” input btw. and you are right, only TK2 is used.
You mentioned the output and SPI. I am a little worried about the timing though. Actually about the frequency of the strobe.
The strobe is generated based on the signal on the card so the clock rate will depend on how fast you move the card and how dense the data bits are on the card. Might be good to locate an oscilloscope so you can get a feel for the data rate. You could connect the Strobe line to a speaker and listen to the pitch to get a feel for the data rate. A medium pitch would be roughly 500 hundred cycles per second. Low pitch would be about 125. High pitch would be about 2000. Very high pitch about 8000.
Magtek card reader connected to the Arduino inputs, Arduino outputs connected to the component behind the card reader.
I receive the signal from the card reader very well (printed to serial would show the right content).
But...
Neither the forwarding nor the simulation would return any response on the black box (except for showing that there is a card in the slot).
The simpler task should be the streight forwarding. I thought the following code would copy the signal from input to output:
If that doesn't work then something else is going wrong. Perhaps some of the signals are Open Collector and need a pull-up resistor. You could try changing pinMode() from INPUT to INPUT_PULLUP to see if that helps.