IoT Based System to Measure Vehicle and Driver Parameters

Accountable for performing important maintenance checks and changes in a high-stakes, high-pressure environment, today’s pit crew teamsare termed to be of equal importance as the driver. Assisting the driver at key moments throughout the race, which could be as many as 500 rounds around the circuit, the average pit stop happens over the course of a swift 12-seconds. There’s no room for error as the pit crew’s precision, timing and decision making is crucial to the safety and resulting performance or the driver and the team as an overall. In a race where every microsecond counts, a wrong decision or a mistake by the crew members for a pit stop will certainly change the result of the race. The crew (and the team) makes the decisions based on vehicle and driver parameters such as individual tire pressure, Fuel level, Driver heartbeat/pulse and also the driver’s body temperature. For this project, Team Xelerate plans to implement an on-board system on a moving vehicle that will read, measure and calculate all the required vehicle parameters using sensors. Parameters such as Engine/Shaft RPM, Velocity, Instantaneous Acceleration/Deceleration and many more shall be fed to a Display module which would be mounted on the steering for better access. Also, by incorporating IOT, all necessary parameters (Vehicle and Driver) would be sent to a secure remote server which would be accessible to all crew members in the pit.


Introduction
The Internet of Things is a structure of interconnecteddigital machines, computing devices, mechanical machines, animals, objects, or humans that have unique identities and the ability to transfer data fromone location to another without requiring any form of human or machine contact. At current, Team Xelerate will implement a system to monitor the following parameters over the Internet: Vehicle Parameters that will be measured are Engine RPM, Vehicle Speed, Instantaneous Acceleration / Deceleration, Tire Pressure, Engine Temperature and Fuel Level. Driver Parameters that will be measured are Driver Heartbeat/ Pulse. The layout of the system would mainly comprise of several different sensors mounted at their respective places and a microcontroller which would read the sensor data and perform the necessary calculations. Also, a Wi-Fi module would be attached to the Micro-controller which would be vital in sending data to a specific server in the form of data packets. All of this data can be easily accessed by any crew member from any corner of the world. Based on all this real-time data, the crew can easily make decisions on whether a pit stop is needed and its level of urgency. Also, the crew may be able to sense that the current driver is about to fatigue out and that the driver needs to be changed.

Proposed System 2.1 Components Required
• NodeMCU The SSID and PASSWORD of the network is specified in the code and the NodeMCU will connect to the network on boot-up. Also, it will print the connected IP Address onto the LC Screen. The NodeMCU is responsible to gather all the data from the various sensors, to process it, to perform further calculations (RPM, Speed, Acceleration, etc) and to publish data onto LCD Screen for the driver and to the cloud via the MQTT (Message Queue Telemetry Transfer) Protocol.

Tachometer
Tachometer is a device for calculating the rotary (angular) speed of a rotating object. It is usually confined to electrical or mechanical instruments that show instant values of speed in revolutions per minute, rather than systems that count therevolutions in numbers in a fixed frequency showthe average values for the interval. To measure the rotations of the Go-karts shaft, a reed switch is chosen. When the reed switch [2] is affectedby a magnetic field, the two magnetic pins inside the switch toucheach other and the switch closes. When the magnetic field is removed, thetwo magnetic pins separate and the switch opens. This actsas a great non-contact switch. The reed switch can take up to 1.2A of current. This small, uncomplicated and robust to use module can be used in a various environmental conditions; it operates very dependably in the temperature range of -50°C to +140°C. The Reed switch would be connected to the digital GPIO pins of the NodeMCU. One terminal would be grounded while the other is connected to GPIO D3 with an Input bias and with the internal PULL-UP resistor activated to get precise digital signals (0 and 1) when the switch is actuated by an external magnetic field. In this instance, the tachometer would be constructed using a Reed Switch which is actuated by a simple magnetic field. A small magnet is to be fixed onto the rotating object or shaft and the Hall Effect sensor is to be fixed in anywhere nearto the shaft (perpendicular to the shaft). Whilst the shaft is rotating, the magnet eventually comes in a state where it is perpendicular to the sensor, which would trigger an impulse. The RPM would be calculated using the timer difference between such 2 impulses.
RPM= 60/Time Between Impulses The Tachometer will be used to measure the Engine/Shaft RPM. Additionally, the rear shaft RPM would be used to determine instantaneous vehicle speed. The formula used for vehicle speed can be realized as: Vehicle speed= (18/5) x [(2*π*R*N)/60], in Kmph. Also, using two instantaneous values of velocity, the acceleration or deceleration of the vehicle can be calculated using the formula: Acceleration= [(V2-V1)/t] Here 't' refers to the interval between two consecutive readings.

