# An IoT-Based Participatory Antitheft System for Public Safety Enhancement in Smart Cities
## 3 Methods and Materials
### Sensor Operational Modes and Events Sequence  
RedBearLab BLE nanomodule [40] was selected as the BLE prototype platform for the tag sensor. It can operate under a voltage ranging from 1.8 V to 3.3 V, making it able to operate by using a wide variety of battery sources. The BLE device is able to operate in two different modes based on the protocol, i.e., observer (sleep) mode and advertiser (beacon) mode.  
The BLE module runs the appropriate firmware application. Certain developed boards are available, offering integrated environments for developing appropriate firmware applications [41, 42, 43]. BLE should start in central-scanner mode. Whenever a certain advertisement packet is scanned, the device switches to peripheral-advertiser mode. The device can return to the initial state by a reset signal from the owner's mobile. BLE tag device modes are graphically presented in Figure 4.  
* Stealth mode: In this state the device does not transmit at all. Only the authorized user will be able to connect to the tag by using a passphrase. The passphrase is provided to the Authority by the user that reports the theft. The Authority in turn provides the selected app-users and beacons with it, so they can wake up the device. The purpose of this is to prevent non-authorized personnel from accessing the device.
* Beacon mode: In this mode, the device is awake and notifies every mobile app user or gateway of its existence. In this mode, the sensor operates under the optimum current consumption scheme.  
Beacon mode is selected as the default operation mode. When operating in this mode, battery consumption is kept at a minimum.  
Figure 4: BLE tag device modes.  
When the user leaves his/her personal items in a place that is considered to be unsafe he/she can optionally set the device in \"stealth mode\". This is a mode that can receive wake-up signals although it cannot be scanned by other devices. If the specific item is stolen, whilst it is in that mode, a wake-up signal is needed in order to set the device in beacon mode again. Either way to track down the device, the beacon mode is necessitated. A flow chart of the working scheme is illustrated in Figure 5.  
The mobile app interacts with the BLE tag all the time but differs according to the BLE tag's current status:  
* State 1: Tag is in beacon mode--No theft report \(\rightarrow\) no interaction from the mobile app.
* State 2: Tag is in stealth mode--No theft report \(\rightarrow\) no interaction from the mobile app, except if user wants to switch it back to beacon mode.
* State 3: Tag is in beacon mode--Theft report \(\rightarrow\) Authorities send signal to the mobile app to search for the beacon signals (track the tag).
* State 4: Tag is in stealth mode--Theft report \(\rightarrow\) Authorities send signal to the mobile app to activate the tag (switch to beacon mode) \(\rightarrow\) Activation Confirmed \(\rightarrow\) Authorities signal the tracking procedure.  
The BLE tag is equipped with a small sized battery to enable a long duration of autonomous operation. The entire assembly is solid and compact within an appropriate small case to allow for ease and secure installation on bicycles, luggage, etc. Specifically, this case is able to:  
* Contain Antitheft Sensor with the coin cell battery case attached;
* Protect the sensor and the battery from environment factors that could harm the device;
* Make the device compact and easy to install on multiple items of interest (bicycles, bags, etc.);
* Allow the developer to make changes to the software without removing the sensor from the case.