1 Introduction

The increasing number of fatal road accidents poses a critical challenge in daily transportation within smart cities. This increase can be attributed to factors like reckless driving, distracted driving, driving under the influence of drugs or alcohol, and poor road conditions, causing physical, emotional, and financial harm to those affected. Prioritizing road safety in smart cities involves following traffic rules, maintaining vehicles, and driving responsibly (Yuvaraju et al., 2021). Studies have shown a growing frequency of road incidents due to negligent driving, distracted driving, driving while intoxicated, and inadequate road maintenance, highlighting the critical need to adhere to traffic regulations and ensure responsible driving (Yuvaraju et al., 2021). The study conducted by (Singh & Bera, 2018) points to driver errors, such as speeding, fatigue, and alcohol consumption, as major causes of road accidents, emphasizing the collective responsibility of society to improve infrastructure, enforce stricter laws, and raising awareness about the dangers of reckless driving. To prevent accidents caused by drowsy driving, monitoring the driver’s level of fatigue is essential, and technological advancements like driver monitoring systems with eye blink sensors are deployed to detect signs of drowsiness and provide timely warnings to drivers (Kamran et al., 2019; Selvaraj & Umakanth, 2021).

Expanding on the endeavors to enhance road safety and transportation within smart cities using the more advanced applications of the Internet of Things (IoT) (Bibri, 2018, 2020) and Artificial Intelligence of Things (AIoT) (Cui & Lei, 2023; Gong et al., 2023; Priya & Saranya, 2023)). Alam et al. (2019) propose a vehicle safety framework integrating various sensors to detect driver drowsiness, speeding, and alcohol consumption, thus mitigating the risk of road accidents. The system includes an eye blink sensor installed in the driver’s temporary glasses to detect drowsiness and trigger alarms when necessary (Alam et al., 2019). Moreover, ensuring road safety extends beyond individual vehicles. Calculating and displaying the speed of other vehicles in front and behind is of equal importance to avoid collisions. Ultrasonic sensors emitting ultrasonic waves are utilized to determine the distance between vehicles and facilitate a safer driving experience (Odat et al., 2017). To combat the prevalence of drunk driving, smart city initiatives incorporate alcohol sensors, like the MQ3 alcohol sensor, coupled with an Arduino controller. The system ensures that a driver exceeding the legal alcohol limit is prevented from starting the vehicle’s motor, while also alerting authorities for timely assistance (Prasad et al., 2022; Siva et al., 2022). Emphasizing seamless communication among vehicles, smart cities leverage Vehicle to vehicle (V2V) communication and the revolutionary Light Fidelity (Li-Fi) technology. V2V communication reduces traffic congestion and prevents accidents, while Li-Fi, uses the visible light spectrum for data transmission, and offers secure and efficient communication between connected cars (Mamikandan et al., 2022). In a nutshell, smart cities harness technological advancements to revolutionize road safety. In this context, the integration of emerging AIoT and related sensors and devices for enhancing decision making and automation processes across various domains of smart cities (Bibri et al., 2023a, b) point to promising opportunities for developing innovative vehicle safety frameworks, transforming urban mobility and making the transportation ecosystem safer and more efficient for all road users.

In recent years, the urgent need to modernize and enhance urban mobility systems has led to the adoption of Artificial Intelligence of Things (AIoT) in smart city transportation (Cui & Lei, 2023; Gong et al., 2023; Priya & Saranya, 2023). The integration of AIoT emerges as a revolutionary force for enhancing transportation safety. It addresses the multifaceted challenges of population growth, traffic congestion, environmental sustainability, and safety concerns that cities worldwide are grappling with.

Large volumes of real time data can be gathered from IoT devices embedded in different components of the transportation infrastructure thanks to AIoT. City planners and authorities can optimize traffic flow, control congestion, and improve overall transportation efficiency, leveraging the actionable insights derived from AI driven data analysis for informed decision making. AIoT makes it easier to analyze past and current data to forecast traffic trends, spot bottlenecks, and proactively manage traffic flows by utilizing advanced AI algorithms, especially Machine Learning (ML) and Deep Learning (DL), and predictive modeling. This capability plays a pivotal role in averting traffic jams and guaranteeing a more efficient transportation network across the city (Siddiqui et al., 2021).

The development of intelligent infrastructure that adapts dynamically to shifting traffic conditions is made possible by AIoT. For example, smart traffic lights can optimize signal control and reduce delays by adjusting timings based on real time traffic data.

By providing predictive maintenance for vehicles, optimizing routes based on demand patterns, and boosting the general dependability and efficiency of public transit systems (Alahi et al., 2023), AIoT aids in improving the services provided by public transportation. A smooth link between various forms of transportation, including bicycles, buses, trains, and ride sharing services, is made possible by the integration of AIoT. A more comprehensive and linked transportation network is made possible by this integration, providing residents with a variety of effective travel options (Zhang et al., 2023).

Through the implementation of intelligent surveillance systems, predictive analysis of accident prone regions, and real time traffic situation monitoring, AIoT plays a critical role in improving safety. This preventative measure helps to lower accident rates and guarantee commuter safety (Wu et al., 2020). By encouraging electric and hybrid vehicles, advocating traffic patterns that minimize emissions, and supporting projects for sustainable urban transportation, AIoT can help bring environmentally friendly practices into reality. AIoT can help bring environmentally friendly practices into reality. AI and AIoT offer a multitude of benefits in transportation services and infrastructure, as evidenced by numerous studies. (e.g., Abduljabbar et al., 2019; Iyer, 2021).

The justification for this study lies in the urgent need to address the escalating challenge of road accidents within smart cities. Despite advancements in technology and various safety measures, the frequency of fatal accidents continues to rise, posing significant risks to public safety and well-being.

