Fingerprint Reader and serial pass through

Next project is underway… i have a fingerprint reader, this one ->

http://www.ebay.com.au/itm/Optical-Fingerprint-reader-Sensor-Module-sensors-All-in-one-For-Arduino-Locks-/271457343941?pt=LH_DefaultDomain_0&hash=item3f341e59c5

Its a pretty simple device and easy to use with an arduino. But i want to make it awesome with a spark and a Diogle display. Also add in a RFID tag reader and a doorbell… Eventually it will replace my current commercial fingerprint entry system.

First thing i want to do is run the windows app and enroll some prints. On an arduino you can load a blank sketch and create a TTL serial to USB converter. Is it possible to do this on a spark?

and how will i know if the Adafruit library is compatible? i had a look through it but I’m more of a cut, paste and hack till it works kinda guy

3 Likes

@Hootie81, cool project! The Arduino library for this device uses SoftwareSerial which I do not recommend (and doesn’t work on the Spark anyway). The Spark has a hardware serial port (Serial1) that can be used and I can adapt the library and examples for you.

As for the TTL serial to USB, when you run Serial.begin(baud) in your Spark code, the Spark will appear as a COM port on the PC. So you just need a little program to read from Serial and pass it to Serial1 (the sensor) and vice versa. That should be easy to do. :smile:

3 Likes

Awesome that would be great! I would love to be able to read the fingerprint picture and have it display on the Digole screen, then make it go green if it recognizes it or red if its not a match. Im assuming it has to be available through the serial to display on the computer screen so should be able to read it from the spark.

Ive been trying to port this myself… but i don’t fully understand how the library is written or how it works.

these are the errors I’m getting now

In file included from ../inc/spark_wiring.h:30:0,

    
                       from ../inc/application.h:31,

    
                       from /Adafruit_Fingerprint.cpp:17:

    
      ../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]

    
      /Adafruit_Fingerprint.cpp:23:44: error: definition of implicitly-declared 'Adafruit_Fingerprint::Adafruit_Fingerprint()'

    
      /Adafruit_Fingerprint.cpp: In member function 'bool Adafruit_Fingerprint::verifyPassword()':

    
      /Adafruit_Fingerprint.cpp:37:54: warning: narrowing conversion of 
'(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword 
>> 24)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka 
unsigned char}' inside { } [-Wnarrowing]

    
      /Adafruit_Fingerprint.cpp:37:54: warning: narrowing conversion of 
'(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword 
>> 16)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka 
unsigned char}' inside { } [-Wnarrowing]

    
      /Adafruit_Fingerprint.cpp:37:54: warning: narrowing conversion of 
'(((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword 
>> 8)' from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka 
unsigned char}' inside { } [-Wnarrowing]

    
      /Adafruit_Fingerprint.cpp:37:54: warning: narrowing conversion of 
'((Adafruit_Fingerprint*)this)->Adafruit_Fingerprint::thePassword' 
from 'uint32_t {aka long unsigned int}' to 'uint8_t {aka unsigned char}'
 inside { } [-Wnarrowing]

    
      /Adafruit_Fingerprint.cpp: In member function 'uint8_t Adafruit_Fingerprint::storeModel(uint16_t)':

    
      /Adafruit_Fingerprint.cpp:87:66: warning: narrowing conversion of 
'(((int)id) >> 8)' from 'int' to 'uint8_t {aka unsigned char}' 
inside { } [-Wnarrowing]

    
      /Adafruit_Fingerprint.cpp:87:66: warning: narrowing conversion of 
'(((int)id) & 255)' from 'int' to 'uint8_t {aka unsigned char}' 
inside { } [-Wnarrowing]

    
      make: *** [/Adafruit_Fingerprint.o] Error 1

This is the library I’m trying to port https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library

This is what i have so far

