Multifunctional Bicycle Helmet Using Internet of Things Technology

1Department of Electronic Engineering, Ming Chuan University, Taoyuan 333321, Taiwan, ROC 2Graduate Institute of Automation Technology, National Taipei University of Technology, Taipei 106344, Taiwan, ROC 3Department of Electrical Engineering, National Ilan University, Yilan 260007, Taiwan, ROC 4Department of Electronic Engineering, China University of Science and Technology, Taipei 115311, Taiwan, ROC


Introduction
The Internet of Things (IoT) (1)(2)(3) is among the most important emerging technologies, allowing novel forms of interactivity between people, between users and their devices, and even between devices. Many of these advances have been predicated on advances in embedded chip technology (e.g., MEMS) aimed at expanding sensor capability and network functionality.
Numerous papers have reported that bicycle helmets can reduce the incidence of head injury by >60%. It has also been estimated that 40% of bicycle-related deaths could have been avoided if the rider had been wearing a helmet. Many individuals are reluctant to wear helmets due to issues of convenience and appearance; however, governments in many regions are making their use mandatory, and helmet manufacturers are seeking to make helmets more attractive by increasing their functionality through the use of smart technology and the IoT. This paper presents a bicycle (4,5) helmet featuring LED direction indicators triggered by the rider tilting his/ her head in the desired direction, LED light bars across the helmet to provide illumination or act as a safety beacon, and a system to alert the rider of vehicles approaching from the rear. A keypad is also provided to input the password for the bicycle lock, and the helmet can send positioning information to a cloud server.
According to an International Data Corporation (IDC) report, the IoT market continues to grow. Volvo, a car manufacturer, will launch a "life-saving" wearable device, a smart helmet, to reduce accidents. Beeinventor is a new start-up company in Hong Kong whose wearable safety helmet is suitable for workers in hazardous environments. After collecting data through the internet upload device, managers can know the physical condition of workers from the cloud system, including whether they fall, faint, or encounter an emergency. The smart motorcycle helmet developed by Life Company can communicate with friends and control the music played through headphones in the helmet during riding through a mobile app. It can also detect abrupt posture changes and collisions. When an accident occurs, it will automatically send an SOS distress signal and coordinates to the emergency contact person. In this paper, considering the situations that many cyclists have to face and how to effectively assist them in such situations, we designed a smart bicycle helmet whose hardware circuit can be divided into a microcontrol core chip, a three-axis accelerometer, helmet light bars with adjustable brightness, an ultrasonic sensor, a pressure-sensitive password lock, and a GPS receiver module. By combining the bicycle safety helmet with the IoT, the added value of the helmet can be greatly improved.
The IoT may have recently been the most popular buzzword in the science and technology field. Chip vendors, software vendors, and venture capitalists have all invested in the huge market of IoT. In addition to the future development of Industry 4.0, the IoT is the most important key technology. Innovation and development based on the IoT is certain to change people's lifestyles. The key to the IoT lies in the innovative idea of integrating existing sensing, network, and computing resources to create new added value. To increase the added value of bicycle helmets, we have integrated a bicycle helmet, GPS module, and IoT, which can query the outdoor positioning coordinates and route of riders on a mobile app or website. We built a set of software called a GPS (6)(7)(8) internet system by PHP dynamic web design and MySQL database management. (9) The software, which can be executed on a web server or mobile phone app, helps riders monitor their positions and the routes they are following. Experiments confirmed the efficacy of the sensor network, helmet-user interactions, and signaling capability.

Hardware Architecture
The proposed system comprises the following modules: a microcontroller chip, a wireless transmission access module with a pressure-sensitive input, an anti-collision warning system, a direction indicator system, and light bars with adjustable brightness (see Fig. 1). The entire system is installed within a helmet. Figure 2 schematically illustrates the overall system, including the hardware (three-axis accelerometer, photoresistor, core chip, ultrasonic sensor, pressure sensor, and GPS module) and software (PhpMyAdmin server with DevPHP used to edit the web interface). Figure 2 presents the core chip used in the helmet (Atmega168) and the peripheral components.

Three-axis accelerometer
As shown in Fig. 1, the LED turn signals on the sides of the helmet are triggered by a threeaxis accelerometer, which detects the rider tilting his/her head in the desired direction.

Light bars with brightness adjustment
The helmet is equipped with photosensitive cells to sense the luminosity of ambient light, which is used to adjust the brightness of light bars running along the length of the helmet.

Pressure-sensitive password input mechanism
A keypad is installed on the helmet for the password input of the bicycle lock. Each key uses four pressure levels (from light to heavy), which are indicated by LED lights of various colors. The pressure must be maintained at the desired level for 3 s, after which an LED flashes three times. Bluetooth wireless transmission is used to send a signal to open or close the bicycle lock. The keypad is shown in Fig. 3. The pressure-sensitive input is used to save space. The pressure sensor is an elastomeric film with resistive material printed on one side and a ceramic film directly in contact with the measured end. Owing to the high chemical stability of the special ceramic, there is no need to increase the protection of the ceramic film.

Wireless transmission
Bluetooth chips allow devices to interact without the need for cables by transmitting data at a frequency of 2.45 GHz. The transmission range is roughly 10 m (0 DBM) to 100 m (20 DBM). Bluetooth uses an asynchronous connection-less (ACL) connection mode with a transfer rate of 721 kbps, with plans for a rate of 12 Mbps in the future. For voice communication, synchronous connection oriented (SCO) connection provides audio transmission of 64 kbps. Figure 4 presents the Bluetooth wireless transmission module (v2.1 + EDR) used in the helmet (50 × 26 × 10 mm 3 ) with 5 V input voltage and automatic pairing after the device is turned on.

Bicycle lock control mechanism
3DMax software was used to design the locking mechanism, which uses a servo motor base and motor-driven rotary fastener. A 3D printer was used to fabricate the prototype, as shown in

GPS module
The proposed system uses a high-performance GPS positioning module (NEO-6MV2) (see Fig. 6) with the following features: (1) a common 3-5 V power supply; (2) a ceramic edge antenna measuring 25 × 25 mm 2 ; (3) EEPROM memory to maintain the system configuration after power failure; (4) a data backup battery; (5) an LED signal indicator; (6) a serial transmission rate of 9600 bps.

Ultrasonic sensor
The ultrasonic sensor used in this system (Devantech SRF05) is shown in Fig. 7. The device features a measurement range of 1-4000 cm and two operating modes. As shown in Fig. 7, mode 1 uses separate pins for trigger input and echo output, whereas mode 2 uses a single pin. The figure on the right shows the status of the mode 1 pin of the SRF05 ultrasonic sensor.

