Final Status Report

During the final week of the project, we finish each out the separate components and combined them to make the final product.

Joe implemented Uart communication between the fingerprint scanner and the PIC. This had been a problem during the past week, but the correct protocol for sending command packets to the fingerprint scanner from the PIC has now been implemented. Using the fingerprint scanner documentation with assistance from a library in C++ for Arduino found on Github, all the necessary fingerprint functionality could then be implemented. The fingerprint scanner is able to perform initiation, enroll, deletion, and fingerprint comparison functions. These were tested by displaying the response from the fingerprint scanner on the LCD display after each command was sent. The response would either return acknowledgement or error messages which could be interpreted using the fingerprint documentation. The fingerprint library was written so that functions could be performed completely after being initiated by one variable in main. The fingerprint scanner was also soldered to a nicer looking proto-board.

As far as sound production, Phil had an issue last week where he was unable to produce appropriate sound from the SD card. The music files were played at lower frequencies than they were supposed, causing the song to play slower than usual and had a large amount of static. Phil was initially using interrupts to send data out to the DAC. This was interrupting the process of reading from the SD and performing DMA transfer. Previously the interrupt triggered a DMA cell transfer and generated a chip select signal for the DAC. This was fixed by moving this functionality outside of the interrupt and little use of the main processor. Chip select was using output compare in dual compare mode. The DMA cell transferred was triggered using a timer. This allowed for a complete transfer of data to the DAC the wav files could be played at normal speeds.

Austin wired the board and did the interfaces. He stripped the board of its spaghetti wires and rewired it beautifully. He made displays for history, enroll, and enrollment list. History included a list ID’s who had rang the doorbell. Enroll includes a song selection screen as well as demo song functionality. He combined code from Phil’s SD card reader to work for the interface, which included creating wrappers and organizing data in a way that it could be used in the rest of the project. The screen and the DAC are on the same SPI channel, so unfortunately it is impossible to use the touch screen while listening to a song. We initially had the screen with the SD card reader, but it caused the SD card reader to stop. Enrollment list displays all the ID’s which are enrolled and the songs which they are mapped to. The ID’s come from the code that Joe worked on.

In the end, we all come together in order incorporate all of the elements into the fingerprint scanning doorbell. This took much effort from all group members to make their separate contributions work together.

Week 3 Status -phil

As scheduled, work was done on sound production this week. The objective was to read data from the SD to get buffered data and write to the DAC simultaneously using DMA with previously buffered data. A basic implementation was achieved this week, but we have been plagued by bugs. Notably the DMA transfer occurs twice for some unknown reason.

I am definitely behind schedule as sound production was supposed to be done this week. Hopefully a breakthrough can be made within the next couple of days.

test_rep

DAC output on top and SD card output on bottom. After the first cycle data repeats twice.

Status Report Week 3- Joe

Much progress has been made since last week as far as the fingerprint scanner. Last Tuesday in lab, it was discovered that the assumed wiring of the scanner was incorrect. The correct wiring has been determined. Much time was spent attempting to get UART communication working between the fingerprint scanner and the PIC. It was discovered that the wire which is being used to connect the fingerprint scanner to the breadboard was preventing transmission from the fingerprint scanner to the pic from being received. When held in the right orientation, the fingerprint scanner was able to receive the 12 byte command packet and return a 12 byte response packet as well as a data packet when necessary. I was able to implement both an open command as well as turn on the blue LED in the fingerprint scanner. Now that the communication protocol has been worked out, I will code up a library of functions for the fingerprint scanner to perform the designated functionality as well as find a better way to connect the wires on the fingerprint scanner in order to prevent the PIC from missing transmissions. The fingerprint scanner will be combined with the SD card reader which will be able to play different tones based on the person who rings the doorbell.

Week 3- Austin

Interface!

Over break (in between stuffing my face with food), my goal was to design an interactive interface for our system. Unfortunately, I forgot my computer charger and was unable to. BUT I came back and worked on it, initially coming up with a state machine that I would then implement. This iteration of the interface will have a ‘Main Menu’ that has buttons that lead the user to three other menus: Enroll, View History, and View Enrollments. The state machine can be seen in the link below.

Interface State Diagram

The code is not fully implemented yet, but will be by the end of lab period tomorrow (unless we focus more on the fingerprint scanner).

 

Goals for this coming week: get the Fingerprint Scanner working.

This is the main goal for Joe and I this week.

Week 2- Joe

After two weeks of working on the project, we realized that our project might be too complex to complete in the given time frame. In order to make the project more manageable, we proposed that the criminal database portion of the project be dropped. This was decide upon because the two main functionalities of the project, the fingerprint scanner and the SD card reader/sound production, have been taking a considerable amount of time thus far and still need large amounts of addition effort to complete. In addition, we could run into difficult down the road with transferring and comparing fingerprint files on the PIC as the details of this have not yet been worked out. Instead, we’d like to have the fingerprint scanner handle all fingerprint comparisons for the time being. This way, the focus of the project could be redirected to the two main elements. The terms of the project were renegotiated with the professor, and he accepted the exclusion of the criminal database.

