Cyclist Monitoring System using NI myRIO-1900

. This paper presents cyclist monitoring system that tracks cyclist path and shows the cyclist training condition. Cyclist monitoring system is using NI myRIO-1900 that integrates the sensors and modules and then monitors the cyclist data using Ubidots web interface. In this system, heart rate sensor, magnetic sensor, GPS module and GSM module are connected to NI myRIO-1900. Heart rate sensor was used to calculate the heart rate of cyclist from time to time. Magnetic sensor was attached to the frame of bicycle to calculate the speed of bicycle. GPS module was used to track location of cyclist. GSM modules was used to send SOS message if there has an accident happened on cyclist. At the first, NI myRIO-1900 initialized the state of the GPS signal. After initializing, NI myRIO-1900 received the signal from magnetic sensor and heart rate sensor. After receiving all of the signals from those sensors, the data was uploaded to the GUI in LabVIEW and the web interface that run by Ubidots. The parameters such as speed, heart rate, distance travel and power were displayed on the GUI and Ubidots for cyclist to monitor their condition of body during cycling. The S.O.S button was installed on the bicycle. If the cyclist is in dangerous situation, cyclist can press this button to send the emergency signal to police or the person that is important to them.


Introduction
Cycling is one of five sports that have been in every modern Olympics. It has two different judging elements which are speed and endurance. In 2016, Azizulhasni Awang, a Malaysian cyclist, had created the path for Malaysian in cycling sport while he won the first Olympic bronze medal in Olympics cycling competition.
In fact, the cycling technology is not well developed in Malaysia. They have no complete bicycle monitoring system to train the cyclists. The monitoring system should include cyclists' heart rate, cycling speed, distance travelled, and power consumption during training section in order to enhance cyclists' performance without putting the cyclists in risk of injured [1]. In addition, Global Positioning System (GPS) is another useful system that enables cyclists to send their location when there is an emergency happened. This paper presents a cyclist monitoring system using NI myRIO embeddes device. It enables the athletes to monitor and record their state and condition of their bicycle training. The data can be

Previous Studies
Recently, the cyclist monitoring system was developed in the sports field and it was same in cycling activities, which enable the user to monitor their health, safety and even exercise performance by using Smart phone application.
In 2006, student from Lappeenranta University of Technology generates a cyclist monitoring system that made out of two entities: bicycle sensor module and mobile phone application that enable the exercise and health monitoring. The bicycle sensor module consists of heart rate, pedal and tire sensors that installed onto the bicycle with power sourcing from bicycle dynamo. This collected data which was transmitted to the mobile phone via bluetooth wireless technology. The application in mobile phone enables it to calculate the distance travel, speed, time interval, pulse values and calories burn.
Jose have introduced the control of cycling effort using electric bicycles and mobile device [3]. This system enable the automatic control of pedaling resistance by using smartphone in varies external environment such as oil, water, dust and vibrations from the terrain. The variation of the effort or torque is calculated using exponentially weighted moving average (EWMA) technique. The data was analysed using a smart phone application via bluetooth network connection.
Chris and Frauke proposed Smart e-bike monitoring system (SEMS) which is a safety monitoring system to locate the bicycle position. In this system, a GPS module was used to provide the information of bike's location in each trip. Information such as longitude, latitude, altitude and time can be viewed on the online map. The location of the bicycle was being recorded from time to time is for the safety purposes to avoid bicycle lost and the recorded data can be further monitored for health care purposes.
Antonio and Jose had promoted wireless cycling posture monitoring system that used a sensor module and smartphone via Bluetooth Low Energy (BLE) communication. The sensor module consists of the accelerometers, magnetometers and gyroscopes that enable posture calculation. The sensors module was attached to the cyclist and it provides the trunk and knee angles of the cyclist that transfer to mobile phone via Wi-Fi to calculate the posture in pitch, roll and yaw.
Raluca, Paul and Marimuthu present a wireless monitoring system and performance analysis for professional cycling [1]. In this system wireless motion sensor nodes is placed onto the body of the cyclist and provide the cyclist pedaling movement from time to time. It had been used to improve performance and decreases the injured risk of the cyclist via this monitoring system. When cycling, the characteristics of the cyclist is emphasized in cleat, saddle height and tilt, stem height and length and handlebar height and this data was collected and used to monitor the knee and ankle joints movement to avoid injury happened.
Yoshiaki, Kodai and Hirosyuki generate a road surface condition monitoring system for ensuring the safety cyclist. This system used the ultrasonic distance sensor by emitting and receiving ultrasonic signal that enable the detection of obstacles on the road surface. This monitoring system is divided into two parts which are the data collection using sensor and microcontroller Arduino, and a bluetooth module chip and the application in mobile phone. The transmission and reception of the data take place between the data collecting enable the mobile phone to store and process the data from the sensors and alert the cyclist when an obstacle is detected.
To conclude, the previous project had been made focusing on the wireless data transmission from sensing module to a mobile phone either using bluetooth or Wi-Fi. This data enable the monitoring process in the prospects of health and safety of the cyclist. However there are challenges during the implementation of the system in actual circumference in the environment and this will be discussed in next section.