Understanding the potential of AIoT in enhancing transportation safety offers a compelling avenue for mitigating these risks and improving urban mobility. Against the backdrop outlined above, this study aims to enhance next generation smart city transportation safety by developing a Li-Fi enabled vehicle safety framework. This framework integrates various sensors, such as eye blink, ultrasonic, and alcohol sensors, to detect and address critical issues in daily transportation within smart cities, including driver drowsiness, speeding, and alcohol consumption, thereby mitigating the risk of fatal road accidents. To guide our investigation, we undertake the following objectives:

  • To design and implement an AIoT based vehicle safety framework tailored for smart cities, integrating eye blink sensors for prompt detection of driver drowsiness and alerting the driver using a buzzer.

  • To deploy ultrasonic sensors to measure the speed of surrounding vehicles and provide real time information to the driver, contributing to the seamless flow of traffic within smart city environments.

  • To incorporate an alcohol sensor that efficiently detects the driver’s alcohol levels and, when high alcohol content is detected, automatically limits the vehicle’s, ensuring responsible driving practices and alerting concerned authorities for swift action.

  • To optimize inter-vehicle communication within smart cities through the utilization of Li-Fi technology, facilitating faster and more efficient data transmission via visible light communication (VLC) using light emitting diodes (LEDs), and fostering enhanced connectivity between connected vehicles.

  • To proactively mitigate road risks, enhance overall transportation safety and create a sustainable and intelligent urban environment where smart vehicles coexist harmoniously within smart cities.

Based on these objectives the following research questions can be formu lated to guide this study.

  • How can eye blink sensors be effectively integrated into a vehicle safety framework to detect driver drowsiness and alert the driver promptly?

  • How can ultrasonic sensors be deployed to measure the speed of surrounding vehicles and provide real time information to enhance traffic flow within smart city environments?

  • How can an alcohol sensor be efficiently incorporated into the framework to detect the driver’s alcohol levels and limit the vehicle’s speed automatically when high alcohol content is detected?

  • How does the utilization of Li-Fi technology optimize inter-vehicle communication within smart cities, enabling faster and more efficient data transmission via VLC using LEDs?

  • How does the AIoT implementation of the proposed vehicle safety framework enhance road safety within smart cities, proactively mitigating road risks and improving transportation safety for all road users?

In light of the research objectives drawn from existing literature and the research questions arising from identified gaps, we are driven to address the challenges within this domain. The significant contributions of this study are outlined as follows:

  • Development of an AIoT enabled comprehensive vehicle safety framework that integrates multiple sensors to detect driver drowsiness, speeding, and alcohol consumption, effectively mitigating the risk of road accidents.

  • Implementation of an eye blink sensor in the driver’s temporary spectacles, allowing for the detection of driver drowsiness and providing timely alerts through a buzzer to prevent accidents.

  • Integration and configuration of ultrasonic sensors to accurately measure the speed of surrounding vehicles, enhancing collision avoidance capabilities.

  • Detects the driver’s alcohol consumption limits the vehicle’s speed automatically, and updates the information to authorities.

  • Application of innovative Li-Fi technology for communication between connected vehicles, enabling faster and more efficient data transmission through VLC, thereby improving overall road safety.

The study is structured as follows: Section 2 shows the conceptual background definition of the key terms involved in the smart city research platforms. Section 4 provides an overview of related works, presenting the existing literature and research relevant to the proposed framework. It outlines the background information, identifies the need for such a framework, and addresses gaps in the current literature. Section 5 describes the proposed autonomous speed detection and accident avoidance framework in detail. Section 6 presents the results of the framework’s implementation and its effectiveness in enhancing transportation safety. It outlines the methodology used in the experiments and discusses the results obtained from the developed hardware module. Finally, Section 7 concludes and summarizes the key findings and contributions of the proposed framework.

2 Conceptual definitions

This section delves into the foundational understanding of smart cities, encompassing their defining characteristics, inception, and the driving forces behind their emergence. It offers an insightful overview of the conceptual landscape of smart cities, laying the groundwork for a more in depth examination of their pivotal role in advancing transportation safety through AIoT.

The concept of smart cities has attracted considerable attention as a promising solution for addressing urbanization and sustainability challenges. Multiple efforts have been made to define smart cities, resulting in a variety of interpretations and developmental directions (e.g., (Singh & Singla, 2021; Toli & Murtagh, 2020)) 2020 has evolved over the last two decades, with its roots tracing back to the 1970s, and it was not until 2010 that it gained significant attention with the support of the European Union for smart city projects (Bibri, 2019). In essence, a smart city incorporates state of the art technologies and data driven approaches to optimize urban operations, enhance resilience, improve quality of life, and foster sustainability (Mishra et al., 2022). However, the inclination of smart city initiatives to prioritize economic gains over environmental and social aspects (Ahvenniemi et al., 2017; Evans et al., 2019; Toli & Murtagh, 2020) has emphasized the necessity for greater focus on research and practical endeavors aimed at achieving the environmental and social objectives of sustainable development (Sharifi et al., 2024). In this evolving landscape, smart cities are increasingly embracing and leveraging AI and AIoT to tackle complex challenges (Bibri et al., 2023a, b; Efthymiou & Egleton, 2023; Gourisaria et al., 2022; Zaidi et al., 2023), with related solutions emerging as a pivotal force in shaping their development practices and trajectories. Among the core features of a smart city relevant to this study include:

  • Technological integration: Smart cities heavily integrate information and communication technologies (ICT) into their infrastructure, services, and governance processes.

  • AIoT: They apply this technological framework that seamlessly integrates AI models and algorithms into IoT networked sensors and devices. This integration holds the transformative potential to fundamentally reshape how we perceive, interact with, and manage transportation systems in their entirety.

  • Data analytics: They leverage the vast amount of data generated via IoT sensors and devices and the processing and analytical capabilities of AI to generate meaningful insights for enhanced decision making processes.

  • Efficiency: They aim to enhance the efficiency of urban operations, infrastructure, and services, resulting in optimized resource utilization, improved service delivery, and reduced environmental impacts.

  • Resilience: They prepare for and respond to challenges such as natural disasters and climate change by building resilient infrastructures and systems.

  • Livability: They improve the quality of life for their residents by creating safe, comfortable, functional, and community oriented urban environments.

  • Smart Transportation: They integrate advanced technologies and data driven solutions to optimize and enhance the efficiency, safety, and sustainability of transportation systems.

  • Li-Fi enabled vehicles: They enable high speed wireless communication between vehicles and infrastructure through visible light signals that enhance vehicle to vehicle and vehicle to infrastructure connectivity.

  • Light emitting diodes (LEDs): They embed energy efficient and sustainable illumination in streets, traffic signals, and public spaces. They also enable cost savings, and longer lifespan, with the ability to integrate with smart systems for adaptive lighting control, enhancing safety and reducing energy consumption in urban transportation.

