Case study: Alarm State Machine

In this chapter, we will design an Alarm Circuit based on a Finite State Machine (FSM). This example of conception can be adapted to many other State Machine you would like to do.



State Machine

A state machine is a model of behavior composed of states, transitions between these states, and actions.

In our example, we will have 3 states:

  • Sleep state (You are at home)
  • Arm state (Before leaving home, you set the alarm on)
  • Alarm state (Something happened !)

We have two actions (outputs) in our system:

  • in Arm state, an indicator will show that this state is on.
  • in Alarm state, a siren (or any alarm device) will be on

Many events (inputs) can appear:

  • The alarm is armed (You are leaving home)
  • The alarm is disarmed (You are back)
  • There is an intrusion
  • The alarm time-out has expired (for instance, the siren was sounding and has to stop now)

The relations between states and transitions are shown on this graph:



We have to build an electronic circuit which functions this way.