Home Security with RF



Dhru Desai, Hector Rodriguez, and I created a device that can lock and unlock a door using RF transmission. The project involves two mbeds: one connected to the RF transmitter, and the other connected to the receiver along with a servo, camera, microSD card, and speaker. The transmitter broadcasts a particular password, and when the receiver sees it the servo is turned to unlock the door. The camera takes a picture every time the receiver is activated and saves the picture to the microSD card.


The device uses a simple rolling code algorithm that runs on both mbeds on startup . The code changes every time the button on the transmitter is pressed and received on the other end. This rolling code prevents code snooping from potential burglars. As an extra security measure, a picture of the unlocking user is taken every time the receiver is activated, so even if an intruder were able to gain access, his or her face would be saved as evidence. Finally, the speaker is used to give audio confirmation to the user every time the door is locked or unlocked.




mbed #1

mbedRF receiverServoCameramicroSDSpeaker
5V=VUpins 4, 5VCC+
GNDpins 1, 6, 7GNDGNDGND
P10pin 2

The speaker and output pin are connected to the transistor as shown here:


The Servo must be connected to an external 4.5 V - 6 V power supply. Remember to tie the grounds together.

The capacitor should be placed in between VU and GND to filter out noise for the RF receiver.

Pin 8 on the RF receiver is the antenna. It helps to have a wire sticking straight up from there.

mbed #2

mbedRF transmitter
VUpin 3
GNDpin 1
P9pin 2

Connect the pushbutton to P20 and GND. No resistors are necessary, as it is debounced.

The RF transmitter's antenna is on pin 4.


Import programRFrec_full

The receiver's code for Home Security with RF

Import programRFtrans_full

The transmitter's code for Home Security with RF

Please log in to post comments.