Coder Social home page Coder Social logo

arduino-traffic-lights's Introduction

Arduino Traffic Lights

This repository has the source code and circuit diagrams to build toy traffic lights.

Source Code

The source code is uses the Arduino outputs as follows:

  • D13: Green light
  • D12: Amber light
  • D11: Red light
  • A0: Analogue input to control traffic light speed

There are three versions of the source code:

  1. traffic-light-stand-alone: switches lights in traffic light sequence with speed control
  2. traffic-light-transmitter: as per the stand-alone version but also sends commands via serial port to control a second traffic light
  3. traffic-light-receiver: version that does not run by itself but switches lights based on commands received from the transmitter version

Circuit

The circuit diagram was created using www.circuit-diagram.org/ and can be accessed here

Digital output pins 11-13 on the Arduiono are connected to the base of each transistor which are used as switches to drive the LEDs directly from the 5V supply on the Arduino board. You may need to adjust the values of the current limiting resistors to achieve about the same brightness for each group of LEDs.

A potentiometer is used to provide an input from 0V to 5V to A0 on the Arduino in order to adjust the speed of the traffic light sequence.

Circuit Diagram

Veroboard

An example veroboard layout is included which groups each set of 5 LEDs together and can be mounted on the inside of a housing.

It was created using VeeCAD which can be downloaded here. The source file is included in the VeeCAD folder.

Veroboard Layout

Component Listing

TBC

arduino-traffic-lights's People

Contributors

daviddaly avatar

Watchers

James Cloos avatar  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.