Reading credit cards with a tape head

A company called Square is giving out free credit card readers that turn any iPhone or iPad into a Point of Sale terminal. [Steve] got a hold of one of these tiny peripherals and did what any sane person would do: tear it apart and learn how it works. This bit of hardware is a little unimpressive; unsurprising because Square is giving them away. With simplicity comes an ease in understanding, and [Steve] was able to successfully read his own credit card with this tiny and free credit card reader.

[Steve]’s work in decoding credit card data builds off [Count Zero]’s article from the bbs days. Basically, each credit card has two or three tracks. Track three is mostly unused, whereas track one contains the card holder name, account number, cvc code and other ancillary data. Track two only contains the credit card number and expiration date.

The only components in the Square card reader are a head from a tape player and a 1/8″ microphone jack. The magnetic head in the Square card reader is positioned to only read track two. With a small shim, it’s possible to re-align the head to get the data from track one. After recording an audio file of him sliding his card though the Square reader, [Steve] looked at the number of times the waveform flipped from positive to negative. From this, he was able to get the 1s and 0s on the card and converted them to alphanumeric using the 6-bit ANSI/ISO alpha format.

[Steve] isn’t going to share the code he wrote for Android just yet, but it should be relatively easy to replicate his work with the Android tutorial he used. Also, yes, we did just pose the question of how these Square credit card readers work just hours ago. Good job being on the ball, [Steve]. Tips ‘o the hat go out to [Bobby], [Leif], [Derek] and anyone else we might have missed.

EDIT: [Stephen] sent in his teardown minutes after this post went live. Hackaday readers are too fast at this stuff.

Building a magnetic rotary encoder

[Long Haired Hacker] has undertaken a high-resolution 3D printer build. He got his hands on some motors to drive the build platform but it doesn’t have a built-in encoder. He knows that optical encoder wheels can have problems due to dirt and grim as well as ambient light so he set out to find a better way of providing feedback to the controller. He ended up building his own magnetic rotary encoder which is shown above.

At the heart of the system is an AS5043 magnetic rotary sensor. The chip, which runs from $6.50-$11, can detect and report the rotation of a magnetic field with great precision. The rotation data can be read out in degrees using SPI, but it sounds like there’s also grey code output on a few pins if that suits your needs a bit better. The magnet which the chip measures is mounted in a sleeve milled to seat inside of a bearing ring.

The 3D printing method [Long Haired Hacker] has chosen uses a projector and light-cured resin to achieve the kind of results seen in this other hi-res printer.