In present times increasing Traffic is adding to the big woes of developing cities. The main roads are packed with vehicular traffic on each and every road or a traffic signal (Intersection Points). One comes across the common problem of traffic jams on almost all Traffic Junctions which is even critical if you go to big cities. A lot of time, energies besides precious fuel is wasted just because of these Traffic Jams on the roads.
To solve this problem Traffic Cameras are used over Traffic Intersection points. Traffic Cameras capture the image of vehicles in traffic and sends to MATLAB then start with matlab. Here in this project Traffic Surveillance System is demonstrated by way of how the traffic could be controlled over traffic intersection points from the Traffic Control Room. This is a very effective system for Traffic Surveillance.
Given below are some snapshots depicting the working of the arduino based traffic surveillance system.
Fig. 1: Image showing working of Arduino and Matlab based Traffic Surveillance System
Fig. 2: Prototype of Arduino and Matlab based Traffic Surveillance System
Fig. 3: Image showing matchstick boxes used as cars in the prototype model
Fig. 4: Image of Matlab Code used in Traffic Surveillance System
Fig. 5: Image of captured photograph of Traffic on Matlab
Fig. 6: Image of filtered picture of traffic on Matlab
Fig. 7: Image of traffic report sent to registered mobile number as SMS
Description
Working of this Traffic Surveillance System is easy and quite simple. First reader need to know how to start with arduino . There are two Arduino UNO boards which are used for controlling all the operations. GPS and GSM technologies are also used in the project. Here GPS is used with arduino for taking coordinates of a Traffic Jam and GSM is used with arduino for sending these coordinates to Traffic Control Room. But besides GPS and GSM there are two more other important things which are used in the Traffic Surveillance Project and that are Cameras and MATLAB.
Fig. 8: Block Diagram of Arduino and Matlab based Traffic Surveillance System
Block Diagram without LCD
MATLAB sends command to cameras for capturing the images of traffic, where MATLAB later identifies or count the total number of vehicles over the Traffic Intersection or over on road. If the total number of vehicles over the road exceeds the limits in a given situation then the MATLAB sends signals to Arduino UNO (A).
Arduino UNO (A) sends interrupt to second Arduino UNO (B). Now the second Arduino UNO (B) takes coordinates of the Traffic Jam and sends these coordinates to the Traffic Control Room using GSM module. Here you can use a LCD for showing the traffic status like Traffic Jam or No Traffic.
Fig. 9: Block Diagram of Arduino and Matlab based Traffic Surveillance System
Block Diagram with LCD
Circuit Diagram & Programming Explanation
Circuit Description
Circuitry of this system is also quite simple. You can connect the whole system using jumper wire. Laptop Camera is used as Traffic Camera for monitoring purposes and Match Boxes are used in place of vehicles. MATLAB is also used in Laptop for processing the operation of the project. Arduino is directly connected to the Laptop using USB. Arduino UNO’s (A) pin number 8 is directly connected to 8 number pin of Arduino UNO (B). A GPS and a GSM module are connected with Arduino UNO (B). One can also connect a 16×2 Liquid Crystal Display (LCD) with Arduino UNO (B) for displaying Traffic Status.
Please Refer Circuit Diagram Tab for Without LCD and With LCD
Program
There are three programs for this system, first is Arduino MATLAB program for Image Processing and counting the vehicles. Arduino MATLAB support package file should be installed in your computer (see previous article of GUI interfacing with Arduino). Second program is also Arduino MATLAB support package (see previous article of GUI interfacing with Arduino) for Arduino UNO (A). Third program is for Arduino UNO (B) which takes control on GPS, GSM and LCD.
Fig. 10: Screenshot of Arduino Code used for Initialization of Traffic Surveillance System
Fig. 11: Screenshot of Matlab Code used in Traffic Surveillance System
Components Used
1. Two Arduino UNO Board
2. GSM Module
3. GPS Module
4. Laptop
5. 16X2 Liquid Crystal Display(Optional)
6. Power Supply
7. Connecting Wires
You may also like:
Project Source Code
###
//#include//LiquidCrystal lcd(7, 6, 5, 4, 3, 2); char str[70]; char *test="$GPGGA"; char logitude[10]; char latitude[10]; int In=8; //int LED=8; int i,j,k; int temp; //int Ctrl+z=26; //for sending msg void setup() { // lcd.begin(16,2); Serial.begin(9600); pinMode(In, INPUT); // pinMode(LED, OUTPUT); // lcd.setCursor(0,0); // lcd.print(" trafic "); // lcd.setCursor(0,1); // lcd.print(" survilience "); // delay(4000); } void loop() { while(digitalRead(In) != 1); if (temp==1) { for(i=18;i<27;i++) //extract latitude from string { latitude[j]=str[i]; j++; } for(i=30;i<39;i++) //extract longitude from string { logitude[k]=str[i]; k++; } // lcd.setCursor(0,0); //display latitude and longitude on 16X2 lcd display // lcd.print("Lat(N)"); // lcd.print((unsigned)latitude); // lcd.setCursor(0,1); // lcd.print("Lon(E)"); // lcd.print((unsigned)logitude); // delay(100); // digitalWrite(LED, HIGH); Serial.println("AT+CMGF=1"); //select text mode delay(10); Serial.println("AT+CMGS="9610126059""); // enter receipent number Serial.println("Trafic Jam "); Serial.print("Latitude(N): "); //enter latitude in msg Serial.println(latitude); Serial.print("Longitude(E): "); //enter Longitude in Msg Serial.println(logitude); //enter latitude value in msg //enter longitude value in msg Serial.println("Thanks"); Serial.write(26); //send msg Ctrl+z=26 temp=0; i=0; j=0; k=0; delay(4000); // next reading within 20 seconds // digitalWrite(LED, LOW); } } void serialEvent() { while (Serial.available()) //Serial incomming data from GPS { char inChar = (char)Serial.read(); str[i]= inChar; //store incomming data from GPS to temparary string str[] i++; if (i < 7) { if(str[i-1] != test[i-1]) //check for right string { i=0; } } if(i >=60) { temp=1; } } } ###
Circuit Diagrams
Circuit-Diagram-Arduino-Matlab-Based-Traffic-Surveillance-System | |
Circuit-Diagram-Arduino-Matlab-Based-Traffic-Surveillance-System_0 |
Project Video
Filed Under: Electronic Projects, PIC Microcontroller
Filed Under: Electronic Projects, PIC Microcontroller
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.