Worth noting is that defining a smart city precisely remains challenging, as there is no universally agreed upon definition. Different perspectives and objectives lead to varying definitions and approaches to smart city development (e.g., (Singh & Singla, 2021)). Regardless, smart cities are at the forefront of urban innovation and actively seeking ways to address the challenges of urbanization while improving the well-being of their residents.

3 A novel conceptual framework: artificial intelligence of smart city things in transportation

The integration of AI with IoT has given rise to a transformative paradigm known as AIoT. This convergence finds numerous applications and profound implications, especially in smart city domains, including transportation and its safety (Alahi et al., 2023; Bibri & Jagatheesaperumal, 2023; Bibri et al., 2023a; Puri et al., 2020; Zhang & Tao, 2020). The conceptual framework presented here aims to elucidate the technical components of integrating AIoT within the realm of smart cities, with a specific focus on enhancing smart transportation systems, including safety considerations. It is crucial to note that this study is one of the initial endeavors to introduce the conceptual framework of Artificial Intelligence of Smart City Things in the context of transportation safety. The underlying technical components are derived based on two studies conducted by (Bibri & Jagatheesaperumal, 2023; Bibri et al., 2024).

Sensing devices and data acquisition: Smart transportation begins with a dense network of sensing devices, such as cameras, sensors, and GPS units, embedded in the urban environment and transportation infrastructure. These devices continuously collect real time data on traffic patterns, vehicle movements, environmental conditions, and safety related events.

3.1 Communication infrastructure

A robust communication infrastructure, including low latency networks and protocols, facilitates seamless data transmission between edge devices and centralized systems. Communication technologies like 5G enhance the responsiveness and reliability of smart transportation systems, ensuring timely safety related communication.

3.2 Edge computing

Edge computing plays a pivotal role in processing data closer to the source, reducing latency and enabling real time decision making. Edge nodes are strategically positioned within the transportation network, processing sensor data, extracting relevant information, and addressing safety related concerns.

3.3 Fog computing

Fog computing brings computation and data storage closer to the edge, enhancing the efficiency of data processing for time sensitive applications in smart transportation, including safety monitoring. Fog nodes strategically positioned within the transportation network process sensor data in near real time.

3.4 Cloud computing

Cloud computing provides scalable and centralized data storage and processing capabilities for handling large datasets generated by smart transportation systems. Cloud servers support intensive data analytics and machine learning tasks, contributing to the overall intelligence of the system, including safety related predictive analytics.

3.5 Data analytics and ML

Centralized data analytics platforms employ ML and DL algorithms to analyze vast datasets. Predictive analytics models not only forecast traffic congestion but also identify potential safety hazards and patterns, contributing to the efficiency and safety of smart transportation.

3.6 Data driven decision making systems

AI driven decision making systems interpret the analyzed data to make intelligent decisions. These systems can dynamically adjust traffic signal timings, reroute vehicles based on real time conditions, optimize public transportation schedules, and prioritize safety measures.

3.7 Safety monitoring and response

Dedicated AI algorithms monitor safety related events, such as accidents or abnormal driving behavior, triggering immediate responses. Automated safety measures, such as real time alerts to authorities or adaptive speed controls, enhance overall transportation safety.

3.8 User interfaces and applications

User interfaces and applications provide a human centric interaction layer for both administrators and the public. Mobile apps, dashboards, and public displays offer real time information on transportation status, alternative routes, and safety advisories.

The technical components of AIoT framework are distilled based on the extant literature on AIoT architectures (Bibri et al., 2024; Seng et al., 2022; Yang et al., 2020a, 2020b; Zhang & Tao, 2020). These embody a powerful framework that seamlessly integrates the computational and analytical power of AI with the ubiquitous connectivity of, and the abundant data generated by, IoT. In the context of transportation systems and their safety, the role of edge computing particularly becomes apparent within the framework of AIoT. Specifically, the importance of edge computing lies in facilitating the relocation of data processing closer to the network edge, optimizing proximity to the IoT devices associated with transportation systems. This strategic placement enhances the efficiency of AIoT driven transportation systems by leveraging edge intelligence, a crucial aspect for implementing cutting edge AIoT solutions aimed at the planning of safe and intelligent transportation within smart cities.

The conceptual framework outlined above positions AIoT as a pivotal enabler of smart transportation and sustainable mobility, with a strong emphasis on enhancing safety. By integrating cutting edge technologies, such as AI, ML, DL, IoT, edge computing, fog computing, and cloud computing, and advanced communication, this framework establishes a foundation for responsive and proactive decision making based on real time data analysis, addressing not only traffic flow but also safety concerns. The integration of the components of AIoT optimizes transportation efficiency as well as enhances the overall safety experience for drivers.

Moreover, the conceptual framework draws on existing literature to validate its technical components. The integration of computing models aligns with the decentralized and distributed processing trend in AIoT architectures, while the emphasis on communication infrastructure and 5G reflects current research on the connectivity needs of advanced smart city applications. Additionally, the application of predictive analytics in transportation, including safety related events, mirrors recent advancements in AI driven models for traffic prediction and safety monitoring. The conceptual framework presented lays the groundwork for the implementation of AIoT in smart transportation beyond this study, contributing to the broader discourse on the groundbreaking convergence of AI and IoT in the context of smart cities, with a focus on enhancing transportation safety.

