Traffic light demo

Traffic light control with Arduino using Finite State Machine, Arduino UNO Rev2, WawiLib, direct access to Arduino variables, breakpoints, data recording & Wi-Fi connection.

Introduction

This video gives an overview of the setup with a situation layout: A car traveling in direction A and a person B that wants to use a zebra crossing. Both can only travel when the traffic lights allow them to. The person has a button he or she can press if the process needs to be speeded up. There is also an LCD display indicating the to the person B what he needs to do in text.

Hardware overview

Here we see an overview of the hardware lay-out, with traffic lights LCD display, the button and the Uno Wi-Fi Rev2.

Principle of FSM

This video gives an introduction to the concept of the FSM (Finite State Machine).

Live demo

Here we see a live demo of the application, you can see the FSM status changing after it is enabled. You can see the timers running and you can see the status of the button request. During the demo you will also see the use of a breakpoint to stop the FSM from going further.

Data recording

This video shows how to record the values of the variables and the output of the .print() statements to a disk file on the PC over WiFI. This technique can be very handy in case somebody wants to record what the application is doing for later analysis.

Arduino source code details

This video shows in detail how the application is coded, with the finite state machine and the timer objects. If you want to learn how an application is programmed without delays in a structured way this is certainly a very interesting demo. (Use of enumerator class to represent the states of the FSM, use of timer objects to encapsulate the millis() function etc…)

Setup demo for UNO & USB serial

This video shows how to install WawiLib and the demo application. The demo focuses on the use of a standard Arduino Uno and not on the Uno rev2 because not everybody owns an Arduino Uno Rev2. (The WiFi code is also installed in the video.)