RTHMS (1) (AutoRecovered)
RTHMS (1) (AutoRecovered)
RTHMS (1) (AutoRecovered)
Feature 2: Enable preventive maintenance by analyzing sensor data to detect potential issues
early, reducing the risk of unexpected breakdowns and costly repairs....................................................
Feature 3: Ensure vehicle reliability and safety by integrating a user interface that displays real-
time health information and alerts to drivers and fleet managers, facilitating timely
maintenance actions.......................................................................................................................................
Component Level requirements............................................................................................................................
Design:..................................................................................................................................................................
Class Diagram................................................................................................................................................
Low level Test Cases and Traceability to Stakeholder’s Requirements (SRs)..................................................
Project Plan.........................................................................................................................................................
Tasks................................................................................................................................................................
Project deadlines.............................................................................................................................................
Task Assignment..............................................................................................................................................
Software Design..................................................................................................................................................
Sequence Diagram...........................................................................................................................................
Hardware Design.............................................................................................................................................
Activity Diagram..............................................................................................................................................
Block Diagram.................................................................................................................................................
Schematic Diagram in 1D.................................................................................................................................
Schematic Diagram in 3D.................................................................................................................................
Components Used...............................................................................................................................................
Test Cases............................................................................................................................................................
Challenges...........................................................................................................................................................
Code....................................................................................................................................................................
Results........................................................................................................................................................
Conclusion..................................................................................................................................................
Future Work..............................................................................................................................................
References..................................................................................................................................................
Introduction and Market Research
Real-Time Health Monitoring Systems (RTHMS) for automobiles are revolutionizing vehicle
maintenance and safety by providing continuous, real-time data on critical parameters such
as engine temperature, tire pressure, and fuel levels. These systems use advanced sensors,
microcontrollers, and data analytics to detect potential issues early, allowing for preventive
maintenance and reducing the risk of breakdowns. The primary benefits of RTHMS include
enhanced vehicle reliability, improved safety, and increased operational efficiency, making
them a valuable addition to modern vehicles.
The market for RTHMS is rapidly growing, driven by the increasing demand for vehicle safety
and reliability, as well as stringent regulatory requirements. Key players in the market include
Bosch, Continental AG, and Denso Corporation, among others. Technological advancements,
such as the integration of IoT and AI, are further enhancing the capabilities and affordability
of these systems. However, challenges like high initial costs and data privacy concerns remain.
Despite these challenges, the future of RTHMS is promising, with continuous innovations
expected to drive widespread adoption across various vehicle segments.
Problem Statement
Design and develop an automotive embedded system that includes the following features:
Feature 1: Continuously monitor critical vehicle parameters, such as engine temperature, tire
pressure, and fuel levels, using advanced sensors to provide real-time data and alerts.
Feature 2: Enable preventive maintenance by analyzing sensor data to detect potential issues
early, reducing the risk of unexpected breakdowns and costly repairs.
Feature 3: Ensure vehicle reliability and safety by integrating a user interface that displays
real-time health information and alerts to drivers and fleet managers, facilitating timely
maintenance actions.
Business Level Requirement Analysis
Feature 1: Continuously monitor critical vehicle parameters, such as
engine temperature, tire pressure, and fuel levels, using advanced
sensors to provide real-time data and alerts.
Stakeholder Requirements (R1) Business Test Cases / User Acceptance Test Case
R1.1: The system must
continuously collect data from
Verify that the system accurately collects and displays real-
sensors monitoring engine
time data from all connected sensors.
temperature, tire pressure, and
fuel levels.
R1.3: The system must provide an Verify that the dashboard interface is user-friendly and
intuitive dashboard interface for displays real-time health data clearly and accurately.
real-time health status display.
R2.3: The system must integrate Verify that the system integrates seamlessly with existing
with existing vehicle maintenance maintenance schedules and systems.
schedules and systems.
Feature 3: Ensure vehicle reliability and safety by integrating a user
interface that displays real-time health information and alerts to
drivers and fleet managers, facilitating timely maintenance actions.
Stakeholder Requirements (R3) Business Test Cases / User Acceptance Test Case
R3.1: The system must develop a Verify that the interface is easy to navigate and displays real-
user-friendly interface for time data and alerts effectively.
displaying real-time health data
and alerts.
R3.2: The system must ensure the Verify that both drivers and fleet managers can access and
interface is easily accessible to use the interface without difficulty.
both drivers and fleet managers.
R3.3: The system must provide Verify that alerts are clear, actionable, and enable timely
clear and actionable alerts for maintenance actions.
timely maintenance.
Test Case
SR Component Method Input Expected Output
Description
Test reading The returned angle
Engine engine matches the
R1.1 Temperature readTemperature() temperature N/A expected raw
sensor value (e.g.,
Sensor from the
45.0).
sensor.
Verify tire The returned angle
Tire Pressure pressure is filtered correctly
R1.1 readPressure() N/A (e.g.,
Sensor reading
accuracy. 50.0 if no filtering)
Validate fuel The calculated
Fuel Level level sensor angle matches the
R1.1 readFuelLevel() N/A
Sensor accuracy. expected value
(e.g., 15.0)
Test data The control signal is
Data processing for Sample correctly sent
R1.2 Processing processData() sensor sensor data (Require some
Unit accuracy and set MOCK
reliability. to verify)
The headlight angle
Test real-time is correctly
Dashboard health status adjusted
R1.3 displayHealthStatus() N/A
Interface display on the (Require some
dashboard. MOCK
to verify)
Validate The returned
storage of position matches
Test data the expected
R1.4 Data Storage storeHistoricalData() historical data
set actuator position.
for trend
analysis.
The PWM signal
Test displaying
matches the
the system status =
R1.4 User Interface displayStatus(constchar*) expected value
status to the "OK"
based on
driver. conversion.
Test getting
Simulate
input from the The status is
R1.4 UserInterface getUserInput() user input
user - Override correctly displayed
"Override"
mode.
Test getting Simulate The input
input from the user input "Override" is
R1.4 UserInterface getUserInput() correctly received
user - Reset "Reset"
mode. and processed.
Project Plan
Tasks
The whole project can be divided into 4 main tasks based on the features that are implemented:
Project deadlines
Sl. No Task Start Date End Date Status
1 Market Research and 20-5-2024 25-5-2024 Completed
adjusting the problem
statement
2 Finalizing the Features 26-5-2024 31-5-2024 Completed
3 Finalizing the individual 1-6-2024 7-6-2024 Completed
Requirements and
Business Test Cases
4 Individual Implementation 8-6-2024 20-6-2024 Completed
and Component Level
Testing
5 Integration and Testing 21-6-2024 5-7-2024 Completed
Task Assignment
Team Member Task Assigned
Software Design
Sequence Diagram
Figure 1: Sequence Diagram
Hardware Design
Schematic Diagram in 1D
Schematic Diagram in 3D
Components Used
Components used
Figure 5: Final Ciruit (Integrated)
UI/HMI:
Test Cases
Challenges :
Real-Time Data Transmission: Ensuring minimal latency and high reliability in transmitting
sensor data from the STM32 microcontroller to the Python dashboard.
Sensor Integration and Calibration: Integrating and calibrating various sensors with the STM32
to ensure accurate and consistent data readings across different conditions.
Memory and Power Management: Efficiently managing the limited memory and power resources
of the STM32, particularly during continuous data collection and transmission.
User Interface Design: Developing an intuitive and visually appealing Python Tkinter dashboard
that can handle real-time updates without performance issues.
DTC Implementation and Handling: Implementing comprehensive Diagnostic Trouble Codes
(DTCs) for various faults and ensuring accurate diagnosis and error handling.
Code
main.ino
/**************************************************************************** **
* File Name: main.ino
* Description: Embedded C++ Code to simulate Real-time Health
Monitoring System for Automobiles
* Created By: Nikitha, Santhosh, Vignesh, Nanda Kumar
*
* Created Date: 08/06/2024
***************************************************************************** */
/**************************************************************************** **
* Header Files
***************************************************************************** */
#include “FuelLevelSensor.h”
#include “BMP180Sensor.h”
/**************************************************************************** **
* Function Definitions
*/
/**************************************************************************** **
* Name: setup()
* Description: Initialize the sensor readings
* Arguments: None
*/
void setup() {
// Initialize serial communication at 9600 baud rate
Serial.begin(9600);
/**************************************************************************** **
* Name: loop()
* Description: Sensor readings with 1-second delay
* Arguments: None
*/
void loop() {
// Sensor readings processing
checkFuelLevel(); // Check and process fuel level sensor readings
checkBMP180(); // Check and process BMP180 sensor readings
DTC_Codes.h
/******************************************************************************
* File Name: DTC_Codes.h
* Description: Header file defining Diagnostic Trouble Codes
(DTC) for various sensors
* Created By: Nikitha, Santhosh, Vignesh, Nanda Kumar
* Created Date: 08/06/2024
*****************************************************************************/
/**************************************************************************** **
* Preprocessor Definition
***************************************************************************** */
#ifndef DTC_CODES_H
#define DTC_CODES_H
// Define Diagnostic Trouble Codes (DTC) for various sensors
#endif // DTC_CODES_H
BMP180Sensor.h
/******************************************************************************
* File Name: BMP180Sensor.h
* Description: Header file for BMP180 sensor functions and
constants
* Created By: Nikitha, Santhosh, Vignesh, Nanda Kumar
* Created Date: 08/06/2024
*****************************************************************************/
/**************************************************************************** **
* Preprocessor Definition
***************************************************************************** */
#ifndef BMP180_SENSOR_H
#define BMP180_SENSOR_H
/******************************************************************************
* Header Files
*****************************************************************************/
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085_U.h>
/******************************************************************************
* Constant Definitions
*****************************************************************************/
/******************************************************************************
* Function Prototypes
*****************************************************************************/
/******************************************************************************
* Name: setupBMP180()
* Description: Initializes the BMP180 sensor
* Arguments: None
* Returns: None
*****************************************************************************/
void setupBMP180(); // Initializes the BMP180 sensor
/******************************************************************************
* Name: checkBMP180()
* Description: Checks and processes BMP180 sensor readings
* Arguments: None
* Returns: None
*****************************************************************************/
void checkBMP180(); // Checks and processes BMP180 sensor readings
#endif // BMP180_SENSOR_H
BMP180Sensor.cpp
/******************************************************************************
* File Name: BMP180Sensor.cpp
* Description: Implementation file for BMP180 sensor functions
and DTC codes
* Created By: Nikitha, Santhosh, Vignesh, Nanda Kumar
* Created Date: 08/06/2024
*****************************************************************************/
/**************************************************************************** **
* Header Files
***************************************************************************** */
#include "BMP180Sensor.h"
#include "DTC_Codes.h"
/******************************************************************************
* Function Definitions
*****************************************************************************/
/******************************************************************************
* Name: setupBMP180()
* Description: Initializes the BMP180 sensor
* Arguments: None
* Returns: None
*****************************************************************************/
/******************************************************************************
* Name: checkPressure(float pressureValue)
* Description: Checks the pressure values and prints corresponding
DTC codes
* Arguments: float pressureValue - The pressure value to be checked
* Returns: None
*****************************************************************************/
/******************************************************************************
* Name: checkTemperature(float temperature)
* Description: Checks the temperature values and prints
corresponding DTC codes
* Arguments: float temperature - The temperature value to be
checked
* Returns: None
*****************************************************************************/
/******************************************************************************
* Name: checkBMP180()
* Description: Checks and processes BMP180 sensor readings
* Arguments: None
* Returns: None
*****************************************************************************/
// Display temperature
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" C");
FuelLevelSensor.h
/******************************************************************************
* File Name: FuelLevelSensor.h
* Description: Header file for the Fuel Level Sensor
functionalities
* Created By: Nikitha, Santhosh, Vignesh, Nanda Kumar
* Created Date: 08/06/2024
*****************************************************************************/
/**************************************************************************** **
* Preprocessor Definition
***************************************************************************** */
#ifndef FUEL_LEVEL_SENSOR_H
#define FUEL_LEVEL_SENSOR_H
/******************************************************************************
* External Variable Declarations
*****************************************************************************/
/******************************************************************************
* Fuel Level Threshold Values (Analog)
*****************************************************************************/
/******************************************************************************
* Function Prototypes
*****************************************************************************/
// Function prototypes
void setupFuelLevelSensor(); // Setup function for the fuel level sensor
void checkFuelLevel(); // Function to check the current fuel level
#endif // FUEL_LEVEL_SENSOR_H
FuelLevelSensor.cpp
/******************************************************************************
* File Name: FuelLevelSensor.cpp
* Description: Implementation of Fuel Level Sensor functionalities
* Created By: Nikitha, Santhosh, Vignesh, Nanda Kumar
* Created Date: 08/06/2024
*****************************************************************************/
/**************************************************************************** **
* Header Files
***************************************************************************** */
#include "FuelLevelSensor.h"
#include "DTC_Codes.h"
#include <Arduino.h> // Include Arduino framework
/******************************************************************************
* Global Variable Definitions
*****************************************************************************/
/******************************************************************************
* Function Definitions
*****************************************************************************/
/******************************************************************************
* Name: initializeSensor()
* Description: Simulate sensor initialization function
* Returns: bool - true if initialization is successful, false
otherwise
*****************************************************************************/
/******************************************************************************
* Name: setupFuelLevelSensor()
* Description: Initialize the fuel level sensor
* Arguments: None
* Returns: None
*****************************************************************************/
/******************************************************************************
* Name: checkFuelLevelRange(int fuelLevel)
* Description: Check if the fuel level is within the normal range
* Arguments: int fuelLevel - current fuel level reading
* Returns: None
*****************************************************************************/
// Forward declaration
void checkFuelLevelRange(int fuelLevel);
/******************************************************************************
* Name: checkFuelLevel()
* Description: Check fuel level sensor readings
* Arguments: None
* Returns: None
*****************************************************************************/
Dashboard(UI Interface):
Dashboard.py
# Function to read data from the Arduino over the serial connection
def read_data():
try:
if ser.in_waiting > 0: # Check if there is incoming data in the serial
buffer
line = ser.readline().decode('utf-8').rstrip() # Read and decode the
line from the serial port
print(f"Received line: {line}") # Print the received data for debugging
purposes
if "Fuel Level:" in line: # Check if the line contains fuel level data
fuel_value = line.split(": ")[1] # Extract the fuel value from the
line
print(f"Parsed Fuel Level Value: {fuel_value}")
update_fuel(fuel_value) # Update the fuel value on the GUI
elif "Temperature:" in line: # Check if the line contains temperature
data
temp_value = line.split(": ")[1] # Extract the temperature value
from the line
print(f"Parsed Temperature Value: {temp_value}")
update_temperature(temp_value) # Update the temperature value on the
GUI
elif "Pressure:" in line: # Check if the line contains pressure data
pressure_value = line.split(": ")[1] # Extract the pressure value
from the line
print(f"Parsed Pressure Value: {pressure_value}")
update_tire_pressures(pressure_value) # Update the tire pressure
values on the GUI
except Exception as e:
print(f"Error reading data: {e}") # Print any errors encountered during data
reading
root.after(READ_INTERVAL, read_data) # Schedule the function to run again after
a specified interval
# Function to update a given label with new text
def update_label(label, new_text):
label.config(text=new_text)
# Function to resize the background image to fit the window when the window is
resized
def resize_bg(event):
new_width = event.width # Get the new width of the window
new_height = event.height # Get the new height of the window
bg_resized = bg_image.resize((new_width, new_height), Image.LANCZOS) # Resize
the background image
bg_photo_resized = ImageTk.PhotoImage(bg_resized) # Create a PhotoImage object
from the resized image
canvas.create_image(0, 0, image=bg_photo_resized, anchor="nw") # Update the
canvas with the new background image
canvas.bg_image = bg_photo_resized # Keep a reference to the image to prevent
garbage collection
# Function to create a tire pressure row with an icon, label, and value
def create_tire_row(frame, row, column, label_text):
icon_label = ttk.Label(frame, image=icons["tire"], background=FRAME_COLOR)
icon_label.grid(row=row, column=column*3, padx=10, pady=5, sticky=tk.W) # Place
the icon label in the grid
text_label = ttk.Label(frame, text=label_text, style="TLabel")
text_label.grid(row=row, column=column*3+1, padx=10, pady=5, sticky=tk.W) #
Place the text label in the grid
value_label = ttk.Label(frame, text="N/A", style="ValueLabel.TLabel")
value_label.grid(row=row, column=column*3+2, padx=10, pady=5, sticky=tk.E) #
Place the value label in the grid
return value_label # Return the value label for later updates
# Define constants for the intervals at which the functions are called
READ_INTERVAL = 10 # Interval for reading data from the Arduino (in milliseconds)
BATTERY_UPDATE_INTERVAL = 5000 # Interval for updating the battery value (in
milliseconds)
SPEED_UPDATE_INTERVAL = 3000 # Interval for updating the speed value (in
milliseconds)
# Initial calls to start updating the simulated battery and speed values
root.after(BATTERY_UPDATE_INTERVAL, update_battery)
root.after(SPEED_UPDATE_INTERVAL, update_speed)
Conclusion
The vehicle health monitoring system developed in this project provides an effective solution for enhancing
vehicle safety and performance through continuous monitoring of essential parameters. By integrating sensors
with the STM32 microcontroller and utilizing an LCD/OLED display, the system delivers real-time feedback to
the driver, facilitating proactive maintenance and ensuring optimal vehicle operation.
Enhanced Vehicle Safety: Continuous monitoring of engine temperature, tire pressure, and fuel level
reduces the risk of mechanical failures and enhances driving safety.
Real-time Monitoring: The system offers immediate updates and alerts, allowing drivers to take timely
actions to address any detected issues.
User-Friendly Interface: The display interface is designed to be user-friendly, providing clear and
concise information for quick understanding and decision-making.
Overall, the project demonstrates the feasibility and effectiveness of using microcontroller-based systems for
vehicle health monitoring, with potential for further enhancements and integrations in future iterations.
Future Work
To expand the system's capabilities and safety features, consider integrating additional sensors:
Enhance the user interface to provide a more intuitive and informative experience:
oGraphical Representation: Implement graphs and charts to visualize historical data trends for
engine temperature, tire pressure, and fuel level.
o Customizable Alerts: Allow users to set personalized thresholds and alerts for critical
parameters, facilitating proactive maintenance.
o Voice Alerts: Integrate voice notifications to alert drivers about safety issues without
distracting from driving.
o Mobile Application: Develop a mobile app for remote monitoring and control, enabling access
to real-time vehicle health data and alerts.
3. Enhancing Data Processing Algorithms
Refine data processing algorithms to improve accuracy, reliability, and predictive capabilities:
References
The following resources were utilized during the development of this project: