Sparkfun: Magnetic Stripe Reader (SEN-11096)
hmlittle59
Posts: 404
in BASIC Stamp
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
https://www.sparkfun.com/products/11096
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
https://www.sparkfun.com/products/11096
Comments
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.
BUT.....
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
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
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
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
Cannot parse along the way (other than maybe WAIT or WAITSTR)
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
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.
https://forums.parallax.com/discussion/115791/gps-datalogger-kit-from-chris-savage-s-elektor-article-available-for-purchase
That said, in your case I would probably recommend the BS2p or BS2pe if you're planning on storing a bunch of data.
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
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.
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.
Thanks Chris.
Stopped by Fry's to get a DB9-Male to solder wires onto an plug directly into the Reader. Just to ensure a solid connection.
I'm currently trying to use my own OEM PCB, BS2-P smt that was working before with no problem. All I had to do was connect the Data into MainIO pin 12 at the connector that was going through a 10k smt resistor already.
Chris, how touchy is RS-232 as far as noise/trace width/two (2) jumps from top side to bottom side of a 4 x 3 PCB. Is it very forgiving or does some minimum requirements (need/should) be maintained for best results. My next attempt will be to jumper straight off pin 12 to the resistor to avoid any possible noise problems.
The short HELP File program is the only code running at this time but the lay already had a (DS1302/Battery, Piezo, SSR) close by. Can this have anything to do with it?
Obviously this can save money if I can get this jump started with any of my current OEMs.
Got it solved.
Had to come home from work today and as soon as I had a chance to hook up my O'Scope and look at the Data Sheet/picture (ah again for the 10th time) from Sparkfun, then I realized that I had NO signal from the Reader at all and that the connector in the picture is Male and the connector on the unit is Female.
So when trying to cleanup the initial working connection with a Null modem in-between I built my connection backwards going to my OEM board. It's working now and so is the (SPSTR L) Command for 83 charactors . I'm also able to read back the Data and print to the Debug Terminal Screen.
The "Aerogps4" code has a "String to Value" routine that I will adapt once I Parse some Data out for calculation.
Thanks for the feedback, was dead in the water for awhile there, now seems so simple.
Now: looking for a 3D printer for this and future projects.
Thanks again
Parsing is working from the 'long string'. Now I'm working on the String-to-Value conversion for the calculation. Should be easy with GPS routines.
Thanks again
I'm running into a slight problem. I've been testing my code and increasing the (SPSTR L) value. That's when I noticed, I had to do a double swipe to make a read of my card. I did the half split method until I got to the values of (94-good read with 1 swipe and =>95 and I had to do double swipe for a good read).
I've tried this over and over again with the same results. Was not expecting this so I went back and removed lots of code and added PAUSE code before the (SERIN Read) thinking this could fix it and changed the baud rate, but no luck.
Will try and repeat this again tomorrow.
If anyone has any insight please let me know. Thanks
This is the code that read the Mag. reader.
Thanks again