Remaking MSR206 RS232 magnetic card reader to USB

As you might have noticed, sometimes I work as freelancer in electronics =) It applies not only to fixing PC electronics and mobile phones, but also to repairing, modifying and designing my own solutions in consumer electronics. One of the projects I worked on yesterday is modifying MSR-206 magnetic card reader to replace RS232 port with USB. Let me tell you about that…

IMG_0830

This was of high urgency, so I’ve had to suspend my usual work activities and concentrate on this project yesterday. MSR-206 is a pretty impressive piece of technology, incomparable to those cheap eBay magnetic card readers. It even includes 24V 2.2A DC power supply, which is quite heavy and makes you question those cheap USB 2.5W card readers – like, are they really OK for most applications when somebody released such a powerful thing just to accomplish the same task? It’s also kind of state-of-art inside… Well, maybe it’s just me being used to see a lot of disassembled Chinese stuff =)
Unfortunately, it also is quite old – it has only RS232 port in 8P8C (Ethernet cable) form-factor, not to mention non-standard wiring. My acquaintance working as the IT guy in one hotel had to replace the receptionist PC with a newer one. He didn’t think of need of having a COM port, though. Also, the original COM-8P8C cable was lost, and, of course, cheap COM-8P8C cable for connecting to network equipment didn’t work. So – there’s a hotel that needs their equipment to be in working state ASAP…Which meant replacing RS232 with USB. RS232… I instantly sensed MAX232 chip inside.

So – I disassembled this card reader. Looks great, doesn’t it?

IMG_0831

OK, the top part doesn’t mean much to us. Let’s pull out the PCB:

IMG_0833

On the left side, you can see something related to a power supply. Logic runs on 5V anyway – so I’m not supposed to look closer and examine =)

IMG_0836

L293D? OK, maybe there is a motor or some kind of motor-like thing inside =) Wasn’t exactly my job to figure it out.. 3 of them is something, though. I also didn’t want to see what’s the chip with a sticker on top – must be a MCU, and I knew it didn’t matter to me because I wouldn’t understand it anyway =) Those old MCUs are a PITA when you have to somehow change contents of the ROM or something like that.

IMG_0837

Some kind of logic elements… OK, that’s not what I’m searching for. Let’s see the bottom side of PCB.

IMG_0838

A lone transistor/regulator… Doesn’t matter much.

IMG_0840

Some more logic elements, I guess I’ll have to examine them in case somebody got high and implemented UART-RS232 using buffered logic gates.

IMG_0841

Woohoo! The object of my search. As you know, MAX232 has 2 RS232->TTL (R-T) elements and 2 TTL->RS232 (T-R) elements inside. One pair of R-T&T-R is RX and TX. Other pair is usually unused… Usually. Let’s desolder the chip to see what’s actually used…
IMG_0843
Sorry, sticker, you just were at the wrong place at the wrong time.
IMG_0844
Oh. All 4 elements are used. That’d mean trial and error =( That’s the moment when I realised that I should give Google a try. What I’ve got? A programmer’s manual! Pinouts, commands and so on! Excellent!

First of all, manual doesn’t mention 2 of 4 lines coming from MAX232 to the 8P8C connector. I guess they aren’t that significant then. Other two lines are TX and RX and wiring for MAX232 is exactly the same as on this circuit diagram:

So I soldered 3 wires to GND, TTL RX and TTL TX. What you’d need a chip for then you can interface USB to TTL directly? That’s when a USB-UART converter appears on the stage.
IMG_0850
It’s based on ARK3116 chip, which works on Linux and Windows. I guess now it’s time to say – what a shame that Windows drivers aren’t open-source! This chip works with both x32 and x64 Linux versions, but doesn’t work with Windows x64 – exactly the OS that hotel uses. They’ve installed x32 OS on reception, though – PC wasn’t configured yet and it wasn’t that hard. This board is so small because it was inside of a mobile phone interfacing cable.

So – I soldered headers to the cable that carried TTL signals (the one I soldered instead of MA232). First, I’ve tested them using a FTDI breakout board – it was guaranteed to work good. You know, I’vehad some problems with USB-UART converters in the past =) I issued a command that turns all 3 indicator LEDs on the board… It didn’t work. I swapped TX and RX and – voila!

IMG_0848
Photo (sorry, not screenshot) of my monitor – programmer’s manual on the left side, cutecom terminal on another:
IMG_0849
BTW, Cutecom is a great serial terminal with a GUI =)
Now it’s time for ARK3116 with a USB-B socket soldered to it. That’s when things went wrong – I had wiring problems, soldering problems, adapter problems, software problems and so on. After an hour or so, it finally was OK:
IMG_0851IMG_0852


“[ 587.976696] usb 6-2: ark3116: don’t know how to do software flow control

Sorry, converter, neither do I.

It worked… The only problem was that case wouldn’t close. Turned out that I needed to reposition the converter somewhere else. Like this:
IMG_0853
Cover with a bit of masking tape:
IMG_0854IMG_0857
*puts sunglasses on* Case closed. Now testing with original Windows-only card reading/writing software:
IMG_0858
Woohoo! Ready to be given back to the hotel.

IMG_0855

One more thing for my portfolio in freelance electronics 😉 That sure was fun to make and I hope that’ll inspire somebody. Now – back to writing software for my Arduino payphone project.
BTW, my part-time job now is software testing. It seems that the job changes me already – I’ve found a bug in Tetris:

IMG_0859

tetris-bsd from bsdgames package

