Sparkfun: Magnetic Stripe Reader (SEN-11096)

Hello All,

Has anyone tried this Reader with the BS2 family. How well did it work and how simple was the BS2 code? It seems simple enough once you get pass the wiring gyration.

Thanks for any feedback


  • 16 Comments sorted by Date Added Votes
  • Hello All,

    Got the Mag. Readers in and the both work with the Terminal program that Sparkfun suggested. Read every card in the house here that I could find.
    My connection through the BOE is correct 5v/gnd ( common) to the DB9 and the PS2 connection. Things started out real slow and got worse from their. May have killed two BS2 & e modules along the way. Once I had the 9600/8N1 set up in the 5 line program from the HELP file all seemed well. But I could only read some of the DATA, ALL the time. I bounced back and forth between the terminal program and all was find. This is dragging out way to long. Could never pull in ALL the data across the back of any card. Tried the Command to (SPSTR L) to put data up to 126 bytes in the SPRAM but could not get it to work also.

    Whats the secret of getting reliable RS232 data with the BS2 modules?
    1) program from the Help file (5 lines)
    2) 22k ohm in line from the Reader to the BS2
    3) ONLY two line from the BOE to the READER because its a known Baud rate (???)

    Thanks for any insight
  • Hello All,

    Need Help with RS232. Redid all connections to ensure they are correct, and they are. Went thru the 5/6 actual lines of code again, again, and again. Don't know if I need more code or more Hardware. Not reading the back of my Gift/credit/ Driver License cards.

    Magnetic reader:
    Baud :9600, Data: 8 Bit, Parity:none , Stop: 1, Flow Control: None
    ' {$STAMP BS2e}
    ' {$pbasic 2.5}
     DEBUG CLS, "Hello Scanner",CR
      sdata   VAR Byte
     SERIN 1, 16468,Bad_Data,[SDATA]
     DEBUG  ? sdata
     GOTO main
     GOTO Main
  • Hello All,
    Here is a picture of the setup.
    PS2: Pin 4 5v from BOE
    PS2: Pin 3 GND from BOE

    DB9: Pin 3 Transmit from MAG. READER
    DB9: Pin 5 GND from BOE
    3405 x 2554 - 2M
  • It may just be me, but in the photo it appears that the wires that go into the DB-9 breakout are clipped somehow, as is the power cord. It's as if the photo got corrupted somehow. Why are there wires in both the DB-9 breakout and the PS/2 connector?
    Chris Savage - Savage///Circuits
    eBay Goodies - Savage///Circuits on eBay
  • Hello Chris,
    Thanks for the reply.
    The PS2 is were the Reader gets the power (5v & gnd), the DB9 (Pin 3 is tx & Pin 5 gnd). I just got the breakout so I could check the signal coming from the Reader and it did not have Pin 3 connected, so i put a bridge from pin two(2) to fix that and still no luck. But the case of the breakout was not grounded so I added that and now (I think that fixed that erratic Data problem) I'm receiving consistent/repeatable data. But ONLY 26 bytes. I need to be able to read all the Data (74 Bytes). Nothing I've read will allow me to do that with a 'STRING'.
    I saw a Command for storing 126 bytes, but that's when I switch to the BS2 48 pin. I'm trying to learn with the BOE and then move up.

    1) How can I READ/SAVE past the current 26 byte limit?
    2) Pars along the way of reading or when all is read?

    I've tried saving the first 26 bytes to another "VAR", but the first "VAR" just resets and I end up with two(2) of the same 'STRING'.

    Thanks for any help

  • To get past the 26 byte limit, you need to use SPSTR formatter (meaning you need a BS-2p, at least)
    Cannot parse along the way (other than maybe WAIT or WAITSTR)
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • It still looks like power is going into the DB-9 as well, which doesn't seem right.
    Chris Savage - Savage///Circuits
    eBay Goodies - Savage///Circuits on eBay
  • Now that I did a ZOOM on the picture, I see that it was (Split) when I had to do the compression to fit for the upload (1.9mgb now). Microsoft 3D paint program.
    But I am reading data now. I do have the BS2p 48 OEM working so I may be able to jumper into it for the Reader. I will try the (wait/waitstr) again now that I've got it running.

    Been out for the last 3 hours, will try now.

    Thanks Chris & tomcrawford

    just tested again, still working.......(26 bytes). so sad

    Thanks again
  • Hey Chris,
    I'm confused, how can any real work get done if it can only Read 26 Bytes of data. I know there has to be some other tricks of stashing Serial Data as it comes in.

    I printed out the Serin/Serout and will read through again.
    But that thought just came into my head.

    PS: Just learning of course and don't know how large packets are or length of streams of Serial data.
  • As Tom mentioned, this is one of those rare cases where you need a different model BASIC Stamp 2. It's not that the BASIC Stamp 2 is lacking, it's just that a few applications use long strings which aren't necessarily typical in older industrial control systems. 26 bytes may not seem like much, but I once saw several people post a reply to someone trying to log data from a GPS and they said it wasn't possible. I took that as, "Challenge Accepted!" Parallax even had a kit based on my design once:

    That said, in your case I would probably recommend the BS2p or BS2pe if you're planning on storing a bunch of data.
    Chris Savage - Savage///Circuits
    eBay Goodies - Savage///Circuits on eBay
  • Per the input from the person who ask if I could do this, the Data will only be viewed for the moment, not stored. The piece of Data that I need starts at byte 59 of a 74 byte stream.
    Once I'm solid with these early steps, I will patch into my current PBASIC 48 pin and use the (SPSTR \L) to put the Data in EEPROM RAM and pars (GET) from their.
    I did download some gps code already for further review/studying to learn from. I just tried some things with (WAITSTR "=") and its just to far in the String (byte 59) to read.

    Thanks for speeding up my learning curve. If you think of anything else please please please let me know. THANKS.

    will try some more commands to make sure I understand how they work

    Thanks again
  • Hello All,
    update: Got the Reader detected on my BS2p 48 pin OEM.. That was to easy. Anyway, erratic Data again, so I'll have to make sure all connections are solid, but now I should be able to try the long String commands.

  • Note that the baud mode will be different between a BS-2 and a BS-2p.
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Hello All,
    Well pump the brakes.
    Had to rebuild the patch work by taking out some connections and still not working. That was at 1 am, now trying again and still not working. Had some data before, now its just those (yyyyyy) with 2 dots over top. Went through all the baud rates. Will move back to the BOE to try and figure out were I went wrong.

  • done for the night....nothing but (yyyyy's w/2 dots on top)

  • That really sounds like a baud rate issue. Be sure you're using inverted if you're coming from an RS-232 port through a resistor.
    Chris Savage - Savage///Circuits
    eBay Goodies - Savage///Circuits on eBay
Sign In or Register to comment.