The purpose of the Fingerprint Enabled Door Lock (referred to in this report as
the FEDL) was to create a useful and fun device while bolstering knowledge of
the I2C bus from the last challenge, improving programming ability and most
importantly, using EAGLE to design custom PCBs.
The first skill that was improved in this project was the use of the I2C bus.
Knowledge in this case was improved following an in-class unit on the interface
and Challenge 3.
The second skill improved throughout the duration of the FEDL project was
programming. The Arduino sketch for this project was the largest written to date
due to the various components that were used.
The third and most important skill obtained during the FEDL project was a
working knowledge of the Cadsoft EAGLE software, which is used for the purpose
of designing custom circuit schematics and boards. These designs can
subsequently be submitted to a PCB fabricator for production and shipment of
custom PCBs. The skill of PCB design is essential for larger circuits and
projects where a standard proto-board cannot be used.
The FEDL project consists mainly of a MCP23017 I2C I/O expander, an LED bar
graph, a Chronodot, an I2C 7-Segment Backpack, a servo motor and an Adafruit
Fingerprint Sensor. The Circuit is housed on a custom PCB, connecting the I/O
expander to the Arduino along with the Chronodot and 7-Segment Display via I2C.
The custom board connects the I/O expander to the LED bar graph and button. The
custom PCB also has input pins from the Arduino to communicate with the
fingerprint sensor and servo outside of the I2C bus. With the custom board tying
all of the components together, Arduino code can be used to create an effective
door lock system.
The construction of the FEDL is broken down into 3 steps: Prototype circuit,
board design and fabrication and the code.
Prototyping the circuit is the first and easiest step in the making of the FEDL.
Since the circuit contains many I2C components, the wiring for most of the
circuit involves connecting the SDA and SCL pins to the various components. The
connection of the fingerprint scanner and servo motor requires only 3 pins each,
making the wiring of the FEDL circuit extremely straightforward.
Breadboard Prototype
The second and most difficult step of building the FEDL was the board design and
fabrication. The process of designing a custom PCB involved learning how to use
the Cadsoft EAGLE software. EAGLE is the most common software used for board
design. The first step was to create a working schematic within EAGLE. This
required finding all of the parts needed for the circuit within the EAGLE part
picker. Once the schematic was completed and checked as thoroughly as possible
for errors, the EAGLE software was switched to board view. The board view
function was used to place the parts on the board in the desired fashion. Once
the PCB was laid out properly, the next step was to run the autorouter. The
autorouter automatically connects the components as specified in the schematic
by placing physical traces that will be printed on the board when it is ordered.
Following the completion of the routing, the board was ordered from a PCB
fabrication company called Advanced Circuits. The first iteration of the FEDL
PCB was delivered a few days later. An issue was encountered with the first PCB
in that the pads where the RGB LED would be soldered were connected and would
therefore cause a short circuit. The DRC (Design Rule Check) function within
EAGLE warned of this, however, it was initially thought that the issue could be
simply fixed by cutting the traces on the board manually. Despite the RGB LED
issue, the rest of the board had to be tested. The first custom PCB was soldered
excluding the RGB LED and it functioned properly. Once it was determined that
the first design functioned properly, EAGLE was used to change the design of the
board to fix the error with the RGB LED by using a simple pin header component
instead of a component specifically designed for a RGB LED. Additionally, a pin
header was added to the board for the Arduino software serial pins required to
operate the fingerprint sensor, which was omitted from the previous design as it
was thought that the fingerprint scanner could be directly connected to the
Arduino. The second iteration of the board was ordered and delivered
approximately one week prior to the ISP presentation date allowing ample time
for soldering and testing. Once the board was soldered and tested, it was
mounted along with the Arduino on a slab of acrylic, which acted as a chassis
for the components.
Soldered PCB Prototype
EAGLE Schematic
The third and final step of building the FEDL project was the programming. With
the custom PCB already soldered and tested, a functioning circuit had been
produced and the programming process could commence. The first step of the
programming process was using the Wire library to read time data from the
Chronodot RTC. Developing this functionality required the use of the Chronodot’s
datasheet, which indicated which addresses within the chip’s memory had the
required information (such as hour and minute). Once data was successfully
retrieved from the Chronodot, two new functions called hour() and minute() were
created that returned the current hour and minute as an integer. The time
obtained from these functions was displayed on the 7-Segment display using
Adafruit’s library. The second step of the programming process was to operate
the I/O pins on the MCP23017 in the same manner as on the Arduino. Three
functions were developed for this purpose: mcWrite(), mcRead() and mcPinMode(),
which recreated the digitalWrite(), digitalRead() and pinMode()
functions on the Arduino. Completing these new functions required the Wire
library and extensive use of bitwise operators as the functions had to have the
ability to change bits in the MCP23017’s registers. The third step of the
programming process was to read data from the fingerprint scanner and check if
the correct finger is placed on the sensor. Adafruit’s fingerprint scanner
library was used to achieve this.
Overall, the FEDL was a challenging project that allowed for growth in the areas
of programming and circuit board design. The project culminated in a product
that is useful on an everyday basis.