🚦

Traffic Signal System Using 8051 Microcontroller

May 7, 2025

Traffic Signal Application on 8051 Controller

Introduction

  • Presented by Shashanan
  • Focus on a simple application using the 8051 microcontroller: a traffic signal system.

Resources

  • Follow along on YouTube: Aerotech Solutions
  • Also available on Facebook.

Application Overview

  • Basic application using LEDs to represent traffic signal colors (Red, Green, Yellow).
  • Developed source code using Embedded C with Keil IDE.
  • Simulated using Proteus simulation tool.

Components Required

  • Power Supply: 5V DC source
  • Microcontroller: 8051 (not just a 40 pin device)
    • Additional components: Crystal oscillator, reset connections.
  • Traffic Signal: Implemented using three different color LEDs.

Circuit Design

  • Circuit diagram created in Proteus simulation tool.
  • Connections made to GPIOs of microcontroller using Port 2 and Port 3.
  • 12 I/O pins used from the controller (LSB part of GPIOs).

Source Code Overview

  • Code written in Keil Micro Vision.
  • Declarations before the main function using SBIT data type and global header file (rej51.h).
  • User-defined names:
    • E: East
    • W: West
    • N: North
    • S: South
  • I/O Declarations: Use uppercase for I/O port letters for SFR registers.
  • Delay Function: User-defined function for time delays.

Initial Setup

  • Set all I/Os to low (0).
  • Logic 0 (0x00) used for off state.

Traffic Signal Logic

  1. East Green On:

    • Other three directions (North, South, West) show Red.
    • Duration: 30 seconds.
  2. Transition to Yellow:

    • Yellow signal on for a brief time (less than red/green).
  3. North Green On:

    • East Red remains on.
    • Duration: 30 seconds.
  4. West Green On:

    • Yellow signals activated briefly (10 seconds).
  5. South Green On:

    • West Red remains on.
    • Yellow signal activated briefly.
  6. Return to East Green:

    • Cycle continues.

Simulation

  • Use Proteus simulation tool to check the application.
  • Link the hex file (not the .c file) for the simulation to run.
  • Watch the operation of the signals clearly:
    • One signal green, others red, and yellow operating with less time.

Training and Support

  • Offers online/offline training and project support.
  • Hardware support and component sales available.
  • Contact details provided for inquiries (phone/WhatsApp/email).

Conclusion

  • Thank you for watching!
  • Encouragement to reach out with questions or project requirements.