4 Related works

In recent years, several studies have been conducted to investigate autonomous speed detection and accident avoidance frameworks for connected vehicles. In this section, we review the related works in this area, with a focus on Li-Fi enabled vehicle frameworks. We highlight the advantages and limitations of existing systems and identify the research gaps that need to be addressed in future studies.

Kabir et al. (2020) has developed a smart car management system that aims to reduce traffic accidents. The system consists of three key components: an overload detector, an alcohol detector, and a sleep detector. If the sleep detector detects drowsiness in the driver during the drive, the engine will slow down, and the buzzer will beep. The alcohol monitor determines the driver’s intoxication level, and if it exceeds the threshold, a message is sent to the control center, and the vehicle will not start. The overload detector senses the car’s weight, and if the passenger weight exceeds the limit, an alert will sound, and the engine will slow down. However, there may be errors in the optimization process of the high level computer languages used to process the images for drowsiness detection. Additionally, the use of sensors may cause variations in precision. To enhance the system’s efficiency, incorporating speed detectors and other detectors may be necessary.

Gowri et al. (2019) have developed a system that detects accidents and drowsiness. The system includes four sensors: a vibration sensor, an eye blink sensor, and two heart rate sensors. These sensors work together to detect mishaps. In addition, the system incorporates GSM to send a message and GPS to inform the driver’s relative in case of an accident or unusual situation. However, the heart rate sensor’s occasional inaccurate measurements may affect the data’s average and cause problems.

Kinage et al. (2019) have proposed a system that prevents car collisions using various components, including an Arduino, MQ sensor, infrared sensor, accelerometer, and webcam. The MQ3 sensor detects alcohol intake, while the infrared sensors monitor the driver’s eyes to detect drowsiness. The accelerometer tracks head movements, and the OpenCV software counts the number of mouth yawns. If the number of observed yawns exceeds a threshold, the driver receives a voice message. Furthermore, the system uses an ultrasonic sensor to detect speed bumps on the road. This approach provides a practical solution to the increasing number of accidents.

Khan et al. (2019) have developed an Intelligent Autonomous Accident Prevention, Detection, and Vehicle Monitoring System to prevent accidents. The system includes a black box and a post accident rescue system. Ultrasonic sensors are used to detect vehicles and obstacles, and the system is notified accordingly. Gas sensors detect engine performance, carbon monoxide, smoke, and compressed gas leaks and transmit the information to a display. The accelerometer monitor detects accidents. GSM and GPS modules are used to locate the precise location for emergency call instructions. Additionally, the black box records the vehicle’s speed, position, and time continuously, and the data is stored on a memory card.

Lim et al. (2018) have demonstrated and simulated the use of ultrasonic sensors to detect obstacles. These sensors are affordable and easy to replicate. However, to enhance detection precision, multi sensor implementation is essential. Additionally, weaknesses in other instruments must be analyzed, and the vulnerabilities of autonomous features should be identified to strengthen the system. Suryana et al. (2019) developed an automatic braking device for motorcycles. The system uses an ultrasonic sensor to detect objects, and the braking system is implemented automatically using the principles of physical laws, specifically kinematic non uniform slowing motion. The servo function moves the brake handle, enabling the system to operate autonomously based on the variable speed and the distance of the motorcycle from the object within the range of 0 m to 4 m. This provides the motorcycle with ample time to stop before colliding with the object in front of it.

The use of Arduino for seat belt management and alcohol detection was suggested by (Malathi et al. 2017). This method prohibits drivers from operating a vehicle while intoxicated and/or without a seat belt. The output from the infrared and alcohol sensors is compared by the comparator and then sent to the microprocessor. If the result is valid, the relay is activated, allowing the vehicle to start. If the comparator output is false, the GSM modem connected to GPS sends information about the location and a message stating that the driver has not fastened their seat belt or has consumed alcohol. Plans for this system include sending notifications to nearby police stations.

Alcohol detection for vehicle locking devices was created by (Al-Youif et al., 2018). The device has demonstrated its capability to detect and measure the concentration of a gas. In case it detects that the concentration of a gas exceeds a specific threshold that is not allowed, it can control the ignition of the car. While this is only a prototype, it can be utilized as a basis for other innovative systems. The relay can be used to regulate the ignition of the car, and an alarm system can be installed on the device.

The device, which has features for speed tracking, alcohol detection, over speeding, reckless driving, driving without a license, and seat belt checking, was created by (Jacob et al. 2020). If any of these conditions are violated, the controller sends emergency data to the cloud, where the RTO receives updates about vehicles that are not complying with the regulations. The next step is to establish a coordinate and mapping system for the driver’s location, which will enable GPS to determine the type of road the vehicle is traveling on.

A controller for driving while intoxicated was developed for cars by (Manikandan et al., 2021). This controller detects intoxication by analyzing gaseous substances in the driver’s breath. If the sensor output detects that the blood alcohol level has exceeded the legal limit, the vehicle’s motor will not start. The alcohol sensors used in this system are highly durable and can detect alcohol from a distance of up to two meters. In the event of a violation, the police will receive the car’s location through the GSM module. Additionally, this system can remotely lock the doors and identify the car that was being driven while intoxicated.

An intelligent transportation system for accident identification and prevention is offered by (Selvathi et al., 2017). The protection system includes both helmet and alcohol detection components. The relay is triggered when the helmet is detected and the alcohol level is below the threshold. Air pressure is used to locate the helmet, while an MQ3 sensor monitors the alcohol level. The alcohol content is displayed on the LCD screen. The vehicle’s accelerometer is utilized to monitor acceleration in all three axes and detect accidents. If an accident is detected, the data is transmitted via Bluetooth module to a connected smartphone, which then sends a notification to a pre set emergency contact.

Janjua et al. (2021) developed a system for truly connected vehicles with Li-Fi communications for smart cities. They discussed the advantages and disadvantages of Li-Fi technology. Although Li-Fi has some drawbacks, the authors provide a detailed analysis of its benefits as a communication medium for vehicles and traffic infrastructure interactions. Table 1 summarizes the inferences and challenges observed from recent popular literature.

Table 1 Summary of Inferences and Challenges from Recent Popular Related Works

The study (Yuvaraju et al., 2021) presents an implementation architecture for integrating Li-Fi communication between vehicles and traffic infrastructure, including a ”Transmitter” and ”Receiver” model that enables secure wireless communication between vehicles. Additionally, the study illustrates a VLC system that uses Li-Fi transmitters and receivers to transmit data. Here, a LI-FI based collision avoidance system uses a visible light transmission to prevent collisions between vehicles, as radio frequencies can cause electromagnetic interference and are restricted in places like hospitals, airplanes, and power plants. The VLC system utilizes Li-Fi transmitters and receivers in cars and can be integrated with future LED digital matrix headlamps for faster communication. This technology is expected to produce the fastest and most sophisticated wireless communication system for long distance communication, with a capacity of 10 Gbps at a low cost.

The study in (Chen et al. 2021) presents a data driven AI solution using a neural network to predict pre crash conditions of cars in accidents. The approach utilizes plastic deformation patterns to accurately reconstruct initial collision parameters, demonstrating its potential for crash analysis and engineering failure assessment, with relevance to autonomous vehicles. In (Xie et al., 2022), the authors introduce a novel algorithm using variational Bayesian learning and a neural network to efficiently reconstruct a crashed car’s deformation field and pre crash state from its damaged structure, aiding in 3D collision analysis and forensic assessment. It achieves accurate results with fewer iterations, highlighting its potential for car crash investigation and crashworthiness evaluation.

These studies encompass a range of approaches, including the development of smart car management systems incorporating overload, alcohol, and sleep detectors (Kabir et al., 2020). Other systems feature sensors for accident detection (Gowri et al., 2019; Jacob et al., 2020; Khan & Howlader, 2019; Manikandan et al., 2021; Selvathi et al., 2017), collision prevention using Arduino and various sensors (Kinage & Patil, 2019), obstacle detection using ultrasonic sensors (Lim et al., 2018), and automatic braking for motorcycles (Suryana et al.). Additionally, there are proposals for alcohol detection and ignition control (Al-Youif et al., 2018; Malathi et al., 2017), as well as an intelligent transportation system for accident identification and prevention (Selvathi et al., 2017). The authors also discuss the advantages and disadvantages of Li-Fi technology in the context of vehicle and traffic infrastructure interactions (Janjua et al., 2021). These prior works collectively inform the motivation and direction of the present research, contributing to the development of innovative solutions for enhanced smart city transportation safety.

5 System models and methods

In this section, autonomous speed detection and accident avoidance frameworks for connected vehicles are discussed. Dynamic transport systems have been developed as a result of technological advancement, and they unquestionably have had a significant influence on society and people’s daily lives. Despite having countless advantages, it has brought about a lot of negative situations. The most harmful aspect of vehicles, in addition to contaminating and crowding the city, is vehicular accidents. Several sensors are integrated into the system to help avoid accidents.

This section is divided into five subsections: Section 3.1 discusses the overview of the proposed system; Section 3.2 describes the drowsiness detection module that prevents accidents caused by drowsiness; Section 3.3 explains the speed indication module that displays the speed of nearby vehicles; Section 3.4 discusses the alcohol detection module with motor locking system and the vehicle to vehicle communication using Li-Fi technology is explained in Section 3.5.

5.1 Overview

The proposed system comprises three distinct modules: the drowsiness detection module, speed indication module, and alcohol sensing module, as illustrated in Fig. 1. The drowsiness detection module is equipped with a temporary glass mounted eye blink sensor that detects the driver’s level of fatigue. In case of drowsiness, the module activates a buzzer to alert and wake up the driver. The speed indication module utilizes ultrasonic sensors that are mounted on the sides of the vehicle to measure the distance and speed between the vehicle and other objects. These measurements are then displayed on our system. The alcohol sensing module continuously detects alcohol and alerts relevant personnel if alcohol is detected in the driver’s breath. A GPS and GSM MODEM are used to detect the driver’s location and inform the concerned authorities if the driver is found to be under the influence of alcohol. The system then proceeds to lock the engine to prevent the driver from operating the vehicle.

Fig. 1
figure 1

Block diagram of the proposed AIoT enabled intelligent transportation system for Smart Cities

5.2 AIoT

AIoT makes predictive maintenance possible by using IoT sensors to continuously monitor vehicle status. This proactive maintenance strategy lowers downtime, helps avoid malfunctions, and guarantees the dependability of fleets of vehicles. By gathering data in real time from IoT devices integrated into infrastructure, cars, and roads, AIoT algorithms can forecast traffic jams, identify patterns in traffic, and dynamically modify traffic signals. Smoother traffic flow and shorter travel times are the results of this modification.See (Soomro et al., 2018). By offering real time data on passenger demand, optimizing routes, and dynamically modifying schedules, AIoT improves public transportation systems. This flexibility increases public transportation’s dependability and efficiency, promoting usage and easing traffic (Alahi et al., 2023).

The development of connected and autonomous automobiles is greatly aided by AIoT. AIoT makes autonomous driving safer and more effective by facilitating constant communication and data sharing between vehicles, traffic signals, and infrastructure (Wu, 2022). AIoT makes it possible to provide customized and situation specific services for travelers. AIoT improves the general user experience and ease of transportation, from smart parking solutions to customized route recommendations (Darmawan et al., 2021). City planners are aided in their decision making on infrastructure development, transit policies, and urban design by the abundance of data produced by AIoT devices. More sustainable and livable cities are produced as a result of this data driven strategy (Son et al., 2023). By offering real time visibility into the movement of products, AIoT improves supply chain management and logistics in the field of freight transportation. Better inventory control, fewer delays, and overall efficiency are the results (Nozari et al., 2023). By encouraging the adoption of environmentally friendly means of transportation, streamlining traffic, and assisting in the overall decrease of carbon emissions (Hammad et al., 2023), AIoT helps lessen the negative environmental effects of transportation. AIoT incorporates cutting edge safety technologies like intelligent surveillance, real time vehicle status monitoring, and predictive analysis of accident prone locations. As a result, both pedestrians and commuters benefit from a safer transportation ecosystem (Wu et al., 2020).

