Setting up the software

This time, to implement the software of this prototype, we can use a state-machine with the following states and their relative transactions:

State

Description

Actions

Transaction conditions

IDLE

Idle state; the washing machine is not working.

  • LED yellow off
  • LED red off
  • If sound is detected, set t0=t and move state to SOUND.

SOUND

Sound detected! Keep monitoring the environment for a while.

  • LED yellow is blinking
  • LED red is off
  • If sound is detected and t-t0 > timeout, move to RUNNING.

RUNNING

Continuous sound detected so the washing machine has started its job.

  • LED yellow is on
  • LED red is off
  • Alert the user
  • If no sound is detected, set t0=t and move to NO_SOUND.

NO_SOUND

No more sound detected! Keep ...

Get BeagleBone: Creative Projects for Hobbyists now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.