Advertisements

17 thoughts on “Remaking MSR206 RS232 magnetic card reader to USB

  1. Pingback: Hackaday Links: October 5th, 2014

  2. Pingback: Hackaday Links: October 5th, 2014 - Tech key | Techzone | Tech data

  3. Pingback: Hackaday Links: October 5th, 2014 | Ad Pub

  4. Pingback: Hackaday Links: October 5th, 2014 | Hack The Planet

    1. CRImier Post author

      Yes, of course. As you can see, communication is still two-way, communication protocol is still the same – I didn’t change the nature of communication, only modified the physical layer a bit =) If you were to modify in the same way the another card reader that didn’t have the opportunity to write cards, that’d be a different story, though.

      Reply
  5. Alex Arteaga

    Interesting article. BTW, the manufacturer sells a USB cable for this MSR206, actually it’s a USB to Serial adapter which is powered from the USB port, the adapter is included within the cable within 2-4 inches of the ethernet plug in what it seems to be a “ferrite bead” (but is not), this cable works with newer and older MSR206’s encoders. They also sell the Serial and USB cables (usb straight thru cable). Newer MSR206 encoders have both interfaces built-in in the PCB board and all the signals are available at the ethernet plug.
    I believe the firmware is in that chip in the PLCC socket, the one with the sticker on.
    What’s the use of this encoder in the hotel? Is it being used to encode the key cards? I’m trying to replace a couple of expensive hotel key card encoders with MSR206 encoders, seems to be easier to “translate” the proprietary protocol back and forth to the MSR206, to do it in software instead of firmware.

    Reply
    1. CRImier Post author

      Yeah, I’ve seen something about those cables existing – they would’ve just bought them if it weren’t so urgent 😉 They used this reader for the VIP client and bonus cards. This wasn’t door keycard reader/writer – that’d be even more urgent =)
      Unfortunately, that’s what gradually happens with proprietary things – it’s more wok for us technicians when it comes to upgrading/repairs. As for me, that’d be an interesting Arduino project =D At least you have MSR206 user manual! BTW, if you do something like that, I’m sure I and many other people would love to hear about that. That sounds like a cool reverse engineering project or at least nice example of yet another Arduino use =)

      Reply
      1. Alex Arteaga

        I did something similar to what you did, but it my case it was easier, had an original non-functioning USB-Serial adapter, checked the chips on the msr206 pcb board and found that internally it had another usb-serial adapter, so I just removed the adapter of the original cable and wired the USB cable directly through to the ethernet plug according to the signals I traced to the ethernet jack. I believe the usb-serial adapter acts as an isolation layer between the encoder and the computer too, the encoder had another problem and it killed one of my laptops during the tests, previously it did the same to the customer’s computer.

  6. Ian

    Hi, Thanks for the interesting article. I wonder if you (or anyone else) could post the pin-out for the original RS232 signals on the RJ45 socket on the MSR206 please? The manual only shows the DB9 pin-out and I don’t have an original cable! I need to make an external adapter. Thank you.

    Reply
    1. CRImier Post author

      Hm… That’s a difficult question. I suspect it’s wired the same on Ethernet jack – at least pin 1 or what can be thought of as pin 1 is actually wired to shield connection. https://crimier.files.wordpress.com/2014/09/img_0844.jpg – it’s the rightmost pin of where the Ethernet jack was. If I remember it correctly, pins 2 and 3 also had traces from MAX232 chip to them =)
      I think you should check whether pins 2 and 3 are really RXD and TXD (according to the manual). I strongly suspect that’s the case. If not – desolder the Ethernet jack or just trace signals from chip – it’s wired as on this diagram: http://sodoityourself.com/wp-content/uploads/2007/02/circuit_232.jpg

      Good luck with your project!

      Reply
    2. Alex Arteaga

      It will be better if you double check this information. I currently don’t have a MSR206, but this is from the notes I took. Depending on how old/new is your msr206 you may be able to wire a usb cable to it, the one I had featured a usb and serial interface on the same ethernet connector. Test this on an old computer if possible.

      RJ45 / Signal
      ————-
      Pin 1 / Shield?
      Pin 2 / RS232-Input (SP3220EC, Pin 8) – Rx***
      Pin 3 / RS232-Output (SP3220EC, Pin 13) – Tx***
      *
      Pin 5 / GND
      Pin 6 / USB, +5Vcc ??? << leave disconnected!!
      Pin 7 / USB, DM-
      Pin 8 / USB, DP+

      ***Rx on the msr206 should be connected to Tx on the cable comming from the PC, then Tx (msr206) to Rx (PC).

      Good luck!!

      Reply
  7. Kevin

    Great article. I know its old, but I have been tasked with writing some code that will encode and write magnetic stripe cards. Looking for source examples. I’ve been tasked with doing this from a Raspberry pi 3. The target language is Java atm, but I can translate from whatever language sample code may be written in. Thanks in advance.

    Reply
    1. CRImier Post author

      Hi! Unfortunately, I have no code examples, but the datasheet should be accessible enough to be able to write something from scratch, no? It’s more or less a simple serial protocol, the commands and responses IIRC aren’t ASCII but I think it makes it even simpler in a way =)

      Reply
  8. Max Hayman

    Hi CRImier,

    I recently acquired one of these but it was missing the serial cable. Do you know the wiring layout for the DB9 RJ45 cable? It would be a great help.

    (I would do the USB mod but I dont have enough time)

    Thanks,
    Max

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s