Security System

The Security System project is a simple yet useful real-life scenario application. It uses a Ultrasonic Distance Sensor Module, the Buzzer Module and the RGB LED Module to work like a geniune security system. The system is designed to be activated when there is a movement in designated area.

Project Key Components

  1. SMD

    The SMD acts as a bridge between the script and the modules. It is responsible for interpreting the commands sent by the script and translating them into actions that read input from the Ultrasonic Distance Sensor Module and actuate the visual and audible warning signals.

  2. Ultrasonic Distance Sensor Module

    The Ultrasonic Distance Sensor Module measures the distance between the sensor and an object in its path. It provides distance data to the script for security monitoring.

  3. Buzzer Module

    The Buzzer Module serves as the audible warning. It emits sound when activated when there is an object in the designated area.

  4. RGB LED Module

    The RGB LED Module is used to provide visual warning. It can emit different colors and light intensities as programmed.

  5. SMD Libraries

    The SMD library is at the heart of the application. It communicates with the SMD using a specific communication protocol, sending commands to read the Ultrasonic Distance Sensor Module and actuate the visual and audible warnings, the RGB LED Module and the Buzzer Module.

Project Key Features

  • Distance-based Security Monitoring

    The Security System continuously monitors the distance measured by the Ultrasonic Distance Sensor Module. If the distance of the detected object is equal or closer than the determined distance value, the alert system will be activated.

  • Visual Feedback with the RGB LED Module

    The RGB LED Module displays red and blue lights to indicate the security status. Red lights may represent an alert or danger, while blue lights indicate a normal or safe condition.

  • Audible Feedback with the Buzzer Module

    The Buzzer Module emits a sound when the system detects a potential security threat, providing an audible alert to draw attention to the situation.

Project Wiring Diagram

Getting Started

  1. Hardware Setup

  2. Run the Application

    • Execute the script, initiating the Security System application.

    • Observe the RGB LED Module displaying colors and the Buzzer Module emitting sound based on the detected distance.

  3. Customize Security Thresholds

    • Adjust the predetermined distance threshold in the script to customize the security monitoring levels.

    • Experiment with different colors and sound patterns for the LED and buzzer to suit specific security scenarios.

Project Codes

from smd.red import*
import time
port = "COM13"
m = Master(port)
m.attach(Red(0))

m.scan_modules(0)



while True:
    distance = m.get_distance(0, 1)
    print(distance)
    if distance != None:
        if distance < 15:
            m.set_buzzer(0, 1, 600)
            m.set_rgb(0, 1, red = 255, green = 0, blue = 0)
            time.sleep(0.5)
            m.set_rgb(0, 1, red = 0, green = 0, blue = 255)

        else:
            m.set_buzzer(0, 1, 0)
            m.set_rgb(0, 1, red = 0, green = 0, blue = 0)
            m.set_buzzer(0, 1, 0)

Last updated