Today we are seeing a rise in electronic security systems placed in everyday objects. At the head of this trend is the shift in home security away from traditional key and lock systems toward new electronic keyless entry. Companies such as Nest and Latch come to mind as leaders in that emerging field. It isn’t just front doors that are getting an upgrade, though, as many other devices are becoming augmented with electronic security tech. Everything from gym lockers to bike locks can be seen making this shift to RFID enabled systems in recent years.
With this project I wanted to demonstrate the
possibility of translating a magnetic RFID signal into the 90-degree rotation
of a cam motor. In the majority of mechanical lock systems today, the
fundamental unlocking mechanism is simply the key’s ability to rotate a cam by
90 degrees, which in turn translates into the unlocking of the rest of the
system. Today we have the ability to replace mechanical lock cams with servo motors
that can be remotely operated and are similar in size. This “unlocks” a world of
possibility in terms of augmenting everyday objects with security, while simultaneously
increasing the ambient nature of that security.
// This #include statement was automatically added by the Particle IDE.
#include <MFRC522.h>
// This #include statement was automatically added by the Particle IDE.
//#include <MFRC522.h>
//#include "MFRC522.h" //obtained from source mentioned above
#define SS_PIN SS
#define RST_PIN D2
Servo myservo;
int led = D5;
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
void setup() {
// Initialize serial communications with the computer
Serial.begin(9600);
mfrc522.setSPIConfig(); // sets up SPI config
mfrc522.PCD_Init(); // Initialize RC522 card
Serial.println("Start Scanning");
pinMode(led,OUTPUT);
digitalWrite(led,HIGH);
myservo.attach(D6); // attach the servo on the D6 pin to the servo object
}
void loop() {
// Look for new cards
digitalWrite(led,LOW);
delay(3000);
if ( ! mfrc522.PICC_IsNewCardPresent()) {
Serial.println("card not detected");
return;
}
Serial.println("New card Detected");
digitalWrite(led,HIGH);
myservo.write(90);
delay(1000);
myservo.write(0);
delay(1000);
digitalWrite(led,LOW);
//Read tapped card data
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
//Dump all card data to Serial
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
Click to Expand
The prototype is hardly at an MVP stage and in a further application would require the system to be remotely controlled and have an auxiliary power source such as a battery. Additionally, my system lacks the capability to distinguish one RFID source from another so I would have to build in a way to distinguish individual signals and determine which one should be allowed to open the device.
Bill of Materials:
1x RFID-RC5222 Scanner
1x TowerPro SG51R Servo Motor
1x Particle Argon Micro-controller (And Particle 2.4GHz Wifi antenna)
1x Green LED
1x 10k Ohm Resistor
14x Jumper Wires
Circuit Diagram: http://fritzing.org/download/
Servo Tutorial: https://docs.particle.io/tutorials/hardware-projects/maker-kit/#prepare-the-servo
A hands-on introductory course exploring the Internet of Things and connected product experiences.
~
January 30th, 2019