Author Topic: Fun with ̶f̶l̶a̶g̶s̶ stripes - bare hands reading a magnetic card subway ticket  (Read 2371 times)

0 Members and 1 Guest are viewing this topic.

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 7891
  • Country: ro
Serendipity put a bag of magnetic heads for cassette players on the same workbench where I was pruning my wallet out of expired receipts.  While laying down some expired subway tickets (here the subway tickets are printed on thin cardboard the size of a credit card, and have a black magnetic stripe glued on a side) seen the cassette heads, and got the idea it might be possible to read the magnetic pulses with an audio cassette player head.

Couldn't resist the temptation and tried.  Audio heads give very small signals, but the hard magnetics used for magnetic cards have stronger magnetic fields than audio tapes.  I could also try to swipe the magnetic stripe as fast as I can, so the signal might get large enough to capture directly from the heads.

After cutting away the magnetic stripe from the subway ticket (so I can pull-swipe it by hand over a cassette player head, happened to be a mono head) I've got an unexpectedly high signal, in te 10-100mV range!  :o

Kept the cut strip pressed with a finger, and pulled the strip with the other hand as fast as I could, with the scope on single swipe and trigger at 20mV.  Why pulled by hand, the magnetic strip increase speed, that's why the increasing amplitude and increasing frequency of the captured signal.  After a few tries got a clean strong signal.

I expect nobody would believe that, so took a picture of it and some oscilloscope screen captures, one with the whole swipe, the others with a zoom-in.   ;D

Note that some peaks are close together, while other peaks are about twice far apart.  Chances are that's a pulse duration encoding.  The count of pulses/edges displayed by the oscilloscope didn't work properly with such an irregular signal.

I didn't try to decode the pulses, that would be too laborious.  IIRC there are more than one standard for magnetic cards, they have 3-4 tracks, etc.  Random example, first search result for magnetic card standard:  https://www.q-card.com/about-us/iso-magnetic-stripe-card-standards/page.aspx?id=1457
« Last Edit: December 24, 2022, 02:25:07 pm by RoGeorge »
 
The following users thanked this post: jpanhalt

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 4748
  • Country: us
Sounds like my type of project.  That is, a good way to waste time while frozen in an "arctic cyclone" like most of the midwest US.

See: https://www.reuters.com/world/us/massive-winter-storm-threatens-holiday-travel-millions-americans-2022-12-22/
 

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 7891
  • Country: ro
I'm very tempted, too, to make a reader.  Not sure why, but it seems like a cool project. 8)

However, the mechanical moving parts and heads alignment seems daunting for a quick and dirty DIY project.  :-//

I've noticed the magnetic stripe on these subway tickets is about half the width of a normal magnetic stripe from other cards.  That makes me think maybe the subway cards have only one track instead of 3-4 tracks like other magnetic cards use to have.  A single magnetic track will simplify a lot the mechanics of a DYI reader.



By looking at the oscilloscope screens, the pulses are in the audio frequencies range.  Should be possible to directly wire the heads to the input of soundcard and record the signal, then make a pulse decoder in software.
« Last Edit: December 24, 2022, 04:15:01 pm by RoGeorge »
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11166
  • Country: us
  • Retired, now restoring antique test equipment
The early magnetic cards used on the Illinois Central commuter line in Chicago in the 1970s could be read by sprinkling magnetic filings on the magnetic layer.
This happened to me a couple of times when the turnstile readers mis-read the card, and an attendant checked it in this manner.
 
The following users thanked this post: RoGeorge

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 7891
  • Country: ro
Nice!  ;D

Would be great if these subway cards were that strong.  Didn't test it but worth a try.  Even if not enough to decode, at least would be good to identify how many tracks are there, and at what distance from the edge.

I've seen a video with some fancy modern material good as magnetic field indicator, and when the detecting foil was placed on top of a magnetic card, the bits were visible in that field detecting film.



Later edit
-------------
Found something else while searching for that video, some sort of magnetic lacquer.  :D

« Last Edit: December 24, 2022, 07:07:40 pm by RoGeorge »
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 7667
  • Country: ca
