This mobile application constitutes an important part of this project since it is directly related to the radiation mapping visualisation. Up until now the radiation mapping is a procedure which is conducted offline. To illustrate, the operator could carry a hand held measurement device that stores the data in a SD memory card. Upon the completion of the procedure, the researcher could access this memory card by inserting it in a memory reader using a computer. The desired requirement at this point is that the researcher will be able to get the status of the radiation measurement unit and the measurements displayed on a map during the procedure in real-time.
The communication between the iPhone and the measurement unit is accomplished via Bluetooth low energy (LE). BLE is a wireless personal area network technology. It provides considerably reduced power consumption while maintaining a similar communication range with the classic Bluetooth. In addition, using BLE I avoided the process of requesting a specific license from Apple, called MFi (“Made for iPhone/iPad/iPod”), which is required when the classic Bluetooth is employed.
The operation of the measurement is based on an Arduino IDE sketch developed at Interface Analysis Centre (IAC). This sketch was used as a base to build the server-part of my application. The architecture of the sketch, as it was built, was to enable the GPS connection to get the longitude and latitude and then to obtain cps measurements via the USB protocol from the spectrometer. When all the required data were available, the sketch was forming a data entry to the text file stored in the SD card. My task was to maintain the working part while simultaneously integrating the required parts for the iOS application.
The first addition for the measurement unit was to install the BLE shield. After that, the sketch had to change in order to access desired bits of information, form compound packets and send them to the link. The formation of specific data packets was a demand since the payload of the transmitted package has a maximum size of 20 bytes for the given BLE shield (fig.1)
According to the application’s specifications the status of the GPS should be reported. To save space in the messages payload, I encoded the status information in one byte. Consequently, since the GPS lock is an on-off condition, it needs one bit. The remaining 7 bits of the byte are used to report the number of connected satellites. After that, the latitude and the longitude should be represented using 32bits floating-point numbers. To manage this, I break each value to four parts of byte size and I assemble them again in the iPhone side. Moreover, the radiation counts per second is encoded as a two bytes integer. Finally, having formed the payload of the BLE message (fig.2), this message is transmitted to the other side at the end of every cycle.
On the other side there is an iPhone device with the Bluetooth connection
enabled. In order to decode the transmitted messages, a specific library is needed. The manufacturer of the BLE shield has released an appropriate library for this task, called BLE. Using the provided features, the iPhone can search for compatible BLE devices to connect and disconnect with them. When the iPhone has connected to the measurement unit, there is the possibility to measure the RSSI level (Received Signal Strength Indication) and access the contents of the payload. Using the reverse procedure, the iPhone script assembles the primitive data types from the raw bytes and visualises the information using various means.