Engine/Brake Temperature Sensor
For measuring temperature, the DHT11 [3] sensor is being used. The DHT11 is an uncomplicated,cheap and reliable digital humidity and temperature sensor. By usinga thermistor andcapacitive humidity sensor to measure the nearby air, itgives a digital signal on the data pin. It's very simple to use, but requires careful timing to sense data. The sensor would be mounted within the fins of the engine and would measure the engine temperature. Also, if needed the Engine could be shut down by a Kill Switch (MOSFET Device) when the engine temperature exceeds a threshold temperature. The data pin is attached to an I/O pin of the MCU and a pull-up resistor of 5K is used. This data pin gives out the values temperature and humidity as serial data. The DHT11 Temperature and Humidity sensor is connected to the digital GPIO D5 on the NodeMCU. The temperature sensor (DHT11) is limited to around 65-70 degree Celsius, also the engine temperature should be equal to or lower than 60 degrees for optimum performance. Hence, for additional cooling by a natural flow mechanism to provide cooling mechanism. Hence for a mechanical based innovation, Ram air ducts were mounted on each side of the engine.

Tire Pressure and Temperature Monitoring System
Tire-pressure management sensor is a compact programmable electronic sensor, placed in the pressurized region made by the wheel and tire that continuously measures the air pressure inside the tire. The sensor sends the information via a lowfrequency radio wave of 433 MHz to the vehicle's onboard LCD Display screen and on an instrument, cluster located at the pits. Pressure readings are done on pounds per square inch (psi) and temperature readings are done in degree Celsius Also, it illuminates an amber warning light to alert you if one or more tires are low on air. Each individual sensor is mounted on its respective wheel with a fastener and a theft-proof locking nut. The display module would be responsible to continuously display the individual tire pressure and temperature for the pit crew to analyse. The display module is powered by a rechargeable battery (through USB Supply or by Solar Charging). Each individual sensor has an in-built lithium-ion battery pack.

Pulse Sensor (KY 039)
The KY-039 [4] is a Heartbeat Measuring Sensor Module usuallyused for detecting pulse form fingers. It uses a phototransistorand abright infrared LED to detect the pulse of the finger, with each pulse a red LED flashes. The phototransistor is one side of the finger, and the LED on the other side of the finger. The LED being on the light side of the finger. The phototransistor is used to obtain the flux emitted, when the blood pressure changes a pulse by the finger causes the resistance of the phototransistor to be changed. The KY-039 sensor will be giving an 8-bit analog output through its output data line. This would be connected to the Analog GPIO A0 of the NodeMCU. However, the NodeMCU analog pin runs on a 10-bit architecture and hence, the input values will need to be halved before it is transmitted to the web server which would be accessible to the crew members.

20x4 LCD Display with I2C Module
A 20x4 LCD [5] display is an uncomplicated and robust module. It is used in many devices, systems and circuits. The 20x4 LCDis preferred over other multi segment LEDs. The reasons being: it is easily programmable;LCDs are economical; have no limitation of displaying special and custom characters animations and so on. A 20x4 LCD can display 20 characters per row and 4 characters per column. The LCD displays each character ina 5x7 pixel matrix. The LCD has two registers, Data and Command. The module works on a 5V operating voltage and has a 16-pin single board integrated circuit. However, to reduce connections from the LCD to the MCU, an I2C (Inter-integrated Circuit) connected to the LCD to reduce the 16 pins into 4 simplified pins, which are to be connected as follows onto the NodeMCU:

