DC Motor control using C++
 DC motor control using VC++
 Stepper motor control using VC++
 Industrial DC Motor Control panel
 industrial stepper motor control panel
 remote control for AC Drive
 Traffic control system
 Wireless DC Motor controller
 Wireless Stepper motor controller

~: Traffic Control System :~

Abstract:- actually this is remote traffic monitoring and control system in which a police man can control the flow of traffic from a remote location through his computer. he can generate all three traffic signals (red, green & yellow) on a click of mouse only. also he can divert the flow of traffic by monitoring it on his computer screen through camera .

the program written in VC++ controls the traffic flow in both the manners automatic and manually. in automatic mode traffic flow is controlled by predetermined time periods and in manual mode a police man can open or close any lane depending on the traffic density on each lane. means if on one lane traffic is much more then any other then that lane is open till any other lane has a greater traffic density.

One more added feature is alarm system. whenever any driver wants to drive out in red light the laser beam will be interrupted and it will ring an alarm in police station.

Note:- complete project is developed by two students Patel Bhavin and Tandel Jiten of 4th EC from Dr. J. N. Meha Govt. Polytechnic, Amreli under my guidance.

                                           _____________________________________  

There are two sections of the project (1) Hardware section (2) software section

Hardware section is to switch ON/OFF Red, Green & Blue LEDs of all four lanes. Depending upon the input code given to the circuit by computer program, it will ON or OFF particular LED.

The software section just gives the proper code to the circuit depending upon the user command like to open lane 1 or lane 2 or anything else.

it will be better to understand software codes if we first see the logic behind the hardware circuit.

Hardware circuit:-

The circuit given below shows complete logical circuit of traffic light control system.

 

The main components are 2 input quad OR Gate IC 74LS32, NOT gate IC 74LS04, current driver IC ULN2003A and last timer IC 555.

Connections: - both the inputs of all four OR gates are connected to all eight data pins D0-D7 of 25 pin D-type female connector. Four green LEDs are connected with all even pins D0-D2-D4-D6 and yellow LEDs are connected with all odd pins D1-D3-D5-D7. The output of all OR gates are given to all four RED LEDs through NOT gates. Further the even pins also drives relays (RELAY1A-2A-3A-4A) through current driver chip. The relay gives supply to IC555 that is connected in single shot mode. LDR is used to detect laser beam.

logical operation:- we already know how the traffic light system works. At a time, only one LED will glow red, green or yellow. Now to drive total 12 LEDs we have only 8 data lines. Now as we know when green is ON red is OFF and vice versa, we are a single line for both signals by connecting green LED directly to data lines (D0-D2-D4-D6) and red LEDs via NOT gates. Thus, we can connect 4 red and 4 green total 8 LEDs with 4 data lines and rest 4 are connected with yellow LEDs.

Now there is one set of three LEDs one for each lane. We know when any one led is ON other two should be off. To implement this logic we have only two data lines. Let’s understand the operation with first section because it is same for all four. For first section we have two data lines D0 & D1. When you apply high logic to D0 pin the green led LED2 will ON. Because the same high logic passes through OR gate the output of OR gate will be high. This high output is inverted by NOT gate and this will switch OFF red LED LED1. To OFF yellow LED LED3 we shall apply low logic to D1 pin. So at a time only one that is green LED is ON. Now letting D1 pin 0 (low logic) if D0 is also made 0 the OR gate will produce 0 output and after inversion it will be 1 (high logic) so red LED will glow other two will be off. Now if we make D1 pin 1 the Yellow LED will glow. This high logic passes through or gate and again produces high output so red LED will be again OFF. So again, only yellow LED will glow other two will remain off. To understand the operation better pls refer the table

 D1

D0 

LED 

 0

  1 

Green 

 0

 0

Red 

 1

 0

 Yellow

     

Depending upon this logic, we have to generate different codes to open consecutive lanes, to switch ON all yellow lights etc. All the codes are given in table given below.

 Hex codes

operation 

 01 (0000 0001)

 first lane (LED2) is open all other are closed because other

lanes have red light  

 04 (0000 0100)  second lane (LED5) is open all other are closed because other

lanes have red light  

 10 (0001 0000)  third lane (LED8) is open all other are closed because other

lanes have red light   

 40 (0100 0000)  fourth lane (LED11) is open all other are closed because other

lanes have red light   

 AA (1010 1010)  all yellow LEDs are ON red and Green LEDs are off. 

All these codes will be given from software program to open only one particular lane at a time. Now let’s see how alarm system works.

Alarm system: - complete alarm system is built around timer IC 555. As told before it is connected in single shot mode. LDR is used to detect laser beam. As the laser beam continuously, strikes on LDR 555 gets continuous trigger from LDR. So its output is continuously high. And that’s why buzzer is off. Now when laser beam is interrupted 555 doesn’t get trigger so its output goes low and bang bang!!!!!!! The buzzer rings. Now when one lane is open the high logic drives current driver chip ULN2003A and it will energizes the relay. So it will cut off the supply of alarm circuit and that’s why when laser beam is interrupted alarm will not ring.

This completes the hardware part. One more thing you can add is that blinking yellow light circuit that I have implemented but not cover in this article. It is astable multivibator built using 555 with 1 sec ON time and 1 sec OFF time. Now let’s check software part.

Software section:-

The figure given below shows the design of traffic control system in VC++.

 

The design contains 13 buttons, 2 check boxes, 6 group boxes and 5 static taxes. Here I am not maintaining the setting of ID and caption setting because it is self-exaplanary.

  • It is clearly seen from screen that I have implemented two modes automatic and manual and for both this mode, I have taken two group boxes.
  • The automatic mode group box contains one display counter that will show counter progress from 1 to 120 sec after every second.
  • Two buttons are provided one is to start counter second is to stop counter.
  • After every 30 sec. one lane will be open and other will be closed circularly.
  • The enable button will enable the automatic mode and disable manual mode.
  • The manual mode group box contains four sub-group boxes each one for one LANE. All sub-group boxes have two buttons one is for green light second is for yellow light.
  • The green button will open one particular lane and closes all other lane by making only one green light and all other red lights.
  • Yellow button will switch on all the yellow lights at a time.
  • Enable button will enable manual mode and disable automatic mode.
  • System clock is provided on the top of the application, which shows the current time in HH:MM:SS format. One can start or stop this clock by given two buttons. This clock is provided for automatic mode. In automatic mode when this clock displays 2:00 pm (14:00 Hrs) the yellow lights will be automatically ON and when it displays 4:00 pm (16:00 hrs) it will be automatically OFF. Same thing happens at 10:00 pm (22:00 hrs) and 8:00 am (8:00 hrs) 
  • Two timers are attached with the application. One is for countdown from 0-120 and again starts from 0 and second is for system clock.
  • Total 5 member variables are used in this application. two are attached with two check boxes m_enbl1 and m_enbl2, one is attached with system clock m_sclock, one is attached with counter m_stime and last one is used for counting operation m_ic

click here to see the coding of application

All the projects are designed and developed by sight owner and they are thoroughly tested by him. ©Copyrights Ashutosh Bhatt 2010. All rights reserved.