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.

1

1 Answer 1

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).

Sign up to request clarification or add additional context in comments.

3 Comments

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); } } >>>>
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
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.