Flow Sensor
The sensor YF-S201 [6] Water Flow Measurement meter with 0.1-30 Litre/min measuresflow rate in black colour. This sensor is connected in series with thefuel line and consists of a pinwheel sensor to measure the quantity liquid that has moved through it. There's a magnetic Hall Effect sensor that outputs an electronic pulse with every rotation of the pin wheel. The Hall Effect sensor is kept away from the pipe and which allows the sensor to be safe. By summing the pulses from the output of the sensor, you can simplyrecord water flow. Each pulse is roughly. measured to be 2.25 millilitres. The YFS201 is a 3-pin package and include a Vcc pin, GND pin and an OUTPUT pin.A 5V supply is to be provided across the Vcc and GND pin and the OUTPUT pin is to be connected to the digital GPIO D6 of the NodeMCU. When flow occurs through the sensor, the output will be a train of digital pulses (0 and 1). This would trigger a predefined interrupt function which would count the total number of triggers. Hence, the total flow (in ml) can be calculated by multiplying 2.25 and the number of triggers occurred in a set time period. Similarly, the percentage fuel left can be calculated and would be displayed on the LCD Module for the driver and will also be transmitted to the private web server for the pit crew to view.

Circuit Diagram
Initially, for testing purposes all the connections were done by raw wires connected to the NodeMCU to ensure the sensitivity of the sensors and to properly interface each individual device and to transmit the data onto the Web Server. After finalizing the connections of each sensor and their respective places on the Go-Kart, some PCB designs were implemented for optimization of the MCU and to prevent the loosening of any connected wire in a running Go-Kart.

Fig.2. PCB design 1
A 7805 Voltage regulator is attached to reduce the input 8V to a constant and steady 5V for the input supply of the NodeMCU and the Sensors. Also, for convenience a flip to ON switch to turn on the system when needed only. The PCB also contains 3 transistors and 3 diodes to amplify the input signal from the NodeMCU (3.3V) to 5V and to multiplex 3 separate sensors onto a single Analog GPIO A0. However, this PCB had some issues and the multiplexing circuit was simplified and was reduced in the code itself.

Fig.3. Modified PCB
The final PCB was tested and had no issues. Also, an additional PCB was printed (right) for the proper mounting of the Reed Switch below the shaft to prevent any unwanted movement due to engine vibrations. Also, copper holes would be provided for drilling operations to be done for ease in mounting.

Web-Server Design
Initially a web page was created using basic HTML Programming based on the connected IP address by the NodeMCU. When connected to the internet, the NodeMCU would send the IP Address of the connected network to the LCD Module. However, the designed web-page had a major drawback; its range was limited to the local network. It basic words, the webpage would only be accessible on the same network which the NodeMCU is to be connected to. This orientation is only possible on a Wide Area Network; hence the web server was changed and an open-source platform ThingsBoard was used.

Things-Board Server
The Things Board server accepts raw data at a steady rate, and has a minimal delay time of approximately half a second. Also, this web server is global and can be accessed by any crew member with the appropriate login credentials.

Fig.6. Things-Board dashboard
The final dashboard is customizable as follows and widgets can be added to present the data in a suitable manner.

Conclusions
The final system was implemented and was properly fitted into the vehicle. As a safety measure, the entire system has a separate power supply and is not powered by the Go-kart battery or by the engine alternator. The IOT based system is completely detachable and can be removed and installed into the Go-Kart with ease. The system was tested and the sensors were finely calibrated for optimum performance. The web server is easily accessible and the raw data flow rate is adequate. There is a very minor delay in data transmission and the IOT system does not require the best of internet connections as only a few data packets are to be sent every second.