5.3 Drowsiness detection module

The proposed structure, as shown in Fig. 2, utilizes an Arduino mini for its implementation. The system consists of a temporary glass that a driver can wear while driving, with the necessary hardware attached to it. The hardware includes an IR sensor, a buzzer, a switch, a 3.7 V battery, and an Arduino Mini. We have taken great care to prevent any obstruction to the drivers’ line of sight while driving. It ensures that it does not obstruct the drivers’ view, allowing them to have a clear and unobstructed view of the road ahead. The IR sensor is used to detect when the driver’s eyes are closed. The sensor is comprised of an emitter and a receiver that together form the infrared sensor. The IR emitter transmits IR light toward the driver’s eye, and the IR photodiode detects whether the same wavelength light is reflected. When the driver’s eye is closed, the reflected IR light is stronger, which is detected by the photodiode. Conversely, when the driver’s eye is open, the reflected IR light scatters and has a reduced intensity. Therefore, eye closure action can be detected by monitoring photodiodes.

Fig. 2
figure 2

AIoT enabled drowsiness detection module

The configuration of the Arduino Mini requires the use of an Arduino Uno board, which is used to program the Mini. To program the Mini, the IC in the Arduino Uno board is first removed. Once this is done, the connections are established, and the Mini is updated with the appropriate program. The IR sensor that is used in the proposed system continuously emits infrared radiation, which is directed toward the driver’s eye. When the driver blinks, the sensor detects the change in the output, which is then sent to the Arduino Mini. The Arduino Mini processes this data and activates the buzzer if the driver doesn’t blink for a certain predetermined period. The buzzer is used to alert the driver and wake them up, preventing potential accidents due to drowsiness or fatigue.

5.4 Speed indication module

It is not sufficient to only display the speed of our vehicle while driving. It is equally important to determine the speed of the nearby vehicles both in front and behind our vehicle, as this information can help prevent accidents. To accomplish this, the proposed system utilizes an ultrasonic sensor that is attached to the sides of the vehicle. The ultrasonic sensor is capable of measuring the distance between our vehicle and the neighboring cars, and based on this information, the system can calculate the speed of these vehicles. By displaying this information to the driver, they can adjust the speed of their vehicle accordingly to maintain a safe distance from other vehicles. The system is composed of an LCD, an Arduino Mega, and an ultrasonic sensor, as shown in Fig. 3. This setup enables the system to accurately calculate and display the speed of neighboring vehicles in real time, providing the driver with critical information to help them make informed driving decisions.

Fig. 3
figure 3

AIoT enabled speed indication module

In the proposed system, ultrasonic sensors are used to accurately measure the distance between the vehicles in front, behind, and on the sides of our car. The ultrasonic sensors emit high frequency sound waves, which then bounce back after striking nearby objects. By measuring the time taken for the waves to return, the distance between the vehicles can be calculated. The ultrasonic sensors are placed on the sides of the car, and in the event of a vehicle attempting to pass us on either side, the sensors detect the movement and notify us of the direction from which the other vehicle is approaching. The system is also capable of displaying a message if no vehicle is detected nearby. Moreover, the system is designed to track the movement of every car in the vicinity of our vehicle, providing the driver with real time information on the surrounding traffic conditions. This information can be displayed on the system’s screen, enabling the driver to make informed decisions while driving.

5.5 Alcohol detection module

A system has been designed using an Arduino Mega microcontroller that incorporates an alcohol sensor or MQ3 sensor for the detection of alcohol consumption, as shown in Fig. 4. Drunk driving is a significant cause of accidents, and the system locks the motor when the alcohol sensor detects alcohol in the breath of the driver. To ensure the safety of the driver and others on the road, the system sends location messages to authorized individuals via a GPS receiver and GSM modem. The system comprises an Arduino Mega board, an MQ3 alcohol monitor, a GSM/GPS module, and a notification device.

Fig. 4
figure 4

AIoT enabled alcohol detection module

The MQ3 alcohol sensor can detect the amount of alcohol in the air starting from 0.4 mg/L. When the alcohol sensor detects alcohol in the breath, it sends a signal to the microcontroller, which is connected to an ADC and transmits the data. The signal is then converted to digital code, and the value is compared with a predefined threshold. If the blood alcohol content exceeds the 0.4 mg/L threshold, the car’s speed will be limited, if it detects during running condition or the engine will be disabled during the idle condition.

During driving, the GPS constantly calculates the location and speed of the vehicle, and this information is sent to the Arduino Mega microcontroller. If the vehicle’s speed exceeds the predetermined limit, the Arduino Mega sends a command to the GSM module, which transmits a message to the appropriate authorities containing the vehicle’s latitude and longitude. This feature ensures that authorities can take appropriate action and prevent accidents caused by reckless driving.

To effectively address concerns regarding the utilization of Arduino and GSM technology within the proposed framework for v2V communication, it exhibits a profound comprehension of the significance of industry standards, reliability, and safety in such applications. It offers a well justified rationale for their inclusion, strengthening the framework’s credibility. One notable strength lies in the rationale behind opting for Arduino and GSM technology, as it provides distinct advantages within the context of enhancing smart city transportation safety. Moreover, the thorough consideration of reliability and safety concerns not only acknowledges these apprehensions but actively endeavors to mitigate them. It achieves this by elaborating on how Arduino and GSM technology align with industry standards and safety prerequisites. This commitment to transparency and detail serves to underscore the robustness and dependability of the chosen technologies.

5.6 Li-Fi vehicle to vehicle communication

Vehicle to vehicle (V2V) communication technology has emerged as a game changer for intelligent transportation systems, helping to prevent accidents and improve safety on the roads (Chhabra et al., 2022). This technology leverages various in-vehicle sensors to generate and transmit messages of actions between vehicles, thereby enabling real time communication and collaboration among them.