Existing Challenges
The existing monitoring system is facing problems in the data transmitting itself, power lasting and external environmental conditions.
The communication between the sensors module and the processing module are always in wireless bluetooth and Wi-Fi internet. The signal transmission may lost due to the targeted object are moving. The signal is a in the form of frequency, during the transmission process, the signal may interrupt or degraded by the external factor in the environment like noise (similar frequency profile) signal and long distance data transmission and this situation is considered as signal lost. This problem will bring dangerous to the cyclist when dealing with the safety monitoring [4].
An addition problem is the energy used to power up the sensor module in the bicycle. These sensors module are needed an external power source to operate except the Bluetooth low energy module or using dynamo power generation [3]. This problem occurs because of the sensor unit is not an active unit that can power up themselves. It is similar to the smart phone. The inconsistent of data collection in the monitoring system made this problem to become worst. It is because the sensor need more power to work and generate signals.
Other than that, the external factor especially the weather conditions affect the monitoring system due to the external force applied to the sensor [5]. This problem become significant when dealing with motion detecting sensing. The weather condition like wind and speed direction will either oppose or impose direction which will degrade the quality and reliability of the data collection. It is because this weather condition is able to deteriorate the data recorded due to the present of external force. This problem made the system not giving a precise and correct reading.
In short, the existing bicyclist monitoring system still face with some unsolved problems and it can be improved further in one day. However, the sensors used are also important to ensure the reliability and quality of the data collected.

Methods
Cyclist monitoring system involve the design of hardware and software. It integrates the sensors and wireless platform in order to provide acquire specified data from cyclist. The embedded device National Instrument (NI) myRIO was applied to integrate the sensors and to transmit the specified data to the web application through wireless platform. The performances of cyclist is recorded through Internet of things (IoT) where the meaningful data such as heart beat, cyclist speed, training path and location can be viewed through IoT platform. The chosen IoT platform is Ubidots. The diagram of the overall system is shown in Figure 1. The main parts of the project are heart beat monitoring, speed monitoring, GPS navigation module, GSM module and IoT user interface through Ubidots.
In heart beat monitoring system, an analog heart rate sensor was applied to acquire data. Two heart rate sensors are installed at both of the hand grip of bicycle.
The system enables the speed detection by using magnetic contact switch. This sensor marked every cycle of the wheel rotates. The magnetic contact switch or reed switch act as speedometer of the bicycle to measure the speed of bicycle.
In addition, there was a GPS module use for navigation purposes. It enable the coach to track training path and current location of the cyclist. GPS module was connected to the microcontroller using UART connection. The connection is in a serial communication.
GSM module was attached to the microcontroller for allowing cyclist to send emergency signal to required person.
After the sensors finish data collection, the logging process is started in order to send the data to the website through internet in a specified period. This enable the data are displayed on the computer.
In short, this system enables the users to record down their performance and plan for their training in order to enhance and improve their performance through practices. In this project, the project development is divided into three phases. The phases are circuit design, hardware setup and programming design.

Circuit Design
The circuit design for this system was drawn using Proteus software. The main controller, NI myRIO acts as a brain to the sensors like GPS module, Analog Pulse Sensor, Accelerometer, and Magnetic Contact Sensor. Figure 2 shows the schematic circuit of the system.

Fig. 2. Schematic of Cyclist Monitoring System Design
It shows the circuit design of the sensors with MyRIO. The transmit (TX) and Receive (RX) pins from GPS Module are connected to the TX (pin 14) and RX (pin 10) of MyRIO respectively. The A0 pin from pulse sensor or heart rate sensor is connected to the pin 3 of MyRIO for detecting the changes in analog changes of pulse sensor. The signal pin of magnetic sensor is connected to the D1 (digital input) of MyRIO. SOS button is connected to D0 (digital input) of MyRIO to send SMS alert to a certain number by triggering the GSM module.

Hardware Setup
Once the hardware are installed into a bicycle, the system was ready to record and analysis the data from time to time. All the hardware components like sensors and microcontroller were ready to be configured and drivers are installed. The sensors were connected to expansion port (MXP) connectors of MyRIO. The driver were installed by using compact dish that comes together with the LabVIEW. Figure 3 shows the hardware layout installed in the bicycle.

Programming Flow Chart and Design
The proposed system was designed and constructed using LabVIEW graphical Programming Language which is feasible and user-friendly. LabVIEW is an integrated development environment designed specifically for engineers and scientists. Native to LabVIEW is a graphical programming language (G) that uses a dataflow model instead of sequential lines of text code, empowering you to write functional code using a visual layout that resembles your thought process. This means you spend less time worrying about semicolons and syntax and more time solving the problems that matter. The system programming was constructed based on two different parts which are data collecting and data display. The basic programming flowchart is shown in Figure 4.

Results
Cyclist monitoring system was installed in a bicycle and tested according to a standard procedure. During this process the data recorded was ready and the results is shown on the laptop screen.
This system was fully connected and all the data transmission was sent using WiFi access. The graph was plotted according to the data collected, which was shown in Figure 5. The data collected was based on the sensors range and with its SI units.

Fig. 5. Speed and Heart Rate Versus Time
The result obtained via the cyclist monitoring system by using LabVIEW and Internet of things (IoT). The system performances can be analysed using LabVIEW.
The GPS data shows the actual location of the experiment, it could easily verified by using google map software. With this data, the bicyclists are safe when there is an emergency, they can get help easily by just pressing the 'SOS' button. However, the GPS performance degraded while it is use in indoor or shielded location and it is shown in Figure 6. According to the speed data collected, there is a delay of around 0.5s to 1s while compare to the phone GPS tracking Application. These shows the system is not a real time embedded system yet. However the speed data is valid despite the delay of its performance. This problem is clearly showed in Figure 7.

Fig. 7. Actual Speed Versus Speed Detected
Heart rate sensing is one of the most difficult elements, while cyclist perform the exercise, the heart rate sensor is unable to function well due to the inconsistency of analog signal. The signal collected is needed to undergo a long formula in order to get the heart rate in bmp. Therefore, the heart rate data are not precise and inconsistence.
The myRIO controller performed in the expected requirement. It interfaces all the sensors by receiving the data in a couple of seconds which is around 200ms every circle. Then, it directly transmit the data using WiFi to the required port.
The signal strength of the WiFi system is important in this project. The cycling activities can be done in either indoor or outdoor. However the data for cyclist location for indoor is not valid since the unavailability of GPS signal.
The results from the device are transferred to the web interface that run by Ubidots. The results was obtained from the GPS device, magnetic sensor and heart rate sensor. GPS data logger is a real time application that can track the location of cyclist went and the green path is the road that cyclist went through as shown in Figure 8. Figure 9 shows the dashboard of the Ubidots after login by user. It shows several variables such as GPS data logger, maximum current speed of the day, average current speed of the day, the sum of distance travelled and the sum calories burn of the day.

Conclusions
The system was developed to monitor the cyclist performance in cycle sport especially in Malaysia. There are many previous projects that have the similar with this system. The projects include the smart bike system and bicycle renting system. The previous systems was mainly focus on business purpose. However, this paper presents a system which is designed for monitoring the performance of the cyclist in cycle sport. The contribution of this project is to facilitate the coach and management in cycle sport to supervise their athletes. The data such as heart rate, cyclist speed, training path and location are important data which helps coach to optimise the training load and to record personal best performances. This project exploits the WiFi technology using embedded device platform myRIO by National Instrument. The implementation of Internet of Things (IoT) in this project will reshape the sport industry in Malaysia which emphasize on sporting performance and safety and security of athletes.