Skip to content

Detailed Description of the System

radislavkosijer edited this page Oct 9, 2024 · 1 revision

A more detailed overview of the system, its components, and mechanisms for achieving the required functionalities is given in the following subsections.

  • Sensors, Diodes, and Buzzer

The ADC12 Click generates a voltage at its output that is sensitive to movement above the motion sensor. Optimal sensitivity is achieved by positioning the sensor at a maximum of 15 centimeters from the object of interest (in this case, the ceiling and the upper part of the door). Movement is recognized based on the change in voltage generated at the output. To determine the voltage value that will be generated in conditions where there is no movement (let's call this the resting state), it is necessary to establish the lower and upper measurement limits of the sensor and place the value from the resting state within the obtained range.

Once the basic parameters are set, it is necessary to establish communication with the sensor and act according to its measurements. Since the voltage at the sensor output is analog, a 12-bit ADC is used to convert the analog voltage to digital. The ADC communicates with the Raspberry Pi via I2C communication protocol. What is important is that the 12-bit data on the Raspberry Pi will be converted into 16-bit data, which is easier for representation and manipulation. A driver for the ADC has been written in the kernel, addressing all aspects of the converter's operation—data reception, processing and interpretation of data, and generating necessary actions and responses.

After motion detection, a system of actions is triggered in case the presence of a person in the room is detected. The yellow diode lights up for two seconds, signaling that the process of entering and validating the password has begun, along with a countdown. A screen is displayed for the person to register as an employee or tenant (depending on the application area). In the implemented system, a test replacement application communicates with the user via a command prompt. For practical uses, it would be necessary to either integrate a mechanical-electrical keyboard into the system or some form of a screen where the user could interact with the system.

The user is allowed to enter the password within a defined time interval. Here, it is set to 30 seconds. If the user enters the correct password within this period, the green diode lights up for two seconds, indicating that the password is correct and access is granted. If the incorrect password is entered, the red diode lights up for two seconds. Password entry is allowed until the defined period expires.

After the expiration of the password entry and validation period, the buzzer starts buzzing for ten seconds to indicate an attempted unauthorized access, and a photo is taken with the camera and sent to the head of security.

Manipulation of the used components is carried out through functions defined within the driver for each of them. Thus, the functions read, write, open, exit, release, stop, and start implemented in the driver are called when needed, which is a relatively simple and easily understandable process, suitable for explaining and eventually approaching the end user.

  • Communication and Control Implementation

For the system to function as expected, timely and uninterrupted communication is required.

Direct communication between the Raspberry Pi and the diodes is established through GPIO pins. When it is necessary to turn on a diode, the pin value is directly set to a high logic level. This is enabled by built-in functions within the gpio.h library. Pin mapping is performed through the driver, requiring attention to the pin layout, their configuration for specific operating modes, and so on. Manipulating the state of the diodes is straightforward; it is necessary to call specific, predefined functions and ensure proper resource management.

The same type of communication is used for the buzzer.

In the case of the ADC, I2C communication is utilized. The ADC is connected to ports that deliver data to the Raspberry Pi.

The communication process involves the following steps:

  1. Start Condition: The Raspberry Pi sends a start condition to signal the beginning of a data transmission.
  2. Slave Address: The address of the ADC12 click is sent, indicating which device the Raspberry Pi intends to communicate with.
  3. Register Selection: The Raspberry Pi selects the appropriate register within the ADC12 for reading the desired data.
  4. Data Transmission: The ADC sends the requested data back to the Raspberry Pi. The data is in digital format, allowing for easy manipulation and processing.
  5. Stop Condition: Finally, the Raspberry Pi sends a stop condition to end the communication.

The ADC12 click provides a 12-bit resolution, which the Raspberry Pi can convert to a 16-bit format for easier representation and manipulation. The driver written for the ADC in the kernel manages all aspects of data reception, processing, interpretation, and the generation of required actions and responses. This ensures that the system can efficiently detect motion and respond accordingly.

  • Real-Time Control

The system is designed to operate as a real-time system. For this reason, it must execute within certain deadlines. Specifically, this system can tolerate potential response delays, as the time taken for sending and receiving responses is not of primary importance. To ensure reliability and accuracy, a high-precision embedded timer of the Raspberry Pi is used, which can be started or stopped via system calls. A driver has been written to facilitate the connection through system calls, mapping the functions to be invoked when the user application writes a command to the system file.

  • User Interaction

User interaction in the implemented system is at a low level. For the needs of this system, the interface must be simple and user-friendly, as it only implements password entry.

  • Physical Connection of the System

Figure 2 shows the system diagram, along with the connected components.

system

Figure 2. System in real life