# The Use of Drones in Spain: Towards a Platform for Controlling UAVs in Urban Environments
## 4 Proposed System
The information is converted to PWM (Pulse Width Modulation) signals, which is the type of information that commercial UAVs understand and allow their control (movements, flight modes, etc.). A schematic diagram of the platform connection for a single UAV can be seen in Figure 1.  
Any number of sensors can be connected to the SBC, which can later be monitored from the platform or from the pilot's control station. The pilot can optionally choose to control the flight using the developed software, which allows for manual control using a gamepad that is much simpler than complex radio stations. The software also makes it possible to program an autonomous flight by previously defining the behavior of the UAV. In addition to the software running on the control base station, as shown in Figure 2a, we have developed the software that the UAV traffic controller uses. In this software, the UAV traffic controller can select which UAV they want to monitor or control individually; they can also use different pre-defined behavioral options, such as stop, landing at source, landing at a defined safety point, and so on. Users can also set the viewing order to be able to see all the connected UAVs on the map, with graphical aids which help to easily determine their height, for example. The system ensures that the aircraft does not access unauthorized locations as this would be an infringement of the law. It also prevents the aircraft from flying to areas with poor connectivity can pose problems of scope. This is done by analyzing the position of the aircraft each time a message is received, and by checking the bounds of the non-permitted zones. When an aircraft approaches these boundaries (between 0 and 20 m), a warning with an icon is displayed both on the pilot's screen and on the controller's screen. If the pilot intends to enter an unauthorized, their movements are ignored. Similarly, in the event that any external force (other than the pilot's orders) moves the aircraft into an impermissible area, the aircraft will be moved straight ahead and automatically from the controller software to the point on the edge closest to its position. All the information transmitted can be recorded and stored by both, the control station used by the pilot and on the control platform (in this latter case it is mandatory). This information is recorded securely and encrypted, in JSON format, and allows viewing all telemetry received from the developed third-party software, in this case only to \"play\" the JSON file as if it were a video, where all the information is presented on an interface that is very similar to that of the flight in real time. Figure 2b shows a screenshot showing the status of all parameters, at a certain time of a past flight. Each message exchanged during the flight of a UAV is encrypted with blockchain technology so that a new message depends on each and every one of the messages sent previously. This is achieved by adding a field in the transmitted message (\(n\)) that consists of a hash obtained from the encryption of the previous message (\(n-1\)). The previous message in turn, will contain in that field the hash obtained from the encryption of the message \(n-2\) and so on until reaching the very first message, which is encrypted from the timestamp of the cloud environment in which the air traffic controller software is deployed. Due to the use of this technique, the system obtains a valid telemetry document. Despite being stored in a plain text it cannot be modified. If one of the values is changed in the \(m\) message, the entire  
Figure 1: Global system connection diagram for a UAV. sequence of messages obtained from that message (from \(m+1\) onwards) will have a visibly incorrect value in the field containing the hash. The transmission mode is based on ACK. If a message is not delivered, the ACK signal is not received from the controller (the pilot does not send ACK messages), so that information is sent again until the ACK message is received.