Li-Fi, being a relatively novel technology, does present challenges in signal quality, especially in dynamic and congested traffic environments. Li-Fi has evolved significantly in recent years, demonstrating its effectiveness, security, and ability to transmit data at very high rates (Memedi & Dressler, 2020). It offers several advantages over traditional wireless communication technologies, such as WiFi and cellular networks. Li-Fi technology is less prone to interference, more secure, and better suited to high density environments, such as urban areas. It is a cost-effective, high data rate, and bandwidth efficient solution for vehicular communication that has gained considerable attention in recent years. Li-Fi technology employs light as a medium for communication, allowing for faster and more secure data transmission. VLC is the underlying technology that enables Li-Fi to eliminate the complexity of cable communication.

Researchers and experts in the field of optical communication and traffic management have conducted empirical studies that can validate the practicality of Li-Fi for traffic safety applications (Dibaei et al., 2021). This collaborative effort will help us gather valuable data and insights to substantiate our claims and ensure that Li-Fi can indeed contribute significantly to traffic safety. It provides a well founded and evidence based assessment of Li-Fi’s effectiveness in improving traffic safety within the smart city context.

The degree of integration of the setup in real time determines the anticipated costs of each system component, such as sensors, processors, communication modules, and power management units. Researchers and practitioners may better understand the financial implications of deploying comparable solutions and make resource allocation decisions by quantifying the costs of each component based on the deployment scenario. Numerous aspects, like sensor precision, processor power, and communication range for real world applications, influence cost variability even with the prototype model. For example, sophisticated signal processing algorithms and higher resolution sensors may be more expensive, but they also provide better performance and dependability. Comparably, the choice of transmission rates and communication protocols might affect hardware prices, where providing faster V2V communication technologies is more expensive.

The primary objective of V2V communication is to prevent accidents by having moving vehicles transmit their positions and data rates via intelligent vehicular communication, as depicted in Fig. 5. The integration of Li-Fi technology with V2V communication can significantly enhance the safety, efficiency, and reliability of our transportation system, making it more intelligent and secure.

Fig. 5
figure 5

AIoT enabled Vehicle to Vehicle Communication Module using Li-Fi

6 Results and discussions

A prototype instrument designed to detect sleepiness consists of a temporary glass with an installed IR sensor and is powered by a 3.7 V battery that supports an Arduino Pro Mini processor. Standard safety spectacles are equipped with an infrared (IR) emitter and detector pair, positioned laterally across the palpebral fissure to generate a monitored IR stream that is interrupted when the eyes close. This interruption is detected by the IR sensor and signals the processor, which then activates an alarm or alert system to notify the driver of their drowsiness.

If the outcome from the eye flicker monitor is minimal, the indication will be adjusted to high. If the driver begins to nod off, the buzzer will sound as a warning, and the indication can be turned off if necessary. To improve blink recognition and minimize the likelihood of false positive blink events resulting from non blink lid movement, it is possible to include one or more extra emitters and/or detectors. This additional equipment would augment the capabilities of a single IR LED (emitter) and phototransistor (detector), enhancing the system’s accuracy. An array of two or three emitter/detector pairs positioned parallel to the eye surface may provide an alternative path for IR rays to travel when the lids move up and down simultaneously while remaining apart (for example, during a downward gaze). Furthermore, by incorporating a collection of emitter/detectors, the sensing system’s resistance to changes in eyeglass position caused by head or facial movements that cause the skin on the nose’s bridge to move or by head movements may be improved. The primary input source is the interconnection between the wearable component, which tracks driver intoxication and sleepiness, and the vehicle’s onboard systems. It is used to continually track important physiological indicators including heart rate, eye movements, and alcohol content of the breath. The central processing unit of the vehicle receives these real time data streams wirelessly, and using cutting edge machine learning techniques, it evaluates them to determine the driver’s level of drunkenness and cognitive state. To reduce possible safety concerns, relevant measures are initiated based on the analysis results, such as automated speed decrease or audio alarms.

Subsequently, the collision avoidance system of the vehicle is integrated with the ultrasonic speed detector, which keeps track of the speed of another vehicle. Real time situational awareness through ultrasonic sensors could be able to detect the relative velocities and distances from other surrounding vehicles. Moreover, the collision avoidance system uses V2V Li-Fi technology to connect with other cars, enabling cooperative moves and improving traffic safety in smart city settings. These integrations could be made a reality by configuring the decision making phase in the distributed AIoT integrated platforms.

The role of AIoT in the aforementioned scenarios facilitates smooth communication and coordination between various system components. AIoT ensures prompt reactions to changing driving circumstances and new safety concerns by enabling dynamic data exchange and decision making across heterogeneous devices and platforms through a distributed network architecture. Additionally, the system can continually adjust and enhance its performance based on contextual information and real world input thanks to AIoT driven analytics and predictive modeling, which maximizes driving efficiency and safety.

We may look to apply the suggested approach in a variety of situations, including personal vehicles, public transit, and commercial fleets. For example, the technology might be implemented in commercial fleets under forced adoption situations to enforce safety standards and reduce the hazards related to driver fatigue and alcohol impairment. On the other hand, in situations where adoption is voluntary, the system may be sold as an optional accessory for private automobiles, attracting customers who value safety and want to improve their driving experience.

One can use an ultrasonic sensor to determine the speed of a nearby vehicle. It consists of a transmitter and a receiver that emit and receive sound waves, respectively. By transmitting high frequency sound waves and monitoring the time it takes for them to return after hitting an object, the ultrasonic sensor can measure the distance between the object and the sensor. This concept enables the measurement of an object’s motion as it passes an ultrasonic sensor. When the item moves in front of the sensor, the sound waves bounce back to the sensor. The speed of the passing vehicles can be calculated using the equation v = d / t, where v represents the object’s velocity, d represents the distance between the object and the sensor, and t represents the time it takes for the sound waves to reach the object and return. We can determine and display the speed of passing vehicles by utilizing this technique. To detect overtaking vehicles, we can interface three ultrasonic sensors on the rear of our car. When the rightmost sensor detects a vehicle overtaking on the right, the display will show the message”Alert, Vehicle overtakes at Right,” and when the leftmost sensor is in use, the message”Alert, Vehicle Overtakes at Left” will be displayed. If the moving vehicle approaches our car too closely, a”Danger” warning will appear, while the message”No vehicle” will be displayed if there are no nearby vehicles.