/*************************************************** 
  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 "application.h"
#include "Adafruit_Fingerprint.h"


uint8_t getFingerprintEnroll(uint8_t id);


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

Adafruit_Fingerprint finger();

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;
  }   
}

And this is Adafruit_Fingerprint.cpp

/*************************************************** 
  This is a library 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 "application.h"
#include "Adafruit_Fingerprint.h"




Adafruit_Fingerprint::Adafruit_Fingerprint() {

  thePassword = 0;
  theAddress = 0xFFFFFFFF;

}

void Adafruit_Fingerprint::begin(uint16_t baudrate) {
  Serial1.begin(baudrate);
}

boolean Adafruit_Fingerprint::verifyPassword(void) {
  uint8_t packet[] = {FINGERPRINT_VERIFYPASSWORD, 
                      (thePassword >> 24), (thePassword >> 16),
                      (thePassword >> 8), thePassword};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, 7, packet);
  uint8_t len = getReply(packet);
  
  if ((len == 1) && (packet[0] == FINGERPRINT_ACKPACKET) && (packet[1] == FINGERPRINT_OK))
    return true;

/*
  Serial.print("\nGot packet type "); Serial.print(packet[0]);
  for (uint8_t i=1; i<len+1;i++) {
    Serial.print(" 0x");
    Serial.print(packet[i], HEX);
  }
  */
  return false;
}

uint8_t Adafruit_Fingerprint::getImage(void) {
  uint8_t packet[] = {FINGERPRINT_GETIMAGE};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, 3, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;
  return packet[1];
}

uint8_t Adafruit_Fingerprint::image2Tz(uint8_t slot) {
  uint8_t packet[] = {FINGERPRINT_IMAGE2TZ, slot};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;
  return packet[1];
}


uint8_t Adafruit_Fingerprint::createModel(void) {
  uint8_t packet[] = {FINGERPRINT_REGMODEL};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;
  return packet[1];
}


uint8_t Adafruit_Fingerprint::storeModel(uint16_t id) {
  uint8_t packet[] = {FINGERPRINT_STORE, 0x01, id >> 8, id & 0xFF};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;
  return packet[1];
}

uint8_t Adafruit_Fingerprint::emptyDatabase(void) {
  uint8_t packet[] = {FINGERPRINT_EMPTY};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;
  return packet[1];
}

uint8_t Adafruit_Fingerprint::fingerFastSearch(void) {
  fingerID = 0xFFFF;
  confidence = 0xFFFF;
  // high speed search of slot #1 starting at page 0x0000 and page #0x00A3 
  uint8_t packet[] = {FINGERPRINT_HISPEEDSEARCH, 0x01, 0x00, 0x00, 0x00, 0xA3};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;

  fingerID = packet[2];
  fingerID <<= 8;
  fingerID |= packet[3];
  
  confidence = packet[4];
  confidence <<= 8;
  confidence |= packet[5];
  
  return packet[1];
}

uint8_t Adafruit_Fingerprint::getTemplateCount(void) {
  templateCount = 0xFFFF;
  // get number of templates in memory
  uint8_t packet[] = {FINGERPRINT_TEMPLATECOUNT};
  writePacket(theAddress, FINGERPRINT_COMMANDPACKET, sizeof(packet)+2, packet);
  uint8_t len = getReply(packet);
  
  if ((len != 1) && (packet[0] != FINGERPRINT_ACKPACKET))
   return -1;

  templateCount = packet[2];
  templateCount <<= 8;
  templateCount |= packet[3];
  
  return packet[1];
}



void Adafruit_Fingerprint::writePacket(uint32_t addr, uint8_t packettype, 
                       uint16_t len, uint8_t *packet) {
#ifdef FINGERPRINT_DEBUG
  Serial.print("---> 0x");
  Serial.print((uint8_t)(FINGERPRINT_STARTCODE >> 8), HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)FINGERPRINT_STARTCODE, HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)(addr >> 24), HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)(addr >> 16), HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)(addr >> 8), HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)(addr), HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)packettype, HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)(len >> 8), HEX);
  Serial.print(" 0x");
  Serial.print((uint8_t)(len), HEX);