WiFi Wireless Module
This proposed bicycle helmet is equipped with an ESP8266 wireless network module to convert UART signals into WiFi for wireless transmission. This device provides the following  functionality: (1) support for 802.11 B/g/N standards; (2) a built-in TCP/IP protocol supporting multichannel TCP client connections; (3) power consumption of <1.0 mW in standby mode; (4) wake up and transfer of packets within 2 ms; (5) support of rich Socket AT commands; (6) the built-in 32-bit MCU can be used as a microcontroller via a UART/GPIO data communication interface; (7) support for remote firmware upgrades (OTA); (8) support for an access point (AP), an STA (station, workstation), and two types of hybrid AP + STA connection modes; (9) support for a smart link intelligent networking function. Figure 8 shows the appearance and connections of ESP8266. The UART serial communication function of Atmega168 (Tx, Rx) is used to transmit commands. Note that the wireless module was configured to link to the ThingSpeak free cloud server. Table 1 presents the functions and instructions used to connect ESP8266 to the microcontroller.
As shown in Fig. 8, the operating voltage of ESP8266 (3.3 V) matches the voltages of the UART (UTXD and URXD). The UART signal level of Atmega168 (5 V) is adjusted to match the MCU output signal. The input terminal of MCU accepts the 3.3 V alignment signal output from the WiFi module, thereby eliminating the need for a quasi-bit conversion circuit. However, directly connecting the TXD of Atmega168 to the URXD of ESP8266 may burn down ESP8266. Figure 9 illustrates the voltage divider circuit, in which two resistors, 1K and 2K, are used as a voltage divider to generate a 3.3 V voltage.      Fig. 10), where the red box indicates the name of the connecting device, "eek202". • Issuing command [AT+CWJAP = "eek202", "00000000"] connects to WiFi devices using the wireless domain account number (eek202) and password (00000000 There are 67 words between the first "G" and "8"; however, the space before "/" must be counted as a word and the line feed code (0d, 0a) of the space must be added at the end, resulting in a total of 69 words.

IoT
The IoT architecture used in the proposed system is divided into three levels: (1) a perception layer comprising sensors; (2) a network transmission based on the ESP8266 wireless network module; (3) an application layer. We set up a cloud server on a TCP/IP network or mobile communication network using MySQL to obtain GPS satellite positioning information, including UTC time, longitude, latitude, altitude, effective number of satellites, and horizontal positioning accuracy (HDOP) in database form. We built a suite of apps to display GPS information and Google map query services using a dynamic PHP web page with access to the MySQL database to obtain GPS and allow browsing on a web server or mobile phone. We used a Raspberry Pi 3 with the following features: (1) SOC: Broadcom BCM2837 chipset; (2) microprocessor: 4-core, 64-bit arm cortex-A8, 1.2 GHz; (3) display core: dual core VideoCore IV 3D drawing core; (4)  Figures 11-13 show images of the functional components of Raspberry Pi 3. As show in Fig. 14, we used Apache to set up the web server on the Raspberry Pi 3 by installing the MySQL database and setting up a website with PHP. Browsing the web page involves the client side on the left sending commands (HTTP protocol) to request a web page to the server side on the right. Once the web service request is accepted, the corresponding HTML web page file is sent back to the client browser. The PHP interpreter in the server can embed PHP code directly into HTML pages and allow Apache to process it.

Hardware circuit
As shown in Fig. 15, our objective in this study was to design a multifunction bicycle helmet using the hardware circuit in Fig. 16 based on technologies developed for the IoT. As shown in Fig. 16, the sensing capabilities of the helmet are controlled by (1) the Atmega168 chip. The system used to control the bike lock uses (2) ceramic pressure sensors, (3) LED pressure indicators, (6) a Bluetooth transmission module, (10) a Bluetooth receiving module, and (12) a servo-motor-driven lock. The lock secures the rear wheel in a manner similar to an oBike lock, as shown in Fig. 16. (4) A photosensitive resistor is used to measure the luminance of the surrounding environment and adjust (13) the LED light bars accordingly. (9) An ultrasonic sensor detects the approach of cars from the rear in order to alert the rider. LED direction indicators are triggered by (7) a three-axis accelerometer, which senses the rider tilting his/her head in the direction of an upcoming turn.

Turn signals
The three-axis accelerometer detects tilting of the helmet to the right or left. In Table 2, the first row represents the tilt angle, the second row represents the output voltage of the three-axis accelerometer, and the third row represents the digital value (in hexadecimal) output by the 10bit ADC converter. When the tilt angle is zero, the voltage associated with the x-and y-axes is 1.63 V, when the helmet is tilted 30 o to the left, the voltage changes to 1.74 V, and when it is tilted 30 o to the right, it changes to 1.52 V. The analog output signals then undergo ADC conversion in the Atmega168. When the converted digital signal exceeds 016CH, the left signal light flashes five times, and when the signal is less than 013CH, the right signal light flashes five times, as shown in Figs. 17 and 18, respectively.

Light bars
Suitable illumination is essential to one's safety when riding at night. In this study, we installed LED light bars into the helmet to provide illumination and make the rider visible to other vehicles. We also installed devices to measure the ambient light and adjust the brightness of the light bars accordingly. The LED light bars can be programmed to shine a steady beam for illumination or to flash in order to make the cyclist visible to drivers. The light bars are based on a simple circuit involving variable resistors connected in series beneath a photosensitive resistor.   Under 5 V bias voltage, various resistances are applied to produce output voltages ranging from 0.55 to 4.64 V. The output voltage undergoes ADC conversion by the Atmega168 to produce values ranging from 070H to 03AEH. The ADC output is converted into a PWM signal to drive the light strip, such that the brightness of the light bars is proportional to the ambient light level, as shown in Figs. 19(a)-19(d).

Pressure-sensitive input device
In this study, we installed a pressure-sensitive input device to enter a password for the bike lock. In conventional systems, the password is input using a keypad; however, the size of keypads makes them unsuitable for this type of system. We therefore developed an innovative pressure sensor based on a ceramic membrane as an alternative to a keypad. When pressure is applied to the ceramic film, the output voltage (at the mV level) is sent to a differential amplifier circuit with an emitter-follower circuit to avoid the problem of impedance matching. Thus, the output voltage is proportional to the pressure applied by the user. The output voltage is divided into four levels, which are indicated by four LED devices as follows: 0-0.5 V (no LEDs on), 0.5-1 V (first LED on), 1-1.5 V (second LED on), 1.5-2 V (third LED on), 2-2.5 V (fourth LED on). When the password stored in the microcontroller is input correctly, the Bluetooth module in the helmet sends signals to the Bluetooth module on the bicycle commanding the servo motor to open the lock.

GPS and IoT
The prototype was equipped with a NEO-6MV2 high-performance GPS positioning module and high-performance passive ceramic antenna. The module was connected to the Atmega168 core control chip via UART serial communication pins Tx and Rx. The timer in the microcontroller was set to 1 s, and the NMEA code transmitted by the GPS module was read at 9600 bps. Figure 20 presents GPS positioning information received at the Department of Electronics of China University of Science and Technology. To read location information, we select "$GPGGA", which is checked by the microcontroller. Once the alignment is confirmed, the microcontroller reads the UTC time, latitude, longitude, number of satellites observed, HDOP, and altitude. GPS positioning information is stored in the memory and also transmitted via the ESP8266 wireless module to the cloud server established on the Raspberry Pi 3. Using PHP dynamic webpage programming, the GPS positioning information is stored in the database specified by MySQL, and the database form refreshes the data every 5 s. User queries of database contents are handled by the app package "GPS information and Google map query service", which was set up using PHP dynamic web design and MySQL database management and can be accessed via a web server or mobile phone. Figure 21 presents the page displaying satellite positioning information and Fig. 22 presents the Google map query screen.

Conclusions and Directions for Future Research
The multifunctional bicycle helmet developed in this study can be regarded as a wearable device based on technology developed for the IoT. The term "wearable device" refers to a portable device that can be worn on the human body to capture specific information and transmit the data to the cloud. In the future, we will focus on minimizing the size and weight of the system because the weight of the entire system must be borne by the neck of the user.