Jump to content
43oh

Can't Connect to Fingerprint Scanner- MSP430G2553 w/ LP project


Recommended Posts

So I'm working on a fingerprint scanner project with this repo written for arduino for the scanner I'm using. I am trying to make it work with an MSP430G2553 instead of the Arduino Uno. When I try using this library in Energia, it can't find the scanner despite being wired on the launchpad the same way that it is wired on the Arduino (External 5V source, Arduino pin 2 --> MSP430 pin 1.1, Arduino pin 3 --> MSP430 pin 1.2). The code compiles and the serial monitor outputs the test looking for the scanner, but it has yet to be able to find it. If anyone could give me any help with this, it would be greatly appreciated. Energia ino sketch is attached.

 

EDIT: So after making myself more familiar with the code and the C++ imports, it seems the scanner works in 4 phases:

 

1) Take image

2) If image is a finger, convert it to digital features

3) Compare fingerprint features against features of enrolled fingerprints

4) Able to return result for the comparison and if its a match, return the ID#

 

These lines:

SoftwareSerial mySerial(5, 6); //Define serial communication on two pins
Adafruit_Fingerprint finger = Adafruit_fingerprint(&mySerial);

Seem to be whats handling all the fingerprint logic. So the issue isn't with the scanner, its with the communication between scanner and the MSP, most likely that I'm somehow defining output pins 5 and 6 (P1_3 and P1_4) incorrectly so they are not handling the scanner at all.

fingerprint.ino

Link to post
Share on other sites

I tried moving to different pins and had the same problem

 

Maybe just post the sketch that _you_ are actually using on the G2553 ... so we can see which pins you use etc.

Why do you power the finger print scanner with 5v ? I would worry a little bit about this (regarding the logic levels) ...

Maybe add a photo or a wiring scheme ... do G2553 and scanner have the same GND?

So ... a lot of questions ;)

Link to post
Share on other sites

Note that SoftwareSerial is limited to 9600 baud.

 

@@jogreenie ... that's a good point Robert mentioned! Maybe it's better to use Software Serial for debugging and RXD/TXD (Pins 3 and 4) for the Scanner. We discussed scenarios like this in other posts here (e.g. if you need to connect a HC-05 / HC-06 Bluetooth Module or a ESP8266 to the G2553).

 

See here: http://forum.43oh.com/topic/9293-esp8266-with-msp430g2553-launchpad/?p=70938

and here (with photo): http://forum.43oh.com/topic/9360-bluetooth-module-hc-05/

 

Good luck!

Link to post
Share on other sites

Maybe just post the sketch that _you_ are actually using on the G2553 ... so we can see which pins you use etc.

Why do you power the finger print scanner with 5v ? I would worry a little bit about this (regarding the logic levels) ...

Maybe add a photo or a wiring scheme ... do G2553 and scanner have the same GND?

So ... a lot of questions ;)

posted it in the original topic post. Its the fingerprint.ino file. Code text displayed below:

#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>

int getFingerprintIDez();

// pin #5 is IN from sensor (GREEN wire)
// pin #6 is OUT from LP  (WHITE wire)
SoftwareSerial mySerial(5, 6);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

//Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial1);

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);
  
  if (finger.verifyPassword()) {
    Serial.println("Found fingerprint sensor!");
  } else {
    Serial.println("Did not find fingerprint sensor :(");
    while (1);
  }
  Serial.println("Waiting for valid finger...");
}

void loop()                     // run over and over again
{
  getFingerprintIDez();
  delay(50);            //don't ned to run this at full speed.
}

uint8_t getFingerprintID() {
  uint8_t p = finger.getImage();
  switch (p) {
    case FINGERPRINT_OK:
      Serial.println("Image taken");
      break;
    case FINGERPRINT_NOFINGER:
      Serial.println("No finger detected");
      return p;
    case FINGERPRINT_PACKETRECIEVEERR:
      Serial.println("Communication error");
      return p;
    case FINGERPRINT_IMAGEFAIL:
      Serial.println("Imaging error");
      return p;
    default:
      Serial.println("Unknown error");
      return p;
  }

  // OK success!

  p = finger.image2Tz();
  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.fingerFastSearch();
  if (p == FINGERPRINT_OK) {
    Serial.println("Found a print match!");
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    Serial.println("Communication error");
    return p;
  } else if (p == FINGERPRINT_NOTFOUND) {
    Serial.println("Did not find a match");
    return p;
  } else {
    Serial.println("Unknown error");
    return p;
  }   
  
  // found a match!
  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence); 
}

// returns -1 if failed, otherwise returns ID #
int getFingerprintIDez() {
  uint8_t p = finger.getImage();
  if (p != FINGERPRINT_OK)  return -1;

  p = finger.image2Tz();
  if (p != FINGERPRINT_OK)  return -1;

  p = finger.fingerFastSearch();
  if (p != FINGERPRINT_OK)  return -1;
  
  // found a match!
  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence);
  return finger.fingerID; 
}
Link to post
Share on other sites

Hi,

 

have you maybe the wrong (software)Serial settings?

 

 

Regards,

Liviu

No, my serial software settings are correct. I know that the USB serial has to be limited to 9600 buad, can everyone please stop suggesting that? Not 100% sure how this line works, but I'm pretty sure finger.begin(57600) is the data rate at which the finger print sensor communicates with the MCU, not at which the MCU communicates with the serial output. I'm already setting Serial.begin(9600)

Link to post
Share on other sites

 

Note that SoftwareSerial is limited to 9600 baud.

 

 

The software serial port that you are using to talk to the fingerprint scanner, per @@energia ,  can't be set to 57600 baud.  The maximum speed is 9600 baud.  So in your case both serial ports, USB and fingerprint scanner, are limited to 9600 baud. 

 

You will either need to change the speed of the fingerprint scanner to 9600 baud or use another MCU with a second hardware serial port (e.g. MSP430F5529) that will support 57600 baud.

Link to post
Share on other sites

I think the idea was to use G2553 hardware serial to communicate with the fingerprint scanner and use software serial to communicate back to the computer. This would require pulling the RXD/TXD jumpers off the launchpad programmer and use P1.1 & P1.2 to connect to the scanner, then connect the software serial pins to the appropriate RXD/TXD pins on the launchpad programmer side.

Link to post
Share on other sites

I think the idea was to use G2553 hardware serial to communicate with the fingerprint scanner and use software serial to communicate back to the computer. This would require pulling the RXD/TXD jumpers off the launchpad programmer and use P1.1 & P1.2 to connect to the scanner, then connect the software serial pins to the appropriate RXD/TXD pins on the launchpad programmer side.

 

I think that's the way to go @@jogreenie

Just have a look at the links I posted earlier ... in one you will find a photo of the setup @@abecedarian mentioned.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...