#endif
 

  Serial1.write((uint8_t)(FINGERPRINT_STARTCODE >> 8));
  Serial1.write((uint8_t)FINGERPRINT_STARTCODE);
  Serial1.write((uint8_t)(addr >> 24));
  Serial1.write((uint8_t)(addr >> 16));
  Serial1.write((uint8_t)(addr >> 8));
  Serial1.write((uint8_t)(addr));
  Serial1.write((uint8_t)packettype);
  Serial1.write((uint8_t)(len >> 8));
  Serial1.write((uint8_t)(len));

  
  uint16_t sum = (len>>8) + (len&0xFF) + packettype;
  for (uint8_t i=0; i< len-2; i++) {
    Serial1.write((uint8_t)(packet[i]));

#ifdef FINGERPRINT_DEBUG
    Serial.print(" 0x"); Serial.print(packet[i], HEX);
#endif
    sum += packet[i];
  }
#ifdef FINGERPRINT_DEBUG
  //Serial.print("Checksum = 0x"); Serial.println(sum);
  Serial.print(" 0x"); Serial.print((uint8_t)(sum>>8), HEX);
  Serial.print(" 0x"); Serial.println((uint8_t)(sum), HEX);
#endif

  Serial1.write((uint8_t)(sum>>8));
  Serial1.write((uint8_t)sum);

}


uint8_t Adafruit_Fingerprint::getReply(uint8_t packet[], uint16_t timeout) {
  uint8_t reply[20], idx;
  uint16_t timer=0;
  
  idx = 0;
#ifdef FINGERPRINT_DEBUG
  Serial.print("<--- ");
#endif
while (true) {
    while (!Serial1.available()) {
      delay(1);
      timer++;
      if (timer >= timeout) return FINGERPRINT_TIMEOUT;
    }
    // something to read!
    reply[idx] = Serial1.read();
#ifdef FINGERPRINT_DEBUG
    Serial.print(" 0x"); Serial.print(reply[idx], HEX);
#endif
    if ((idx == 0) && (reply[0] != (FINGERPRINT_STARTCODE >> 8)))
      continue;
    idx++;
    
    // check packet!
    if (idx >= 9) {
      if ((reply[0] != (FINGERPRINT_STARTCODE >> 8)) ||
          (reply[1] != (FINGERPRINT_STARTCODE & 0xFF)))
          return FINGERPRINT_BADPACKET;
      uint8_t packettype = reply[6];
      //Serial.print("Packet type"); Serial.println(packettype);
      uint16_t len = reply[7];
      len <<= 8;
      len |= reply[8];
      len -= 2;
      //Serial.print("Packet len"); Serial.println(len);
      if (idx <= (len+10)) continue;
      packet[0] = packettype;      
      for (uint8_t i=0; i<len; i++) {
        packet[1+i] = reply[9+i];
      }
#ifdef FINGERPRINT_DEBUG
      Serial.println();
#endif
      return len;
    }
  }
}

And Adafruit_Fingerprint.h

