Fingerprints sensor with six cable

Hi there,
My friends just give me a fingerprints sensor for my birthday but it had six cable of different color. I see different tutorial about the sensor with four cable but when I tried some of them they don't work with my sensor. I think it's because I don't use two (the yellow and the blue) of the six cable.

This is the datasheet of the sensorhttp://osoyoo.com/driver/Fingerprint%20user%20manual.pdf but I don't understand it very well.
The problem is that I don't know how to use the two cable (yellow and blue ones).

I'm using an Arduino Uno R3 and the Arduino IDE is the last version, I don't think it is important but I'm using Ubuntu 16.04.

This is the code I have tried without success:

#include <peng_fei_Fingerprint.h>
#include <SoftwareSerial.h>

uint8_t getFingerprintEnroll(uint8_t id);


// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino  (WHITE wire)
SoftwareSerial mySerial(2, 3);

peng_fei_Fingerprint finger = peng_fei_Fingerprint(&mySerial);

void setup()  
{
  Serial.begin(9600);
  Serial.println("fingertest");

  // set the data rate for the sensor serial port
  finger.begin(57600);
  
  if (finger.verifyPassword()) {
    Serial.println("Found fingerprint sensor!");
  } else {
    Serial.println("Did not find fingerprint sensor !!!!");
    while (1);
  }
}

void loop()                     // run over and over again
{
  Serial.println("Type in the ID # you want to save this finger as...");
  uint8_t id = 0;
  while (true) {
    while (! Serial.available());
    char c = Serial.read();
    if (! isdigit(c)) break;
    id *= 10;
    id += c - '0';
  }
  Serial.print("Enrolling ID #");
  Serial.println(id);
  
  while (!  getFingerprintEnroll(id) );
}

uint8_t getFingerprintEnroll(uint8_t id) {
  uint8_t p = -1;
  Serial.println("Waiting for valid finger to enroll");
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }

  // OK success!

  p = finger.image2Tz(1);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  
  Serial.println("Remove finger");
  delay(2000);
  p = 0;
  while (p != FINGERPRINT_NOFINGER) {
    p = finger.getImage();
  }

  p = -1;
  Serial.println("Place same finger again");
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.print(".");
      break;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      break;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      break;
    default:
      Serial.println("Unknown error");
      break;
    }
  }

  // OK success!

  p = finger.image2Tz(2);
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image converted");
      break;
    case FINGERPRINT_IMAGEMESS:
      Serial.println("Image too messy");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_FEATUREFAIL:
      Serial.println("Could not find fingerprint features");
      return p;
    case FINGERPRINT_INVALIDIMAGE:
      Serial.println("Could not find fingerprint features");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }
  
  
  // OK converted!
  p = finger.createModel();
  if (p == FINGERPRINT_OK) {
    Serial.println("Prints matched!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_ENROLLMISMATCH) {
    Serial.println("Fingerprints did not match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
  
  p = finger.storeModel(id);
  if (p == FINGERPRINT_OK) {
    Serial.println("Stored!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {
    Serial.println("Could not store in that location");
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {
    Serial.println("Error writing to flash");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
}

I have found it here http://kookye.com/2016/07/24/use-arduino-drive-fingerprint-sensor/.
The error I get is "Did not find fingerprint sensor".

In attachment there is a photo of the sensor with the wires.

Thank everybody for the help in advance and I' m a newbie on Arduino so please don't get angry if I ask obvious question.

Looks like the wires are "don't care". see "Use Arduino drive Fingerprint Sensor « osoyoo.com".

Paul

But in the link you send in the photo the sensor have just four wire.

If the wires are "don't care" but Arduino doesn't see the sensor that means it is broken ?

The manual referenced by the "KOOKYE" site where you got the software links to the identical manual on the OSOYOO" site. And neither site's project make any comment on the other two wires.

Also neither site has a comment on having sold different fingerprint devices.

Can you draw up a schematic of how you have device connected to the Arduino and the power supplied to both? Did you read in the manual the sensor takes quite a bit of time to initialize after being powered up?

Paul

I connect Arduino with my PC with an USB cable and then the sensor to the arduino using a breadboard, same for the data input and output. I'm pretty sure the wiring is correct.

I have tried inserting a delay time of 300ms on the program just before the verifyPassword

void setup()  
{
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  
  Serial.begin(9600);
  Serial.println("Adafruit finger detect test");

  // set the data rate for the sensor serial port
  finger.begin(57600);
  delay(300);
  
  if (finger.verifyPassword()) {
    Serial.println("Found fingerprint sensor!");
  } else {
    Serial.println("Did not find fingerprint sensor :(");
    while (1);
  }
  Serial.println("Waiting for valid finger...");
}

I'm using the adafruit library but there is no change, I still get the same answer

The delay time is listed as 500ms.

Here is the answer to your question. I will tell you of a Google search technique you can use in the future. Ask Google to search for something like "fingerprint sensor". Then display all the images. Look through the images for something that looks like what you are looking for. In our case, we are looking for a fingerprint sensor with 6 wires. Several sites have the 6 wire picture, but only use 4 wires.

I finally found this site that identified the other wires, "$49.90 - Fingerprint Scanner Sensor (Arduino Compatible) - Tinkersphere". The other wires are for a proximity sensor. That allows the sensor to be powered down until someone actually puts a finger on the device and triggers the proximity sensor and causes the reader to be powered up.

So, the other two wires are really "don't care" for your project.

Paul

Actually, I see the delay is only at power on time for the fingerprint reader. So, by the time your Arduino is booted up, the reader should respond.

Paul