I attempted to set up UART communication with the fingerprint scanner. This is being done with the aid of a pre-made code on GitHut in C++ for an Arduino. According to the fingerprint scanner datasheet, the scanner takes 12 bytes of data for every command packet, so twelve bytes are sent from the PIC to the fingerprint scanner per action. It has been verified on the scope that this data is being transmitted correctly. At the moment, the fingerprint scanner is having trouble receiving the data. The signal, for some reason, is being pulled down when the TX from the PIC is pulled into the RX of the fingerprint scanner. It was thought that the fingerprint scanner needed more power, but after supplying 5V to the power supply of the scanner instead of 3.3V, it was clear that this was not the case. Further troubling shooting will be completed in lab.

Plans for this coming week include getting the fingerprint scanner to communicate properly and creating methods to carry out the necessary communications between the PIC and fingerprint scanner.

Week 2 Status -Austin

This week, I focused on creating a TCP client using the TCP/IP stack that Microchip supplies in their MPLAB Harmony package. I have not yet been able to send data from the PIC32 client to a server on my personal laptop, but I’m nearly certain the problem just lies with the code and not how the hardware is connected. Unfortunately, my efforts will be redirected to the Fingerprint Scanner and Interface for the time being. I hope that we resolve the issue with the Fingerprint Scanner so that we could potentially re-implement the TCP client/server.
Over Thanksgiving, I will try to work on a control interface for our system. The interface will display components such as who has recently used the fingerprint scanner and at what time they used it. After break, I will work on the Fingerprint Scanner with Joe. I will initially help decode the C++ library that Joe started using for the Fingerprint Scanner.

Week 2 Status -phil

A lot of time was spent working on the SD card and FAT32 interface. Both are now complete. A few weird bugs were discovered while working on reading the SD card, one of which took hours to resolve and still does not have a solution, but has been worked around. Once the SD card interface was deemed satisfactory, work was started on accessing the FAT file system of the SD card. Most of the libraries for FAT were very lengthy (at least 1000 lines) and were difficult to understand for someone who is fairly new to C. A fairly simple FAT16 library was used as a guideline for creating our own FAT32 accessing code. The code can interpret the boot sector, go to the root directory, then read data one sector at a time and follow cluster chains. WinHex, a memory viewing software, was very useful for verifying what data should be read at certain data locations.

The next step is to work on using DMA to output buffered data to the DAC in parallel to reading new data. Timing may be an issue because the data has to be read and formatted for the DAC before a DMA transfer finishes. Also a 12 bit DAC is being used for 16 bit data samples, so the sound quality will be decreased in downsizing. If the quality sounds poor, we may need to upgrade to a 16 bit DAC.

Week 1 Status- Austin

This week, my goal was to create a TCP server that could open a socket and listen on a specified port. It needs to be able to accept multiple types of data. The server will distinguish what the data is via op-codes sent by the client. Types of data the server must be able to receive: time of fingerprint, if the authentication was successful or not, and if yes, who’s fingerprint it is.

Status- Server is works fully, all operations work as intended. Mock client can connect to server, send multiple data types (and receive data too, if necessary), control certain functions of server, and disconnect from the server. Server side code implemented in Rust. I don’t believe there would be a problem have the server in Rust and the client in C/C++, but I’ll need to implement a client using Microchip’s PIC32 TCP stack in order to test.

 

Goals for next week- Implement the TCP client using Microchip’s TCP stack.

Week 1 Status -phil

Week 1 mostly consisted of figuring out the steps needed to interface with an SD card from the PIC. Multiple sources were found that discussed and gave example code about SPI transfer and the inner workings of the file system on the card (FAT32). Initially a C++ library was going to be used for interfacing with the SD card peripheral, but this was dropped in favor of a simpler C library. The C library is currently being adapted to work with the PIC32 and the SDHC card being used. The SPI module was the first area looked at and was successfully modified to work with our devices. There was a troublesome reading issue with the PIC where the SD card would send a signal and the PIC would not accept it into the SPI receiver buffer. This was due to an overflow flag, which prevented new information from entering the buffer. The overflow register was reset before every read event in order to fix the error.

Status Report Week 1- Joe

For this week, my goals were to make the schematic diagram for the system as well as to do research on how the fingerprint scanner will interface with the PIC. I’ve completed the schematic which is included below. This involved looking up how each device will communicate with the PIC and detailing what pins would be used for each device. It has been arranged so that the SD card reader and the Ethernet Module are on one SPI channel, and the LCD and the DAC are on the second SPI channel. The fingerprint scanner will communication via UART connection. In addition, I’ve found a library for the fingerprint scanner on Github.com which is in C++. I also soldered wires to the SD card reader so that it could be plugged into the breadboard and taught Phil how to solder while doing so. For next week, I will be working on converting this library to C and setting up the fingerprint scanner.

Schamtic