/*************************************************** 
  This is a library 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 "application.h"

#define FINGERPRINT_OK 0x00
#define FINGERPRINT_PACKETRECIEVEERR 0x01
#define FINGERPRINT_NOFINGER 0x02
#define FINGERPRINT_IMAGEFAIL 0x03
#define FINGERPRINT_IMAGEMESS 0x06
#define FINGERPRINT_FEATUREFAIL 0x07
#define FINGERPRINT_NOMATCH 0x08
#define FINGERPRINT_NOTFOUND 0x09
#define FINGERPRINT_ENROLLMISMATCH 0x0A
#define FINGERPRINT_BADLOCATION 0x0B
#define FINGERPRINT_DBRANGEFAIL 0x0C
#define FINGERPRINT_UPLOADFEATUREFAIL 0x0D
#define FINGERPRINT_PACKETRESPONSEFAIL 0x0E
#define FINGERPRINT_UPLOADFAIL 0x0F
#define FINGERPRINT_DELETEFAIL 0x10
#define FINGERPRINT_DBCLEARFAIL 0x11
#define FINGERPRINT_PASSFAIL 0x13
#define FINGERPRINT_INVALIDIMAGE 0x15
#define FINGERPRINT_FLASHERR 0x18
#define FINGERPRINT_INVALIDREG 0x1A
#define FINGERPRINT_ADDRCODE 0x20
#define FINGERPRINT_PASSVERIFY 0x21

#define FINGERPRINT_STARTCODE 0xEF01

#define FINGERPRINT_COMMANDPACKET 0x1
#define FINGERPRINT_DATAPACKET 0x2
#define FINGERPRINT_ACKPACKET 0x7
#define FINGERPRINT_ENDDATAPACKET 0x8

#define FINGERPRINT_TIMEOUT 0xFF
#define FINGERPRINT_BADPACKET 0xFE

#define FINGERPRINT_GETIMAGE 0x01
#define FINGERPRINT_IMAGE2TZ 0x02
#define FINGERPRINT_REGMODEL 0x05
#define FINGERPRINT_STORE 0x06
#define FINGERPRINT_EMPTY 0x0D
#define FINGERPRINT_VERIFYPASSWORD 0x13
#define FINGERPRINT_HISPEEDSEARCH 0x1B
#define FINGERPRINT_TEMPLATECOUNT 0x1D

//#define FINGERPRINT_DEBUG 

#define DEFAULTTIMEOUT 5000  // milliseconds


class Adafruit_Fingerprint {
 public:
  void begin(uint16_t baud);
  boolean verifyPassword(void);
  uint8_t getImage(void);
  uint8_t image2Tz(uint8_t slot = 1);
  uint8_t createModel(void);
  uint8_t emptyDatabase(void);
  uint8_t storeModel(uint16_t id);
  uint8_t fingerFastSearch(void);
  uint8_t getTemplateCount(void);
  void writePacket(uint32_t addr, uint8_t packettype, uint16_t len, uint8_t *packet);
  uint8_t getReply(uint8_t packet[], uint16_t timeout=DEFAULTTIMEOUT);

  uint16_t fingerID, confidence, templateCount;

 private: 
  uint32_t thePassword;
  uint32_t theAddress;


};

@Hootie81, I’ll have the ported library up on my github later today! :smile:

1 Like

This works as a serial pass thru! even at the 57600 baud! Woot Woot and i know the reader is working at 3.3v can see the scanned fingerprints and everything

#include "application.h"

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  Serial1.begin(57600);

}

void loop() // run over and over
{
  while (Serial1.available())
    Serial.write(Serial1.read());
  while (Serial.available())
    Serial1.write(Serial.read());
}

@Hootie81, I have posted the code here on my github. Give it a try and let me know how it works. If all is good, I will publish the library to the web IDE :smile:

1 Like

Awesome I’ll give it a go tomorrow as its all packed away for traveling at the moment

Thanks a bunch for doing the porting I can see you have been very busy working on everyone’s projects

Edit:

So driving back from holiday… have my coffee, laptop, 2 mobile hotspots and my awesome spark

Gave it a quick test while we had phone signal… Its working! Only tried the enroll part but its working well and super quick. possibly a little bug but ill have a better look when i get home later today. I think its a println instead of a print while waiting for the first fingerprint, but the second one is ok. anyway its just a example app so not a big deal.

Thanks so much @peekay123

Also i cant see it in the example, but i want to download the actual image from the fingerprint reader and display it on the digole display… any ideas how to find out how to do it?

@Hootie81, start with the existing code and we can look at downloading the image after we know everything works. :smile:

3 hours of testing on the road all working perfect it’s a great little fingerprint reader and much better and accurate than my old commercial one that I use for entry at the moment.

1 Like

For completeness i decided to try the passthru blank ino from your library… its not working as expected. not sure why? but this works well with no errors so far

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(57600);
  Serial1.begin(57600);

}

void loop() // run over and over
{
  while (Serial1.available())
    Serial.write(Serial1.read());
  while (Serial.available())
    Serial1.write(Serial.read());
}

@Hootie81, no problems! It may be something weird but who cares! If your code is working, I’ll just replace it :stuck_out_tongue:

DONE! The library is now updated :slight_smile:

1 Like

Awesome, BTW when do you sleep? your always on here!

Ive got it setup really well on a breadboard at the moment with a digole display showing user id# etc. Might upload a demo of it working tomorrow

Im wanting to store some data in an eeprom to hold user name, RFID tag number, fingerprint ID# so it can display custom welcome messages. I’m thinking a cli kind of interface with the computer serial port to set the name and message in eeprom and enroll fingerprints in the reader and link the two together. I would also like to keep a log of incorrect tries and accepted prints.

Ive read the posts about using the eeprom and im sure i can figure that part out, but whats the best way to structure something like that where you can add and delete users? i was thinking something like this

ID#, ‘Name’, ‘Personal welcome message’, RFID1, RFID2, Print#3, Print#4,

It would be nice to have up to 4 RFID tags per user (my work one, the one on my keys, the one in my phone) and 10 fingerprints just in case i loose a few at work.

How do i figure out how much data that is? might as well use as much as the 4kb eeprom minimum write

And once i have it stored, how would i search it?

I’m not asking for anyone to write the code for me as I’m wanting to learn it and write it myself, just need a good shove to get me going in the right direction

1 Like

@Hootie81, so the EEPROM emulation added to the Spark only makes available 100 bytes of data to the use. So this is not the way to go. @kennethlimcp is finalizing his FRAM/SD shield and that would be ideal. Or you could use just a microSD for storage and retrieval.

Let's assume the following:

ID# =byte, unique fingerprint ID (0-162)
Name = char[20], 20 characters for name
Welcome Message = char[40], 40 characters (2 lines of 20 chars) personal greeting
RFID1/2/3/4 = 64 (or more) bytes per RFID x 4

I am not sure what you mean by "Print#3, Print#4".

In total, that is about 285 bytes (minimum) per user. I have to think about how you would search the RFIDs for matching. :smile:

By print#3 and print#4 i was thinking the addresses on the fingerprint reader that are for that user. i might have only 4 enrolled for my wife but i may have all 10 for me.

i was looking at the SD card library… even found an old adapter and soldered pins on. but when i got to downloading the library i got confused… there are so many files and i don’t know how to put them in the webIDE, it says /File.cpp:15:16: fatal error: SD.h: No such file or directory. it would be great if they were available as a single .h and .cpp file.

Heres a little video showing what i have so far, at the moment its @peekay123’s modified version of the fingerprint library and @timb’s digole library.

@Hootie81, I “think” I understand what you are referring to :stuck_out_tongue: I would highly recommend looking at the Spark CLI to do local compiles using the cloud. It is super easy to use and extremely versatile. In the case of your project, you would put all the files in a single directory, including all the SD files and cloud compile the whole thing. Everything looks really good!

Did you grab the latest Digole library that includes the geometric stuff? Both timb and I worked on that and it really rocks. :slight_smile:

Just trying to work out the cli stuff now! had nodejs installed for something else… so spark cli is installed now… do i need the openssl stuff still?

@Hootie81, I don’t recall having to install that on my laptop. Try doing a cloud compile to see if it works as-is :slight_smile:

@peekay123 does this make more sense?

 I was actually getting the same error on both the CLI compile as the web compile. 

Whats the go with #include ?? Is there a difference between using <example.h> and "example.h" ? 

Ive been thru and changed every <Application.h> to "application.h" and now it complies.. not sure if its just the uppercase A or the "  or both

Time to wire up the card i guess!

The forum removed some of the text…

Not sure what you mean by this. Can you explain a bit more?. :slight_smile: