Building a reliable magnetic card reader (Part 2 of 2)

(Part 1 of this article is here; it begins with a magnetic card waveform primer, and then discusses automatic gain control, peak detection including comparator-based peak detection, sample and hold circuits, and using the ADC for peak detection)

Preventing false readings due to noise
Due to the shape of the magnetic card waveform, a comparator- or differentiator-based peak detector can be susceptible to false readings. During each peak, the waveform is changing quickly, which allows the delay imposed on the waveform to create appropriate separation for the comparator to detect the peaks.

However, during the transition between each peak, the waveform changes more slowly, which means very little voltage separation is created between the waveforms. Any noise during this period can cause the comparator to trip and cause an erroneous reading. This noise can (and should) be reduced by proper board layout, bypass capacitor selection, using a low-noise power supply and PGAs, and related techniques; but all noise cannot be completely eliminated.

There are other application-level techniques that can be used to help prevent erroneous readings in the system despite the noise that is present. One technique is to add hysteresis to the comparators. Hysteresis will reduce the likelihood that small noise spikes will cause the comparator to trip. Transitions at the peaks of the waveform will exceed the hysteretic threshold and will still allow the peaks to be detected accurately.

Another useful and effective technique is to employ the use of a window comparator for each channel. The thresholds for the window comparator can be set so the waveform is only checked for peaks when the waveform protrudes outside the set positive and negative thresholds. This prevents any false detection when the waveform is slowly transitioning between peaks.

This method is illustrated in Figure 4 . For an ADC-based peak detector, this method provides an additional bonus because the ADC does not need to sample the waveform while it is inside the window – which reduces the load on the ADC and CPU.

Figure 4: Windowed comparator
(Click on image to enlarge)

A SoC can be a good option for implementing the magnetic card reading methods and techniques discussed in this article if it has all the required resources to implement any of these solutions on a single chip with very few external components. Table 1 summarizes a range of available resources and the function each resource can fulfill in implementing a multi-channel magnetic card reader that provides accurate performance across a variety of different environments and card swipe speeds.

Table 1: This table shows a range of available resources in SoC devices, in this case the PSoC 5 from Cypress, and the functions each resource can serve in implementing a multi-channel magnetic card reader.
(Click on image to enlarge)

About the author
Dan Sweet is a PSoC Applications Engineer at Cypress Semiconductor Corp. He graduated from Western Washington University with a BS in Electrical Engineering Technology.

1 comment on “Building a reliable magnetic card reader (Part 2 of 2)

  1. oioidjvosij
    April 17, 2014

    To find a good printer in Canada. I would suggest using the following companies: Toronto Printing Companies | Calgary Printing Companies | Winnipeg Printing Companies | Montreal Printing Companies | Regina Printing Companies | Saskatoon Printing Companies | Quebec Printing Companies | Ottawa Printing Companies | Edmonton Printing Companies | Vancouver Printing Companies | These companies provide the best and most affordable price in whole Canada. Other printing companies I suggest would be Print Quote Services | Printing Company | Best Local Printer | Some other local cities have great printers as well such as the following: Philadelphia Printing | Memphis Printing | San Francisco Printing

    If you are looking to print custom stickers. The following is my best choice: Label and sticker printing | Print Custom Sticker | Print Stickers | No only they offer the best sticker printing quality but also unbeatable price.

    Nowadays, it is hard to find quality print trader. This is my recommendation for best print trader in the united states Best Print Trader | Lowest Price Printing Wholesale | Print Outsourcing | Print Broker Trade

    Lastly, all print should comes with a state of the art Print Management Software. I would highly recommend this print software tool.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.