# TrackInk: An IoT-Enabled Real-Time Object Tracking System in Space
## 4 System Development and Evaluation
### Implementation  
The complete hardware construction of the proposed framework is illustrated in Figure 3. The framework is implemented using a Raspberry Pi 4B+ device, 2 standard hobby servos, a Grove GPS Sensor, a DF Robot 10-DOF IMU, a 2-axis Analog Joystick, and an MCP3008 ADC Chip. These components are also connected to a LiPo battery and voltage regulator to enable it to be transported non-tethered. The chosen processing unit device was the Raspberry Pi Model 4B+. This was chosen for many reasons, including its in-built WiFi connectivity, high processing power, vision processing capabilities, ability to plug in display for debugging, and programming purposes [66]. This device can easily interface with all of the sensors, as well as communicate with cloud services to get satellite data and publish it to the visualisation servers for further processing and display of information about the system. The code was implemented in Python with class structures, allowing the corresponding python file to be placed in the working directory and imported from the required program files. Libraries were written for each device and component, allowing for individual component testing, simple system integration, and framework flexibility. A program flow of communication and interactions is depicted in Figure 4. The logical implementation of the system can be seen, where the device first gets information about its environment, decides what to do from there, then finally performs the actions, and does so continuously. The complete implementation details, along with the working codes, are available here [67]. The sensors chosen for this project were an inertial measurement unit (IMU) and a GPS receiver. The IMU contains multiple sensors, including an accelerometer, magnetometer, and gyroscope. The 3-axes of the magnetometer are used to determine which direction the magnetic field is relative to the sensor. The accelerometer is used to determine which direction is down. These two vectors are cross-multiplied to get the east direction, and magnetic North is determined by cross-multiplying east and down. These are used to determine the roll, pitch, and yaw of the system, relative to magnetic north. The IMU readings are read with I2C (Inter-Integrated Circuit) protocols and converted to the proper formats using libraries provided by the sensor manufacturer. The IMU placement was crucial as the magnetometer is very sensitive to magnetic fields and, as such, needs to be far from unnatural magnetic sources, e.g., the servos, as possible. The orientation of the sensor relative to the servos was also compensated for by using an external compass for calibration purposes. Once the IMU was attached to the system, the relative IMU orientation was offset in the program. The GPS receiver allows TrackInk to understand where it is located on Earth, as it requires to know where objects are relative to the device. This is used by the processing unit to perform the correct 3D transformations to accurately determine where the satellites are relative to the system. The GPS device is communicated via a serial connection on a Raspberry Pi. The serial port is accessed where a GPS string can be read. This GPS string is in the form of an NMEA (National Marine Electronics Association) protocol and can be processed by reading the GPRMC values, which contain the time, date, position, direction of motion, and speed information [68]. This GPRMC string is processed into latitude and longitude figures by a library [69]. The input controller utilises two devices: A two-axis joystick with a button and an analog-to-digital converter (ADC). The joystick acts as the input controller, allowing the user to toggle the mode of operation by clicking the button. Once in manual mode, the user can move the servos by moving the joystick in the corresponding direction. The ADC is  
Figure 3: Physical implementation of the proposed ‘TrackInk’ framework with labelled components.