I bought this reader http://www.adafruit.com/products/853
I use Arduino Uno and Mega with the library and the Simple_Test sketch from PS2Keyboard.zip located at http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html
I use a credit card gift card and an AAA membership card for testing.
Result:
After swiping these cards many times and after many "unrecognizable" outputs, the Arduino IDE serial monitor finally showed the information I can recognize (e.g. my name, card number, etc.), but only once. I tried many times again, I am unable to get the correct outputs anymore. Also, I tried swiping the card from either end of the reader with varying speed, and each time I tried, the output is different.
During the repeat testing, I didn't change the wiring. Please let me know what I am doing wrong. Thanks.
Magstripe Reader - 3 Tracks
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Magstripe Reader - 3 Tracks
Can you post a photo showing all your connections?
- lzemail
- Posts: 52
- Joined: Tue May 29, 2012 5:00 pm
Re: Magstripe Reader - 3 Tracks
Notes for the attached photo: red (+5v), black(Ground),yellow(Clock) and blue(Data)
It is working now -- the outputs are recognizable now (e.g. card number, my name, etc.). Not knowing another other things to try, I tried with an external power supply (instead of using the USB from the computer) because I suspect it might not have enough power from the USB port. After applying the external power, I reset the Mega, swiped the cards, and it worked. I don't know if this is the only solution. Please let me know if you think I might be doing something else wrong, or there might be another way to fix this without the external power. Thanks.
It is working now -- the outputs are recognizable now (e.g. card number, my name, etc.). Not knowing another other things to try, I tried with an external power supply (instead of using the USB from the computer) because I suspect it might not have enough power from the USB port. After applying the external power, I reset the Mega, swiped the cards, and it worked. I don't know if this is the only solution. Please let me know if you think I might be doing something else wrong, or there might be another way to fix this without the external power. Thanks.
- Attachments
-
- magstripe_reader_connection.jpg (538.03 KiB) Viewed 688 times
- lzemail
- Posts: 52
- Joined: Tue May 29, 2012 5:00 pm
Re: Magstripe Reader - 3 Tracks
After I posted it is working, now it stopped working again -- no changes made, and I get those random letters/numbers/symbols again. Maybe there is more to it other than (or in addition to) the external power supply. Ideas? Thanks.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Magstripe Reader - 3 Tracks
Intermittent behavior like that usually comes down to a bad connection somewhere. It looks like you are using good quality jumpers with pin connections on the end. How are they attached to the PS-2 connectors?
- lzemail
- Posts: 52
- Joined: Tue May 29, 2012 5:00 pm
Re: Magstripe Reader - 3 Tracks
The data and clock: the reader PS/2 male end -- female-to-male jumper wires -- Mega
The +5V and Ground: the reader PS/2 female end -- male-to-male jumper wires -- Mega
Why are both ends of the reader PS/2 pins not the same, i.e. data and clock pins are only available on one end of the reader PS/2 connector? I guess it's for a "pass-thru" keyboard? Is there a schematic available for the PS/2 connectors wiring of this reader?
Anyway, I just tried again, and it is working now. I'll double check my wiring again to see if I can get a consistent outputs. Thanks.
The +5V and Ground: the reader PS/2 female end -- male-to-male jumper wires -- Mega
Why are both ends of the reader PS/2 pins not the same, i.e. data and clock pins are only available on one end of the reader PS/2 connector? I guess it's for a "pass-thru" keyboard? Is there a schematic available for the PS/2 connectors wiring of this reader?
Anyway, I just tried again, and it is working now. I'll double check my wiring again to see if I can get a consistent outputs. Thanks.
- lzemail
- Posts: 52
- Joined: Tue May 29, 2012 5:00 pm
Re: Magstripe Reader - 3 Tracks
I just want to report back the result: I double checked the wiring and made sure they all have solid connections, the reader is working, and I can get consistent correct outputs now. So, it looks like the bad connection is the problem as you pointed out. Thanks for the help.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Magstripe Reader - 3 Tracks
No problem. Thanks for following up!
- lanref83
- Posts: 9
- Joined: Fri Dec 05, 2014 5:25 am
Re: Magstripe Reader - 3 Tracks
Hi,
Please do you mind posting a sketch for this project? im currently trying to read data off cards using an UNO
Thanks!
Please do you mind posting a sketch for this project? im currently trying to read data off cards using an UNO
Thanks!
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Magstripe Reader - 3 Tracks
@lanref83 How do you have your reader connected and what sketch are you running to read it?
Please be positive and constructive with your questions and comments.