Interfacing with Fingerprint Scanner

I'm trying to send a command to my fingerprint scanner (turn on its LED) but it doesnt seem to ack it. The FPS is set to 115200bps connection.

I tested its sample program by uploading a blank sketch in my Arduino Mini and connecting its pins to RX/TX and the board to PC via USB. The program was helpful enough to display the hex codes its using in sending commands.

Here is the command to turn on the sensor LED:

0x55, 0xAA, 0x24, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x01

And here is the command packet structure :

| PREFIX | COMMAND | LEN | DATA | CHK | | - | - | - | - | - | | 0x55 0xAA | 0x24 0x01 | 0x02 0x00 | 0x01 0x00 ... 0x00 | 0x27 0x01 |

And here is my test code :

/** Turn on the LED **/

byte ledturnon[] = {
  0x55, 0xAA, 0x24, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x01};

void setup()  
{
  Serial.begin(115200);
  Serial.println("Begin Connection");
  Serial.write(ledturnon, 24);
}

void loop(){
}

I'm pretty sure there's a question in there somewhere but I don't see it.... :P

Im sorry, I was asking; is there something wrong with my code? I think the issue is with the baudrate being to fast for the board but im not certain.

Just now i was able to change the scanner's baudrate from 115200 to 9600 via SerialMon program. I uploaded my code with the corresponding baudrate but still, no response.

  Serial.println("Begin Connection");
  Serial.write(ledturnon, 24);

What is the fingerprint scanner supposed to do with “Begin Connection”?

You aren’t really trying to talk to the fingerprint scanner AND the PC on the same serial port, are you?

PaulS:

  Serial.println("Begin Connection");

Serial.write(ledturnon, 24);



What is the fingerprint scanner supposed to do with "Begin Connection<cr><lf>"?

You aren't really trying to talk to the fingerprint scanner AND the PC on the same serial port, are you?

Oh, so I can’t send a command to my scanner with the board using my USB to Serial Adaptor as a power source? That was silly of me.:stuck_out_tongue:

Ill get back on you once i tested it.

Oh, so I can't send a command to my scanner with the board using my USB to Serial Adaptor as a power source?

No. That's fine. It's using the other two wires in the USB cable to send data back to the PC that you can't do, if the TX and RX pins are connected to some other device.

Unless you have a Leonardo, that is.

Still no response from the scanner even after connecting to DC Power. SerialMon shows my code is sending the correct commands as with the sample program.