To improve the accuracy of alcohol detection, we have integrated an MQ3 sensor into the microcontroller. This sensor is known to be reliable and widely used for alcohol monitoring. Its detection range extends up to 2 m, making it an efficient tool for detecting the presence of alcohol. Furthermore, the sensor’s sensitivity can be adjusted to meet specific requirements, making it adaptable to different scenarios. The MQ3 sensor’s conductivity increases as the alcohol concentration rises, providing the Arduino with the corresponding reading.

The results of using an Alcohol Sensor to detect the presence of alcohol indicate that there is no alcohol detected in the driver’s exhaled air as the level is below 150. However, it should be noted that there may still be an undetected alcohol level present. When the driver exhales, the sensor can detect a small amount of alcohol, and if the level is above the legal limit, a”DRUNK” notification will appear on the screen. Conversely, if the level is within legal limits, a message stating”Within legal limits” will be displayed. The purpose of the system is to reduce the number of accidents caused by impaired driving by implementing an engine locking system. Table 2 provides a comparative analysis of smart city transportation safety Systems, including drowsiness detection, alcohol detection, and accident rates, for various safety systems, including the proposed system and referenced systems.

Table 2 Comparative Analysis of Smart City Transportation Safety Systems

The DC motor will be turned off by Arduino when the reading goes beyond the threshold level. The L293D is connected to Arduino and supplied with 5 V, which is then linked to the DC motor. The SIM800A and NEO6M GPS modules are used by this model to send a message with the vehicle’s location to the registered cellphone number after the engine is locked. GPS receivers are capable of determining their distance from several satellites. The locations of the 32 GPS satellites have already been pre programmed into them. The GPS module is responsible for determining the vehicle’s speed and location. Radio signals from the satellites are sent to Earth, carrying details about their positions and the time at that moment. These signals identify the satellites and provide location information to the receiver. The SIM800L module can send text SMS data to a host server after receiving serial data from radiation monitoring equipment like survey meters or area monitors. When the alcohol level crosses the threshold, the GSM module’s function is to send an SMS to the appropriate authorities at the provided number. The GPS 8 M module records and securely stores location data. The location is stored on the Arduino Mega board as soon as it is known because the initial fix takes longer to establish.

The complete system module developed in this work consists of two units: a transmitter unit (Fig. 6a) and a receiver unit (Fig. 6b). The two units act as transceivers, each equipped with an LCD screen that displays its state and any data acquired from the sensing modules mounted in the vehicles. The transmitter transforms digital data into visible light using an LED. The LED is a suitable component because of its linear relationship between current and light output. The receiver uses a photodiode to convert the incoming light into an electrical charge. The photodiode is a semiconductor device that converts light into an electric current. The first transmitter is connected to the Arduino device. Once the transmitter receives the data from the Arduino board, it converts it to binary and transmits it using the LED. If the binary value is 0, the LED does not blink, but if the binary value is 1, the LED blinks. The blinking happens so fast that it is not visible to the human eye. The photovoltaic cell on the receiver side absorbs the light from the LED and converts it into electrical energy. The receiver then decodes the binary data into real data and transmits it to the Arduino board.

Fig. 6
figure 6

Li-Fi transmitter and receiver modules in the vehicles

7 Conclusions and future research

This study presented an innovative solution to enhance transportation safety in next generation smart cities. The Li-Fi enabled vehicle safety framework integrates eye blink, ultrasonic, and alcohol sensors to address critical issues like driver drowsiness, speeding, and alcohol consumption, major contributors to fatal road accidents. The system detects driver drowsiness and alerts the driver through a buzzer, preventing fatigue related accidents. Ultrasonic sensors provide real time information on surrounding vehicle speeds, enhancing traffic flow and reducing collision risks. The alcohol sensor detects alcohol consumption and restricts the vehicle’s speed, alerting authorities via GPS and GSM to prevent drunk driving incidents. Li-Fi technology for vehicle to vehicle communication via VLC improves data exchange, further enhancing road safety.

Looking ahead, this adaptable system prototype can be customized and expanded to meet the diverse demands of various markets. It serves as a testament to technology driven solutions in making our urban transportation systems safer, more efficient, and conducive to the overall well being of smart city residents.

This study has significant implications as the proposed system can significantly reduce fatal road accidents by addressing key factors like drowsy driving, speeding, and alcohol consumption. Ultrasonic sensors enhance traffic flow, reducing congestion and accident risks. By automatically restricting vehicle speed when alcohol is detected, the system deters drunk driving. The adoption of Li-Fi for vehicle communication highlights VLC technology’s role in transportation safety and efficiency. The adaptable system can be customized to meet various market needs, contributing to safer and more sustainable smart cities.

Our forthcoming research will focus on enhancing the practicality of the drowsiness detection module, especially when drivers wear recommended driving lenses. We will thoroughly investigate and test the system’s ability to consistently and accurately detect signs of tiredness and drowsiness in such scenarios. This research aims to make the system more user friendly and adaptable to real world driving conditions. Additionally, our research has paid significant attention to the rationale for selecting Arduino and GSM technology in our proposed framework for smart city transportation safety. We understand the importance of justifying these choices and ensuring their suitability for our framework’s specific applications. The integration of AIoT innovations for transportation safety represents a revolutionary change toward safer and smarter mobility systems. We are sculpting a future in which transportation is not only more effective but also fundamentally safe for all users of the road by fusing AI intelligence with IoT connection.