Giter Site home page Giter Site logo

lkmidas / traffic-light-system-on-bkit-pic Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 7.81 MB

A simulation of a 4-way intersection traffic light system on a custom made PIC development board.

C 97.90% Objective-C 2.10%
pic traffic-light embedded-systems

traffic-light-system-on-bkit-pic's Introduction

Traffic light system on BKIT PIC

This is my project for HCMUT Computer Engineering course CO2021 - Logic Design Project: Simulating a 4-way intersection traffic light system on the BKIT PIC development board. More details are in the report file (written in Vietnamese).

Introduction

Traffic light system is a common application of an embedded system. In this project, I will simulating such a system using the BKIT PIC development board, which is based on the PIC18F4620 microcontroller and developed by BKIT Hardware Club.

Features

  • The system that can work in 3 different mode: automatic countdown, manual, and standby.
  • In automatic countdown mode, the lights will change its state when the countdown reaches zero.
  • In manual mode, the lights' state can only be changed manually using the B button.
  • Switch between these 2 modes using button A.
  • In standby mode, only yellow lights will blink, switch to this mode using button #.
  • Next 2 features are about the countdown timer. A special condition feature is simulated using 2 buttons C and D which stands for "entering special condition" and "leaving special condition", which will change the timer accordingly using 2 sets of predefined timers. In the real world, special conditions can be something like rush hour, or the state of the traffic.
  • In addition to those 2 predefined timers, you can set it manually using the * and the number buttons.
  • The last feature is force switching: the lights can go immediately from red to green and green to red using button 0. This is to simulate the case when there is a prioritized vehicle like an ambulance or a fire truck approaching the intersection. In the real application, the button can be replaced by something like a camera or a sensor.
  • The output signals are simulated on a traffic light demonstration board, the design of that board on Altium Designer can be found in this repository.

Program structure

The program uses 4 modules: lcd, button, interrupt and timer. Its structure is shown in the diagram below:

structure

Implementation

The system is designed using a state diagram based design with 14 states in total. The state diagram is shown below:

structure

Demonstration

The video where I demonstrate the product in details can be accessed at this link: https://youtu.be/UaOuD4EGTHY

Contributors

DangLKM: https://github.com/LKMDang

traffic-light-system-on-bkit-pic's People

Contributors

lkmidas avatar

Stargazers

AVA avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.