# Flying Watchdog-Based Guard Patrol with Check Point Data Verification
## 3 Proposed Flying Watchdog Architecture
### Data Communication via Air  
The challenging aspects of laser-based data transmission lie in the alignment procedure and the influence of ambient light. In our research, we devised an algorithm to facilitate automatic calibration, enabling a comparison between ambient and laser light. This comparison is particularly crucial as we employ solar panels as laser receivers. We implemented the Hamming encoder method for efficient data transmission, which processes 8-bit data. Data communication is designed using a laser direct link between the transmitter and receiver. The system employs a 650 nm red laser module with a 5 mW power rating and a 5-10 kHz frequency range. Controlled by an Arduino microcontroller, this communication setup adheres to safety regulations and employs an innovative communication protocol. The laser receiver, powered by a 5.5-volt, 3-watt solar panel, interfaces with the Arduino microcontroller within the PGP system, utilizing a 10-bit resolution Analog DigitalConverter (ADC). The communication protocol is based on a Simplex method using the Universal Asynchronous Receiver Transmitter (UART) serial communications standard, running at 9600 bits per second with a 64-byte First-In-First-Out (FIFO) serial buffer. This article explores the protocol's functionality, analogous to Morse code, where '0' and '1' code data represent 8 bits of information, with start and end bits serving as transmission flags. The drone's laser system will initiate data transmission only after it successfully detects and verifies the PGP. The details of the data communication block diagram can be seen in Figure 6. The procedure for transmitting data via a laser follows a similar principle to conventional serial data transmission through a cable. The laser on the transmitting end remains active for 8 s, allowing the receiver ample time to gauge the laser input voltage. Subsequently, the analog-to-digital synchronization process, which includes start and stop bits, is executed. The communication protocol transmits data as an 8-bit string or array. Conversely, the solar panel, the laser receiver, employs an analog data comparison method. The received data manifest as analog information, with the voltage from the solar panel ascending in correlation with the intensity of the received light. To illustrate, if the solar panel receives light from its surrounding environment and registers a voltage range of 4.1 to 4.2 volts, the laser received by the solar panel will amplify the input voltage by approximately 5%, contingent on factors such as distance and laser power settings. This comparison process is essential for establishing a threshold value and configuring adaptive laser detection through software. This software effectively discerns between laser-generated light and ambient light. When the data received by the PGP system matches the information stored in the database, the IoT-based system integrated with PGP will transmit integer data (e.g., \"325\" indicating the location code from PGP) to the IoT hub. These shared data include a timestamp, as depicted in Figure 6. The PGP system is implemented using an ESP8266 NodeMCU, which boasts Wi-Fi connectivity and is linked to a Thinkboard functioning as the IoT hub for this setup. Communication within the PGP system is facilitated by the MQTT (Message Queuing Telemetry Transport) protocol. Moreover, a scheduling system for data loggers can be devised in more sophisticated IoT systems to accommodate multiple PGP systems. The solar panel serves as the input receiver, and it is linked to the Analog-to-Digital Converter (ADC) within the microcontroller, facilitating the conversion of analog signals into digital ones. The solar panel exhibits sensitivity to incident light, and this investigation aims to elucidate the impact of low-power laser irradiation on the data reception procedure. The proposed system is meticulously devised to calibrate environmental parameters autonomously, including ambient light conditions and laser illumination.