Tag Archives: project

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

Payphone project – screen problem solved & parts arriving

I’ve got some updates for the payphone project. First of all, a photo of the actual payphone I’m modifying. It’s a GPT Sapphire payphone, and there were a lot of payphones like this in Latvia just some years before. Now there are no payphones like this on the streets =(

Now, something about the HD44780 screen. First, this screen compared with the cheapest chinese HD44780-compatible screen:
IMG_0817

As you can see, they differ not only in sizes, but also that the header is not at the right place. What a shame =(

As I’ve told you, I’ve ordered replacement comtroller ICs for the display. They’ve arrived:
IMG_0746
A closeup shot:
IMG_0757
So – I’ve desoldered original ICs and soldered the new ones on the board.

IMG_0750IMG_0751IMG_0755IMG_0753IMG_0754IMG_0762

Still didn’t work! Why? Amused, I connected the display to the payphone… Only to see it working.

IMG_0792

What was it? I’ve had a guess, and I guessed it right.

IMG_0793

Seems that my HD44780 screen needs negative contrast voltage in order to display something. Couldn’t have known that earlier – there isn’t much information on this on the Web, and I can see why – it’s an extended temperature range screen, they aren’t that popular. I’ll need to make a negative charge pump in order to power it… BTW, would be a nice idea to see just how much current it needs on the contrast line – to understand which charge pump is needed. If it’s under 0,5 A, I can use a well-known 7660 IC. If not, well, that’s sad – that’d mean I’d need somebody to help.

Some info about this phenomena:
First clue I’ve found that helped me understand;
Actual screen modification that provides some info on how and why;
Just a bunch of photos of different displays =)

Also, I’ve received DTMF generators (datasheet) and decoders (datasheet)… But I haven’t got the crystals for them yet – they’re to arrive soon =( I’ve made breakout boards for both, but, as you can see, they lack some passive components and crystals.
IMG_0818IMG_0818

(Left – a ready board, center – DTMF decoder board w/o crystal and passive elements, right – DTMF generator board w/o crystal)
In order to understand my breakout circuit, just look at the datasheets, there’s a section with a sample usage. The breakout board with a crystal and IC is MT8870 DTMF decoder board – it’s basically the same IC, just older and from another manufacturer, but pinout and circuit are the same. I’ve made this board around 3-4 years before =) That might be one of the reasons it doesn’t work so well – my soldering wasn’t so good back then.
I also plan on making breakouts in Eagle CAD, just after I test these hand-made boards. I’ll share them here – along with some more useful breakouts I hope I’ll finally get an opportunity to test.

I’ve received a I2C-to-HD44780 interface converter, or, as they’re called, I2C LCD backpack.

IMG_0816

It’s also a Chinese version – so it’s not amusing it doesn’t work with the popular I2C LCD backpack Arduino libraries. Why? Seems that pin mapping between I2C-GPIO IC that’s on the backpack board and LCD header on the same board just isn’t the same as in popular versions of this kind of backpack. We’re left to guess just why they’d manufacture a backpack like that, yet it isn’t the prettiest thing to do. At least they’ve supplied Arduino libraries and example code… Which doesn’t compile in my Arduino IDE, and I don’t even want to know why ’cause I sure don’t want to translate code comments from Chinese. I suppose modifying some library that is already working just to have the bits of data sent in different order won’t be any hard. Also, it has a backlight control pin connected to the I2C-GPIO chip, so that’s a bonus =)

I plan on doing the next update when I’ll receive crystals and complete my breakout boards. I’ll probably have Eagle-made breakout boards and libraries for DTMF chips to share by then, too =) Not to forget Arduino libraries.