Chapter 3: Functional Decomposition
At its core, the RFID Door Lock will have 3 inputs and 2 outputs. Power is an important input and will
oor Lock with the necessary voltage and currents to operate. It will be operated with 8.5V supply
and will be drawn through an AC adapter. The second input is the RFID Sensor Input. This is where the RFID tag
the outputs, the Unlock/Lock is where the RFID Door Lock sends
the signal whether or not to keep the door locked or unlock the door. These ideas are graphically represented in
Will unlock the door or remain
locked depending on the RFID tag
The initial Level 1 decomposition, the RFID Door Lock can be broken down into 5 basic components. The
RFID Input (the RFID tag) goes into an RFID sensor that will then be placed into the MCU (or Microcontroller).
et by the User Control, the MCU will then send instructions to the
Magnetic Relay and the LCD Module. Whatever is sent in to the LCD Module is outputted as the LCD Display and
can be thought of as the actual LCD screen. After the Magnetic Relay receives in
magnetic relay will then flip the circuit towards the Door Lock. The Door Lock will then output the Unlock/Lock
signal. The Door Lock can be considered as the physical door lock in the doorframe. The power will be supplied to
all of the blocks. Figure 2 displays this graphically. This Level 1 design is inspired by the Cytron Industries RFID
Door Lock (reference 11).
However, as the design began to be finalized, there was no longer a use for the magnetic relay and the user
control was left out. These only complicated the installation process. Instead the completed level 1 block diagram
uses a voltage regulator and an amplifier stage to power an electromagnetic lock. These components are much
smaller and do not require disassemblin
strength of the door lock beyond the capabilities of the Arduino microcontroller.
FIGURE 2: LEVEL 1 BLOCK DIAGRAM
This Level 1 diagram can be broken down into three more detailed
are for the voltage regulator, the RFID-
broken down even further in the following pages.
Magnetic Relay and the LCD Module. Whatever is sent in to the LCD Module is outputted as the LCD Display and
can be thought of as the actual LCD screen. After the Magnetic Relay receives instructions from the MCU, the
magnetic relay will then flip the circuit towards the Door Lock. The Door Lock will then output the Unlock/Lock
signal. The Door Lock can be considered as the physical door lock in the doorframe. The power will be supplied to
ll of the blocks. Figure 2 displays this graphically. This Level 1 design is inspired by the Cytron Industries RFID
However, as the design began to be finalized, there was no longer a use for the magnetic relay and the user
l was left out. These only complicated the installation process. Instead the completed level 1 block diagram
uses a voltage regulator and an amplifier stage to power an electromagnetic lock. These components are much
smaller and do not require disassembling a door or doorframe. Using the voltage regulator, we can increase the
strength of the door lock beyond the capabilities of the Arduino microcontroller.
FIGURE 2: LEVEL 1 BLOCK DIAGRAM
This Level 1 diagram can be broken down into three more detailed Level 2 block diagrams. These diagrams
-Arduino connection, and the inverting amplifier. The following modules are
broken down even further in the following pages.
8
Magnetic Relay and the LCD Module. Whatever is sent in to the LCD Module is outputted as the LCD Display and
structions from the MCU, the
magnetic relay will then flip the circuit towards the Door Lock. The Door Lock will then output the Unlock/Lock
signal. The Door Lock can be considered as the physical door lock in the doorframe. The power will be supplied to
ll of the blocks. Figure 2 displays this graphically. This Level 1 design is inspired by the Cytron Industries RFID
However, as the design began to be finalized, there was no longer a use for the magnetic relay and the user
l was left out. These only complicated the installation process. Instead the completed level 1 block diagram
uses a voltage regulator and an amplifier stage to power an electromagnetic lock. These components are much
g a door or doorframe. Using the voltage regulator, we can increase the
Level 2 block diagrams. These diagrams
Arduino connection, and the inverting amplifier. The following modules are
FIGURE 3: LEVEL 2 VOLTAGE REGULATOR BLOCK
The schematic for the voltage regulator can be found from it’s datasheet. However, the values vary from
the datasheet to accommodate the resistors and capacitors owned. The importance of the voltage regulator is for the
door lock. Because the door lock strength is proportional to the voltage across it, the 5V supplied by the Arduino is
insufficient. In order to amplify the output of the Arduino to a higher voltage (9V), a voltage regulator is used to so
that we can power the Arduino with 5V withou
voltage. Theoretically, if an even stronger door lock is desired, the power supply can be switched and one would
only need to re-tune the potentiometer.
In order to test this, a multimet
voltage is measured for the rail is 8.5V. The potentiometer is tuned until the output is exactly 5V. Complications that
occurred is the choice for the potentiometer. The first potentio
(5kohms) is much more effective. However, should a larger power supply be desired, the potentiometer may need to
be switched again to something even smaller in order to achieve a 5V output. As far as the schem
real improvements that can be made. However, a larger power supply may lead to a much more reliable and sturdy
door lock.
FIGURE 4: LEVEL 2 AMPLIFIER BLOCK DIAGRAM
FIGURE 3: LEVEL 2 VOLTAGE REGULATOR BLOCK DIAGRAM
The schematic for the voltage regulator can be found from it’s datasheet. However, the values vary from
the datasheet to accommodate the resistors and capacitors owned. The importance of the voltage regulator is for the
r lock strength is proportional to the voltage across it, the 5V supplied by the Arduino is
insufficient. In order to amplify the output of the Arduino to a higher voltage (9V), a voltage regulator is used to so
that we can power the Arduino with 5V without damaging the board. The potentiometer is adjusted in order to tune
voltage. Theoretically, if an even stronger door lock is desired, the power supply can be switched and one would
In order to test this, a multimeter was used. The power supply was connected to the 9V input. The actual
voltage is measured for the rail is 8.5V. The potentiometer is tuned until the output is exactly 5V. Complications that
occurred is the choice for the potentiometer. The first potentiometer used was too large. the current one used
(5kohms) is much more effective. However, should a larger power supply be desired, the potentiometer may need to
be switched again to something even smaller in order to achieve a 5V output. As far as the schem
real improvements that can be made. However, a larger power supply may lead to a much more reliable and sturdy
FIGURE 4: LEVEL 2 AMPLIFIER BLOCK DIAGRAM
9
The schematic for the voltage regulator can be found from it’s datasheet. However, the values vary from
the datasheet to accommodate the resistors and capacitors owned. The importance of the voltage regulator is for the
r lock strength is proportional to the voltage across it, the 5V supplied by the Arduino is
insufficient. In order to amplify the output of the Arduino to a higher voltage (9V), a voltage regulator is used to so
t damaging the board. The potentiometer is adjusted in order to tune
voltage. Theoretically, if an even stronger door lock is desired, the power supply can be switched and one would
er was used. The power supply was connected to the 9V input. The actual
voltage is measured for the rail is 8.5V. The potentiometer is tuned until the output is exactly 5V. Complications that
meter used was too large. the current one used
(5kohms) is much more effective. However, should a larger power supply be desired, the potentiometer may need to
be switched again to something even smaller in order to achieve a 5V output. As far as the schematic, there are no
real improvements that can be made. However, a larger power supply may lead to a much more reliable and sturdy
10
The Amplifier section is a set of three stages. The components used are the Dual Op-Amp LMC662 and a
2N5183 npn transistor. Because the door lock only runs off a single supply rail, the use of a virtual ground is needed
for in order to properly implement the first stage. The first stage is an inverting amplifier with a gain of
approximately 7 V/V. In order to use the outputted voltage, the second stage is a buffer amplifier to keep the voltage
when applied to the magnetic door lock. The final stage is a current amplifier to boost the current of supplied to the
magnetic door lock at the cost of slightly dropping the voltage (around 0.7V less than the rail of 8.5V).
The stages were simulated, tested, and built in order starting with the inverting amplifier. Although the
objective of the inverting amplifier is to reach the rails of the op-amp when input with 0V. The calculated (or
expected) gain using 6.8kohm an 1kohm resistors are as follows.
V(out) = -6.8V(in) + 7.8V(ref)
The reference voltage is the virtual ground. Typical virtual grounds in single supply op-amps are typically half of the
rail. However, this conflicts as half the rail is nearly the same voltage as the Arduino’s output voltage (4.5V and 5V
respectively). To adjust, the virtual ground is made from the 5V provided by the voltage regulator and supplied to
the Arduino. Furthermore, a 4kohm resistor is used to increase the virtual ground or reference voltage up to
approximately 4V. This helps immensely in the gain. The expected output if not constrained by the rails is 31.2V
(4V x 7.8). This equation’s validity can be confirmed with simulations in LTspice.
FIGURE 4(a): INVERTING AMPLIFIER LTSPICE SCHEMATIC
The rails of the circuit are set to a ridiculous voltage such as 100V in order to avoid hitting the rail with the
simulation. The constant of 7.8V can be seen when finding the gain of the output voltage with difference between
the reference voltage and the input voltage (0V in this case). The output voltage of 31.2V can also be seen when
simulating the data.
The buffer amplifier is very simple and did not require much testing. The input and output were observed
by an oscilloscope in order to confirm that the voltages were the same. An 8.5V outputted from the inverting
amplifier and inputted into the buffer is successfully passed through. The same applies for the 0V case. The initial
design only contained these two components. However, the dual op-amp rail-to-rail chip (LMC662) could not output
the necessary current to power the electromagnetic door lock at 8.5V. When connected, the voltage of the door lock
would drop to 5.5V. In order to fix this issue, a NPN transistor is added to amplify the current at the cost of some
voltage.
The maximum current outputted from the op
the buffer amplifier is connected to the base terminal of the transistor as its input. A resistor of 1kohm was used
connecting the emitter terminal to round. The collector is tied to the 8.5V rail in order to maximize the output.
Although the output drops from 8.5V to 7.8V (standard 0.7V).
Thanks to the gain, you can use a stronger power supply while respecting the op
example, a 12V supply would be ideal in order to maximize the strength while keeping within a safe range for the
op-amp.
FIGURE 5: LEVEL 2 RFID/ARDU
The pins connections for this diagram can be found from reference 13. This is also the source of the
majority of the code that was used. There were some slight tweaks made to allow for an output voltage when a tag
was placed against the face of the RFID. The first change was adding the lines
const int chipOut = 7;
const int led = 6;
These lines set up pins 6 and 7 for their respective roles. The first function was adjusted to reflect these changes.
pinMode(chipOut, OUTPUT);
pinMode(led, OUTPUT); //sets the led as an output
This set those specific pins as outputs. The next function determines what these pins will do when the RFID tag is
placed against the reader.
if (status == MI_OK)
{
digitalWrite(chipOut, HIGH);
digitalWrite(led, HIGH);
delay(10000);
//Serial.println("Card detected");
//Serial.print(str[0],BIN);
drop to 5.5V. In order to fix this issue, a NPN transistor is added to amplify the current at the cost of some
The maximum current outputted from the op-amp is 18mA. Using a common collector BJT, the output of
the base terminal of the transistor as its input. A resistor of 1kohm was used
connecting the emitter terminal to round. The collector is tied to the 8.5V rail in order to maximize the output.
Although the output drops from 8.5V to 7.8V (standard 0.7V).
Thanks to the gain, you can use a stronger power supply while respecting the op-amp’s limitations. For
example, a 12V supply would be ideal in order to maximize the strength while keeping within a safe range for the
FIGURE 5: LEVEL 2 RFID/ARDUINO BLOCK DIAGRAM
The pins connections for this diagram can be found from reference 13. This is also the source of the
majority of the code that was used. There were some slight tweaks made to allow for an output voltage when a tag
face of the RFID. The first change was adding the lines
These lines set up pins 6 and 7 for their respective roles. The first function was adjusted to reflect these changes.
//sets Pin 7 to an output
//sets the led as an output
This set those specific pins as outputs. The next function determines what these pins will do when the RFID tag is
digitalWrite(chipOut, HIGH);
//sets pin 7 to low if the tag is reconized
digitalWrite(led, HIGH);
//sets led to on when tag
delay(10000); //delays 10s for door to relock
//Serial.println("Card detected");
//Serial.print(str[0],BIN);
11
drop to 5.5V. In order to fix this issue, a NPN transistor is added to amplify the current at the cost of some
amp is 18mA. Using a common collector BJT, the output of
the base terminal of the transistor as its input. A resistor of 1kohm was used
connecting the emitter terminal to round. The collector is tied to the 8.5V rail in order to maximize the output.
amp’s limitations. For
example, a 12V supply would be ideal in order to maximize the strength while keeping within a safe range for the
The pins connections for this diagram can be found from reference 13. This is also the source of the
majority of the code that was used. There were some slight tweaks made to allow for an output voltage when a tag
These lines set up pins 6 and 7 for their respective roles. The first function was adjusted to reflect these changes.
This set those specific pins as outputs. The next function determines what these pins will do when the RFID tag is
12
//Serial.print(" , ");
//Serial.print(str[1],BIN);
//Serial.println(" ");
}
else
{
digitalWrite(chipOut, LOW); //sets output to high voltage
digitalWrite(led, LOW);
//turns led off
}
The first line is the check whether the tag is there or not. The MI_OK is defined as 0, which is taken from a few
lines before when the status is determined. If the tag is present, the status becomes 0, which allows for the Arduino
to output voltage to the amplifier circuit. If there is no tag present, the status becomes high, and the Arduino outputs
nothing.
|