Wow I haven’t updated my blog in over a year… That’s sad. I have been working on stuff I swear. I guess I just got too lazy to write about it. I’m going to attempt to kill that laziness again and start writing about what I’m working on. I am once again working on the Magomatic. A few months back I upgraded it with an LCD screen and some buttons. The idea was that I could scan in a magstripe card, edit the data using the screen and the buttons, then emulate the changed data. I was able to get the data editing to work, although it was a bit glitchy at times, but unfortunately somehow the emulation seemed to have broken. Eventually I got frusterated and called it quits.
I have decided to redo this entire project with the goal of having the editing built in. I am going to be re-coding the whole thing for the Arduino. I have decided to go the Arduino route since it seems to be much more popular than the SX chip and I think more people might get use out of any good information I find. Also the Parallax SX chip is now end of life so who knows how much longer it will be around.
As of right now, I have some working code on the Arduino that will read in the magstripe data from a TTL Track 2 reader. The same reader I was using before. It doesn’t convert it into the actual number values yet but it does properly read in the binary. There is no error checking since I haven’t deemed that part important yet.
I also have a bit of code that seems to emulate data properly, but my other magstripe reader does not read the data. If I use my “pseudo sound card ghetto-scope” I can see the waveform generated by the Arduino and it appears to be outputting all of the correct data bits the same way the SX chip was. Last night I wound a new coil to make a new emulator in case the one I had been using somehow broke over the months it has been kicking around in my trunk but it was a no go. I am starting to think either the Arduino is not putting enough power through the coils, or this new magstripe reader I have is not as susceptible to this attack. This reader can read tracks 1 and 2 so perhaps since I am blasting track 2 data at both read heads it is confusing the reader. I can see the green light on the reader going away when I emulate data but it doesn’t output anything. Even if it gets bad data it should output an error code but I get nothing instead. I suspected that track 1 would show an error but track 2 would be emulated.
Because I get no errors or anything I am thinking that maybe I need to up the power going into the coil. To do this, I will probably have to use a transistor to run 5V directly from the power supply to the coil instead of powering the coil from the Arduino pin. If this doesn’t work, I might need to up the voltage still. The SX chip only outputs 5V from its pins though and that worked fine.
I also lost the adapter board I had that allows me to hook the TTL magstripe reader up to a USB port. I know for a fact that I could successfully emulate data into that reader. Also, that reader will output raw binary data that it sees, regardless of whether it is good data or not. The two track reader I have will decode the data for you and then output that, so if the data is bad you don’t see anything. Because of this, I am trying to build a new adapter board to hook up the TTL reader to my computer’s PS/2 port via an Arduino. I found some handy information online about interfacing with a PS/2 port and I will document what I found here.
The following information was found on this page.
- The PS/2 mouse and keyboard implement a bidirectional synchronous serial protocol.
- The bus is “idle” when both lines are high (open-collector).
- This is the only state where the keyboard/mouse is allowed begin transmitting data.
- The host has ultimate control over the bus and may inhibit communication at any time by pulling the Clock line low.
Data = high, Clock = high: Idle state
Data = high, Clock = low: Communication Inhibited
Data = low, Clock = high: Host Request-to-send
- 1 start bit. This is always 0.
- 8 data bits, least significant bit first.
- 1 parity bit (odd parity).
- 1 stop bit. This is always 1.
- 1 acknowledge bit (host-to-device communication only)
The site also has some handy schematics for interfacing a microcontroller to a PS/2 port.