Magnetic reader

Hi there, I'm working on a project where I have to read a magnetic stripe like the ones on credit cards, i have a magnetic-head like this one, https://www.cardreaderfactory.com/support/index.php?/Knowledgebase/Article/View/15/1/magnetic-read-head-connections
The thing is that I'm unable to get any signal at all, currently I've connected the Track 3 pin to an amplifier and the output to the pin A0 on the arduino, I'm connecting the "head common" pin to ground, and I'm printing in the serial monitor the value on the pin A0, however it remains 0 ... any ideas on what I'm doing wrong, I've read on the forums something about using the ADC for this, can you guys explain a little about this, if this is the case?? =O

Thank you very much in advance!!

chuck

The signal out of a magnetic read head is tiny, much smaller than you need to make any impact on the A/D converter on an arduino.
You need an amplifier in order to boost the signal to a suitable level. Google for - magnetic card reader schematics

This is a typical one:-

Hey thanks for the answer, although I think you upload an image I'm unable to see it =S ... and also another question, should I connect the head common pin to ground???

Many thanks in advance :slight_smile:

although I think you upload an image

Yes I did, I can see it.
The link is:-

Is your ISP blocking Russian web sites, naughty.
If so just google for a schematic.

should I connect the head common pin to ground???

It depends on the circuit of the amplifier.

thanks I'm looking at the schematics now, I found it weird in the amplifier for the +6V supply in the positive terminal of the op-amp, and also in the -input what is the write node?? the 393 if I'm not wrong it's a comparator isn't it with a pull-up resistor at the output, I think I'm interpreting this right
as far as the head common pin I think in this diagram should be connected to the (-)input right? and the track-3 (in my case) to the (+)input, but do you have what kind of signal should I be expecting to get in the arduino?? and can I read it directly in an analog input pin??

Thanks again :slight_smile:

if I'm not wrong it's a comparator isn't it with a pull-up resistor at the output,

Yes that is right.

, but do you have what kind of signal should I be expecting to get in the arduino??

Yes it is a digital signal, because of that comparator. It will output pulses with the data being encoded in the pulse width. So you connect it to a digital input not an analogue one.

Ok thanks a lot, I'm testing it in this moment, I'll let you know :slight_smile:

Hi, I'm able to read the signal now :slight_smile: I'm not using the comparators only the amplifier and I'm reading the signal through the analog input pin in the arduino, however now I want to get the data from that signal, I'm thinking that I need the ADC but how can I do this since the encoding of the data in the magnetic stripe doesn't change in amplitude but in space between the peaks,

any ideas??

thanks a lot

any ideas??

Yes, don't attempt to process the mag head signal via A/D, that way leads only to madness. The mag head signal needs to be conditioned and processed as a digital signal only. Trying to decode the encoding used to generate that signal in the analog domain is just wrong.

Lefty

Use the comparator and feed it into a digital input. Then you can use the pulse in function to measure the width of the signals. That's where the data is.

Ok, first thing tomorrow I'll got for the comparators and try to get the data from the card by this way, I was trying to use an interrupt to "catch" the signal peaks and store 'em in an array to generate the F2F signal.

I'll try with the comparators,

Thanks a lot for all the help

chuckcfs:
Ok, first thing tomorrow I'll got for the comparators and try to get the data from the card by this way, I was trying to use an interrupt to "catch" the signal peaks and store 'em in an array to generate the F2F signal.

Nothing prevents you from using interrupts once the signals (clock and data) has been conditioned and turned into a digital signals. In fact a cardreader project posted here several years ago did just that, the clock pulse wired to a arduino interrupt pin and the data wired to any digital input pin.

Lefty

I'll try with the comparators,

Thanks a lot for all the help

Hi I'm at this moment building the circuit with the comparators, I'm planning in using the interrupt to check when the card is being swiped, as far as the clock signal that lefty mentions I should feed the arduino with, where this signal come from?? the circuit with the comparators uses no clock right?? it just generates the F2F wave from the read head, am I wrong??

Cheers, :slight_smile:

Hey by the way, in the circuit the comparator has a retro to the (-)input, why is this? I've never seen this kind of circuit using a comparator

thanks :slight_smile:

chuckcfs:
Hi I'm at this moment building the circuit with the comparators, I'm planning in using the interrupt to check when the card is being swiped, as far as the clock signal that lefty mentions I should feed the arduino with, where this signal come from?? the circuit with the comparators uses no clock right?? it just generates the F2F wave from the read head, am I wrong??

Cheers, :slight_smile:

My reference to a clock and data signal was in regards to using those cheap surplus credit card readers (I got one for $5) where the analog conditioning and decoding of the low level analog read head signal is done internally and the user is given just TTL level digital output signals including serial data, serial clock, and card detected signals.

As you are taking on this low order conditioning yourself you will have to understand the magnetic encoding method being used before you can decode it properly. There are magnetic encoding methods that include both clock timing information as well as data value information on the single magnetic track and you are tasked with extracting the clock and data information from the composite analog signal. As I have no idea what encoding/decoding method you will be dealing with I can't give any better or more specific information or advice on the subject.

Good luck with your project.

Lefty

thanks a lot for the reply, in this project I've to use a magnetic head, not a pre-built reader so I'll have no clock data but that on the track itself, the encoding that I'll be dealing with (when I'm able to retrieve the F2F signal and the binary from that) is the ABA of the middle track of a credit card, however I've assemble the circuits on this forum and the one of this application note:
http://www.eettaiwan.com/ARTICLES/2001OCT/PDF/2001OCT04_AMD_CT_AN2112.PDF
However with both I'm having problems, the first (the one on this forum) the output changes from 0 to 1 even though I'm not swiping and when I pass the card it does nothing, the second one stays low all the time, and the voltages that I get are not the ones for the stable state presented in the app note, but I've built it three times from scratch with the same result every time
My magnetic head is working 'cause if I swipe it i can see the signal after amplification, however I'm unable to transform that signal to a F2F encoded wave :frowning:

any help??

thanks a lot

comparator has a retro to the (-)input

What does that mean?
The circuits in that PDF had no component parts, so you draw a schematic of what you actually are trying to build with real components.

I've built it three times from scratch with the same result every time

Looks like you keep making the same mistake then.

Hi i meant the comparator of the circuit that was posted here on the topic, it's the second post, as far as for the PDF I know it has no components, but I assemble it with real components and it doesn't work, I don't know what can be wrong since it's just amplifiers and comparators, and i test each of the part separately and all is working it's just that it doesn't give the voltages for the steady state that the pdf shows, and I think that i can wire it fine, so I don't know what can be =S

Of the other circuit that i mention (the one posted here) if you check it the comparator has a wire from the (-) input to the output through a resistance, that's what i call retro and on a comparator I have never seen one (at least that I remember)

Thanks again :slight_smile:

that's what i call retro

Never heard it called that before.

has a wire from the (-) input to the output through a resistance

Yes it is used to control the hysteresis of the comparator.

I know it has no components, but I assemble it with real components and it doesn't work,

Yes that is why I was asking for the schematic of what you are trying to make with real components an part numbers to see if you had made a mistake with the conversion into a real circuit. There could be a problem with the type of op amp you are using, the feedback components or anything, but just saying it doesn't work is not very conducive to trying to find out what is wrong.
Basically it is a digital circuit but made with analogue blocks of that anadigm device. So you could just as easily do it in the digital domain.

I suspect however that you are not even getting a signal out of the first amplifier, do you have a scope you can measure things with?

I've made the schematic and there is the output after i swipe the card:

0
0
8
20
6
11
687
4
14
16
1
6
2
449
667
91
12
642
547
528
179
449
1
2
11
52
485
10
344
3
447
295
7
4
413
14
6
359
477
447
2
280
445
402
476
1
174
325
359
443
406
1
8
1
409
403
3
372
175
251
1
322
8
386
350
296
428
232
419
183
22
400
279
25
322
355
373
347
432
326
1
22
2

is this acurate? and if it is, how can i convert it to binary code?