0

Please click the following link and see the image of the rfid reader which I brought recently

http://i62.tinypic.com/2vlnqtt.jpg

And I need help to assemble this with Arduino mega 2560. How to wire this RFID reader with Arduino mega 2560, and then how to get the input (swiped RFID tag number) to the Java program?

My Arduino mega 2560 is connected to my pc via com5.

halfer
  • 19,824
  • 17
  • 99
  • 186
sham999
  • 121
  • 1
  • 3
  • 12
  • Please someone answer this http://stackoverflow.com/questions/22543867/arduino-and-java-help-needed – sham999 Mar 20 '14 at 20:04

1 Answers1

1

The description of the HZ-1050 EM Module ID Card Reader states:

  • Serial UART output at TTL level
  • Power: 3.3 to 5V

By taking a short look at your picture, I would say you connect the module to a 3.3V or 5V source - best would be the source of your Arduino - and connect the TXD output to one of the UART inputs of your Arduino board (you should have 4 ports and only one is occupied by the PC). Check the voltage of your UART levels to have either both working at 3.3V or both at 5V. In your program, forward the byte stream (coming from the reader module) to your host PC (via COM5).

pizzaani
  • 332
  • 1
  • 9
  • Im using Arduino mega 2560 Anyway I connected the rfid reader and Arduino with a friend's help like shown below Rfid reader - Arduino Mega 2560 +5v - 5V GND - GND TXD - RX1 19 Then i uploaded the following code to Arduino <<< void setup() { Serial.begin(9600); Serial1.begin(9600); pinMode(13, OUTPUT); } void loop() { // read from port 1, send to port 0: if (Serial1.available()) { int i = Serial1.read(); Serial.println(i); } } >>>> – sham999 Mar 17 '14 at 19:08
  • when swiping the rfid tags, values are shown in serial monitor as below 0 45 230 35 Why is this coming like this with new lines? Im asking this because in my serial port reading java program. values come in that way in 4 lines.. so then how can I match them with my sql database in the java program and do my needed things? please help me.. Is there any way to get the tag numbers to one line and get that to a String in java – sham999 Mar 17 '14 at 19:13
  • If the tag's IDs are always 4 bytes long, you can just remove the newline characters (e.g., \n\r) from that string and forward it to your host PC. Maybe you just replace \n and \r by a space or semicolon. – pizzaani Mar 19 '14 at 08:59