Skip to content

phani446/Traffic-Management-Using-TomTom-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚦 AI Smart Traffic Management System using TomTom API

Python Arduino TomTom API IoT License

An AI-powered Smart Traffic Management System that dynamically controls traffic signals using live traffic data from the TomTom Traffic API. The project integrates Python, Arduino Nano, IR Sensors, and SIM900A GSM to optimize traffic flow, detect red-light violations, and provide emergency traffic control.


πŸ“Œ Project Overview

Traditional traffic signals operate using fixed timing regardless of traffic conditions, leading to congestion and delays.

This project overcomes these limitations by using live traffic congestion data from the TomTom Traffic API to dynamically adjust traffic signal timings. The system also detects red-light violations using IR sensors and sends SMS alerts using a SIM900A GSM module. An Emergency Override Mode allows all traffic signals to turn RED instantly during emergency situations.


🎯 Objectives

  • Develop an AI-based smart traffic management system.
  • Dynamically adjust signal timing using live traffic data.
  • Detect red-light violations automatically.
  • Send SMS alerts using SIM900A GSM.
  • Implement an Emergency Override mode.
  • Demonstrate hardware and software integration.

✨ Features

  • 🚦 Dynamic Traffic Signal Control
  • 🌐 Live TomTom Traffic API Integration
  • 🧠 AI-Based Congestion Analysis
  • πŸš— Red-Light Violation Detection
  • πŸ“© SMS Alerts using SIM900A GSM
  • 🚨 Emergency Override Mode
  • πŸ”„ Python-Arduino Serial Communication
  • πŸ“Š Real-Time Traffic Monitoring

πŸ›  Hardware Used

  • Arduino Nano
  • SIM900A GSM Module
  • 4 IR Sensors
  • 4 Red LEDs
  • 4 Green LEDs
  • Push Button (Emergency)
  • Breadboard
  • Jumper Wires
  • USB Cable
  • Laptop

πŸ’» Software Used

  • Python 3.x
  • Arduino IDE
  • Visual Studio Code
  • TomTom Traffic API
  • PySerial
  • Requests Library

πŸ”Œ Pin Connections

Device Arduino Pin
Lane 1 Red LED D2
Lane 1 Green LED D3
Lane 2 Red LED D4
Lane 2 Green LED D5
Lane 3 Red LED D6
Lane 3 Green LED D7
Lane 4 Red LED D8
Lane 4 Green LED D9
SIM900A TX D10
SIM900A RX D11
Emergency Button D12
IR Sensor Lane 1 A0
IR Sensor Lane 2 A1
IR Sensor Lane 3 A2
IR Sensor Lane 4 A3

πŸ— System Architecture

                 TomTom Traffic API
                        β”‚
                        β–Ό
                 Python AI Program
                        β”‚
                 USB Serial (COM)
                        β–Ό
                  Arduino Nano
                        β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                 β”‚                  β”‚
      β–Ό                 β–Ό                  β–Ό
 Traffic Lights     IR Sensors      Emergency Button
      β”‚                 β”‚                  β”‚
      β”‚      Vehicle crosses RED           β”‚
      β”‚                 β”‚                  β”‚
      β”‚        Threshold > 150             β”‚
      β”‚                 β”‚                  β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β–Ό
                   SIM900A GSM
                        β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β–Ό                             β–Ό
  Violation SMS Alert          Emergency SMS Alert

βš™οΈ Working Principle

  1. Python fetches live traffic data from the TomTom Traffic API.
  2. Traffic congestion is converted into congestion levels (1–9).
  3. Python sends congestion values to the Arduino Nano through USB Serial.
  4. Arduino dynamically adjusts the green signal duration for each lane.
  5. IR sensors monitor all RED signal lanes.
  6. If a vehicle crosses a RED signal, the Arduino detects a violation.
  7. SIM900A GSM sends an SMS alert containing the violation information.
  8. Pressing the Emergency Button immediately turns all traffic signals RED and sends an Emergency SMS.

πŸ“· Project Images

Working Model

Working Model

SMS Alert

SMS Alert

Python Program

Python

Arduino IDE

Arduino


πŸŽ₯ Project Demonstration

A demonstration video of the complete working system is available in the Videos folder of this repository.


πŸ“¦ Installation

Clone the repository

git clone https://github.com/phani446/Traffic-Management-Using-TomTom-API.git

Install Python libraries

pip install requests pyserial

Open Arduino IDE

  • Upload SmartTrafficSystem.ino

Open Python

python version_1.py

πŸš€ Future Scope

  • Camera-based Vehicle Detection
  • Automatic Number Plate Recognition (ANPR)
  • Cloud Database Integration
  • Mobile Application
  • AI-Based Traffic Prediction
  • Smart City Integration
  • IoT Dashboard

πŸ“‚ Repository Structure

Traffic-Management-Using-TomTom-API
β”‚
β”œβ”€β”€ Arduino/
β”‚   └── SmartTrafficSystem.ino
β”‚
β”œβ”€β”€ Python/
β”‚   β”œβ”€β”€ version_1.py
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ Images/
β”‚   β”œβ”€β”€ Working_Model.jpeg
β”‚   β”œβ”€β”€ SMS_Output.jpeg
β”‚   β”œβ”€β”€ Screenshot (6).png
β”‚   └── Screenshot (7).png
β”‚
β”œβ”€β”€ Videos/
β”‚   └── Demo.mp4
β”‚
β”œβ”€β”€ README.md
└── LICENSE

πŸ‘¨β€πŸ’» Author

Panniru Phanidhar

B.Tech – Electronics and Communication Engineering

JNTUH University College of Engineering Rajanna Sircilla

GitHub: https://github.com/phani446


⭐ Support

If you found this project useful, please consider giving this repository a ⭐ Star.


πŸ“œ License

This project is licensed under the MIT License.

About

AI-based Smart Traffic Management System using TomTom Traffic API, Arduino Nano, Python, IR Sensors, and SIM900A GSM for dynamic signal control, red-light violation detection, SMS alerts, and emergency override.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors