Problem between uno and Sen 0348

I do a project based on the fingerprint sensor Sen0348 with the dedicated library dfrobot_id809 and an arduino uno R3

The problem is that the uno gives me the same error "Communication with device failed, please check connection" despite me following the wiring diagram of the sensor

How is it wired to the Uno?
What sketch are you using to get that response?

Edit: I took a look at the library. I see where you get that error.
If the library detects the board as an Uno, it uses SoftwareSerial on pins D2 and D3.
Just FYI

I will take a SWAG and say you are trying to go to fast with software serial. Above 9600 it preforms very poorly if at all.

so what you recommend me to do

because i tried with the d2,d3 but also with others pins

You'll probably need a board with a hardware serial port. I use a Mega2560. 4 serial ports.
115200 is too fast for SoftwareSerial.

Apparently that is why DFRobot recommends a Leonardo. From what I understand its Serial port is not connected to the USB port as on the Uno. Don't quote me.

But yesterday it worked fine with different pins

Which pins? D0 and D1?

i used d8, d3

I just looked at that library again. Try 9600 baud.
Edit: There is a function to change the baud rate. If that be the case, I'd start the device at the lowest. You want faster then you can get faster.

  typedef enum{
    e9600bps = 1,
    e19200bps,
    e38400bps,
    e57600bps,
    e115200bps
  }eDeviceBaudrate_t;

so you want me to change this FPSerial.begin(115200) or this Serial.begin(9600);

also my code is the default example of fingerprintMatching

Just as a test:
FPSerial.begin(9600);

Edit: Here is how I SWAG it to get 38400 baud:

FPSerial.begin(9600);
fingerprint.setBaudrate(e38400bps);
// You'll lose connection here.
FPSerial.end();
FPSerial.begin(38400);

I 'll try it and update you

I would try this in setup() to increase baud rate.
I left the debug stuff in in case it doesn't work.
You might get a "Baud rate change failed" message once before it does connect.

void setup(){
  Serial.begin(9600);
  FPSerial.begin(9600);
  fingerprint.begin();
  while(!Serial);

  while(fingerprint.isConnected() == false){
    Serial.println("Communication with device failed, please check connection");
    /*Get error code information */
    desc = fingerprint.getErrorDescription();
    Serial.println(desc);
    delay(1000);
  }

  fingerprint.setBaudrate(e38400bps);
  
  FPSerial.end();
  FPSerial.begin(38400);

  while(fingerprint.isConnected() == false){
    Serial.println("Baud rate change failed");
    /*Get error code information */
    desc = fingerprint.getErrorDescription();
    Serial.println(desc);
    delay(1000);
  }
  Serial.println("Ready");
}

i tried it and it says that "no matching function for call to 'DFRobot_ID809::begin()"

also heres is the full error : C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino: In function 'void setup()':
C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:19:21: error: no matching function for call to 'DFRobot_ID809::begin()'
fingerprint.begin();
^
In file included from C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:1:0:
c:\Users\kosmas\Documents\Arduino\libraries\DFRobot_ID809-master/DFRobot_ID809.h:191:8: note: candidate: bool DFRobot_ID809::begin(Stream&)
bool begin(Stream &s_);
^~~~~
c:\Users\kosmas\Documents\Arduino\libraries\DFRobot_ID809-master/DFRobot_ID809.h:191:8: note: candidate expects 1 argument, 0 provided
C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:25:5: error: 'desc' was not declared in this scope
desc = fingerprint.getErrorDescription();
^~~~
C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:25:5: note: suggested alternative: 'getc'
desc = fingerprint.getErrorDescription();
^~~~
getc
C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:30:27: error: 'e38400bps' was not declared in this scope
fingerprint.setBaudrate(e38400bps);
^~~~~~~~~
C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:38:5: error: 'desc' was not declared in this scope
desc = fingerprint.getErrorDescription();
^~~~
C:\Users\kosmas\AppData\Local\Temp.arduinoIDE-unsaved202459-4396-1625oqo.evpj\sketch_jun9a\sketch_jun9a.ino:38:5: note: suggested alternative: 'getc'
desc = fingerprint.getErrorDescription();
^~~~
getc

exit status 1

Compilation error: no matching function for call to 'DFRobot_ID809::begin()'

Maybe it takes care of all that internally. Try this.

#include <DFRobot_ID809_I2C.h>

DFRobot_ID809_I2C fingerprint;

void setup(){
  Serial.begin(9600);
  fingerprint.begin();
  while(!Serial);

  while(fingerprint.isConnected() == false){
    Serial.println("Communication with device failed, please check connection");
    /*Get error code information */
    // desc = fingerprint.getErrorDescription();
    // Serial.println(desc);
    delay(1000);
  }

  fingerprint.setBaudrate(3);
  
  while(fingerprint.isConnected() == false){
    Serial.println("Baud rate change failed");
    /*Get error code information */
//    desc = fingerprint.getErrorDescription();
//    Serial.println(desc);
    delay(1000);
  }
  Serial.println("Ready");
}

void loop() {

}

in which pins do i connect the sensor

If the library is accurate, it SHOULD be pins D2 and D3 set for SoftwareSerial.
Where did you get FPSerial?

Edit: From the library:

#if ((defined ARDUINO_AVR_UNO) || (defined ARDUINO_AVR_NANO) ||(defined NRF5))
SoftwareSerial Serial1(2, 3);  //RX, TX
#endif

Edit2: The Leonardo, Mega2560 and Due have Serial1 hardware ports. If you have one of those, connect the sensor to Serial1 port.

I had the same problem and I didn't understand what was happening. After several days of testing, I found that it was a problem with the JST connector that makes false contact. Try disconnecting and connecting it several times until the LEDs on the sensor ring light up. That was my solution.

PD: I bought 3 sensor units and only one worked, the other two never turned on, I hope that helps you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.