The early magnetic cards used on the Illinois Central commuter line in Chicago in the 1970s could be read by sprinkling magnetic filings on the magnetic layer.
This happened to me a couple of times when the turnstile readers mis-read the card, and an attendant checked it in this manner.
Track visualizing is still used today at card manufacturing plants. They put a drop of magnetic fluid on the magnetic stripe, which makes tracks and bits visible, then run a piece of regular clear scotch tape over it, the image sticks to it, peel the tape off and stick it to a paper sheet with notes , and it becomes a document.

Edit: This is typically done for troubleshooting of the encoding equipment, such as tracks alignment, malfunction of the encoding heads and stuff. This is not done to read the information.
« Last Edit: December 24, 2022, 10:05:46 pm by Bud »
Facebook-free life and Rigol-free shack.
 
The following users thanked this post: RoGeorge

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11166
  • Country: us
  • Retired, now restoring antique test equipment
The early magnetic cards used on the Illinois Central commuter line in Chicago in the 1970s could be read by sprinkling magnetic filings on the magnetic layer.
This happened to me a couple of times when the turnstile readers mis-read the card, and an attendant checked it in this manner.
Track visualizing is still used today at card manufacturing plants. They put a drop of magnetic fluid on the magnetic stripe, which makes tracks and bits visible, then run a piece of regular clear scotch tape over it, the image sticks to it, peel the tape off and stick it to a paper sheet with notes , and it becomes a document.

Edit: This is typically done for troubleshooting of the encoding equipment, such as tracks alignment, malfunction of the encoding heads and stuff. This is not done to read the information.

Apparently, the bit density on these old I.C. cards (wallet size cards) was rather low:  the data pattern was obvious to the attendant without magnification.
 

Offline bw2341

  • Regular Contributor
  • *
  • Posts: 181
  • Country: ca
https://www.bbc.co.uk/programmes/m001f1td

Mathematician (and science popularizer) Hannah Fry has a current show about technology. In this episode, she works through the development of the bank card, including a visit to a card production plant. I think there was the use of visualizer on the magnetic stripe in one scene.

They also cover the development of smartcard and contactless.

Unfortunately, this is a UK only link. I watched it via... other means.
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4671
  • Country: nl
However, the mechanical moving parts and heads alignment seems daunting for a quick and dirty DIY project.  :-//

1. Lay the card flat on your desk.
2. Put something straight over it with an offset to the side (to adjust for the reading head width).
3. Move the magnetic head along the ruler.

And of course you can also make something more elaborate and make it look like a hand operated card reader.From some pieces of wood to a 3D printer, whatever material and tools you have available.

But the electronics and software is more challenging and interesting.
First pre-conditioning the signal and put it through a schmitt trigger. Then software to account for timing variations and extract binary data from the info. It looks like some frequency modulation scheme with two different frequencies.
« Last Edit: December 26, 2022, 09:43:56 pm by Doctorandus_P »
 

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 7891
  • Country: ro
I did try by hand and it's not very reliable.  Keeping some pressure and keeping the perpendicularity while swiping at a speed is tricky in practice.

Those subway tickets are printed on cardboard thin enough to be rolled around a wheel (e.g. scotch tape it around the wheel of an RC toy car).  A continuous read would help detecting the position of each magnetic track.

For maximum cool factor, could be the swipe heads mechanism from an inkjet printer going back and forth instead of a wheel.  An inkjet printer would work without bending the card.

The electronic part could miss entirely, with the cassette head tied to the microphone in or to the line-in of a soundcard, then record the analog signal.

For software, it would need a peak detection algorithm to make it look digital.  A peak up will become a raising edge of a square signal, a peak down would become the falling edge.  Some encodings seen online were having duration encoding, one type of bit being double the duration of the other type.

Most common magnetic cards have 3 tracks, with the one in the middle at a lower density of bits but I suspect these subway tickets might have only one track, though not sure about that.  I didn't try investigating any further, because I see no real use for a magnetic reader.

There are a few online examples of making a reader and how to decode the pulses.  Microchip even has a POS devboard with code examples for their MCU.
https://www.edn.com/design-a-cost-effective-magnetic-card-reader/
https://www.microchip.com/en-us/development-tool/mPOSDemo


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf