Jump to content
43oh

Using Adafruit's Fingerprint scanner with Msp430G2553


Recommended Posts

Hi all.


I have been working on a fingerprint based project using adafruit's fingerprint scanner from here http://www.adafruit.com/products/751 .

I have been successfully using this with Arduino uno with the help of the following library provided by adafruit itself, from here: https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library

Now, i have to switch from Arduino to Msp430g2553 LP. Can you'll please guide me with the following? :

1) How to port This library to Energia? I know the basic part is to replace Arduino.h and associated code with #include <energia.h>, but is there anything else i need to do?

2) How do work with SoftwareSerial in this case? I've read we cannot use baud rate above 9600 with g2553, is it true?

Is there anyone who has worked on a similar project? Any help will be truly appreciated. Thanks in advance.

 

Link to post
Share on other sites

Have you attempted #1 ?  If so, what error messages, if any.  If you've not even tried, time to edit code and see what happens.

Re: #2 - time to read the docs... The calls to SoftwareSerial are well documented. As to the speed limit, yes.

Google is your friend regarding both questions; there are dozens, if not hundreds of answered questions and coding examples on the topics of porting and serial communications.

 

Link to post
Share on other sites

Hello @NurseBob , thanks for responding. 

I have followed the guide from here https://forum.43oh.com/topic/9360-bluetooth-module-hc-05/ and tried to do the same for the fingerprint scanner by using software serial for debugging purposes in order to use serial monitor and using hardwareserial for communication with the fingerprint scanner. Using this as reference, following are the connections: 

 

pin connections of Msp430g2553 with the scanner will be as follows for h/w serial:

Tx of scanner --> P1.1 

Rx of scanner--> P1.2 

For s/w serial: (Connection within launchpad itself):

Tx of J3 jumper (Down left pin, when Lp is held with USb plug at top) --> P1.7 

Rx of J3 jumper (Upper right pin, when Lp is held with USb plug at top) --> P1.6

I have ported this Adafruit's scanner library from here https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library for Energia. The first basic enrollment example for it is as follows, which is for Arduino uno and it uses softwareserial for communication with the scanner

*************************************************** 
  This is an example sketch for our optical Fingerprint sensor

  Designed specifically to work with the Adafruit BMP085 Breakout 
  ----> http://www.adafruit.com/products/751

  These displays use TTL Serial to communicate, 2 pins are required to 
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <Adafruit_Fingerprint.h>

// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1

// For UNO and others without hardware serial, we must use software serial...
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino  (WHITE wire)
// comment these two lines if using hardware serial
SoftwareSerial mySerial(2, 3);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

uint8_t id;

void setup()  
{
  Serial.begin(9600);
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  delay(100);
  Serial.println("\n\nAdafruit Fingerprint sensor enrollment");

  // 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) { delay(1); }
  }
}
// .....

So keeping this as reference, i have tried to write a code Where i use Softwareserial for debugging serial monitor and i use hardwareserial for communication with the scanner. I am sure

about the former, but unsure about the latter. Following is the code i wrote:

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

#define mySerial Serial1
SoftwareSerial mySerial2(P1_7,P1_6); // Rx, TX for debugging

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

uint8_t id;


void setup() {
  // put your setup code here, to run once:

    mySerial2.begin(9600);
//    while (!mySerial2); 
    delay(100);
    mySerial2.println("\n\nAdafruit fingerprint sensor enrollment");

    finger.begin(57600);

    if (finger.verifyPassword()) 
    {
       mySerial2.println("Found fingerprint sensor!");
    } 
  else 
  {
       mySerial2.println("Did not find fingerprint sensor :(");
       while (1) 
       { 
          delay(1); 
       }
  }
 
   
}

void loop() {
  // put your main code here, to run repeatedly: 
  
}

When compiled, i get the following errors:

Quote

C:\Users\Ebrahim\AppData\Local\Temp\arduino_build_626374\sketch\fingerprint_enroll.ino.cpp.o: In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.2]':

fingerprint_enroll.ino.cpp:(.text._Z41__static_initialization_and_destruction_0ii.constprop.2+0x1c): undefined reference to `Serial1'

collect2: ld returned 1 exit status

Multiple libraries were found for "SoftwareSerial.h"
 Used: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\hardware\energia\msp430\libraries\SoftwareSerial
 Not used: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\libraries\SoftwareSerial
Multiple libraries were found for "Adafruit_Fingerprint.h"
 Used: C:\Users\Ebrahim\Documents\Energia\libraries\Adafruit-Fingerprint-Sensor-Library-master
 Not used: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\libraries\Adafruit-Fingerprint-Sensor-Library-master
 Not used: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\libraries\Adafruit-Fingerprint-Sensor-Library-master
 Not used: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\libraries\Adafruit-Fingerprint-Sensor-Library-master
 Not used: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\libraries\Adafruit-Fingerprint-Sensor-Library-master
Using library SoftwareSerial at version 1.0.0 in folder: C:\Users\Ebrahim\Downloads\energia-1.8.7E21-windows\hardware\energia\msp430\libraries\SoftwareSerial 
Using library Adafruit-Fingerprint-Sensor-Library-master at version 1.1.2 in folder: C:\Users\Ebrahim\Documents\Energia\libraries\Adafruit-Fingerprint-Sensor-Library-master 
exit status 1
Error compiling for board MSP-EXP430G2 w/ MSP430G2553.
 

 

Please can you suggest changes in the code i've written to achieve what i intend to do? I think the problem lies in the hardwareserial itself, but can't figure out what exactly.

Thanks for your help.

Link to post
Share on other sites

" Multiple libraries were found for..."

You've got a configuration error message.  Time to read the docs on porting from other libraries.

The above may provide guidance.  I am not able to help much beyond this suggestion as I'm deeply involved in other non-coding projects at this time.

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