O'Reilly logo

BeagleBone Home Automation Blueprints by Rodolfo Giometti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required