Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

State Machine Baby Monitor Homework

Status
Not open for further replies.

John Pinares

Newbie level 4
Joined
Aug 31, 2014
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
55
Hey everyone. I'm having trouble with this homework assignment. Here it is:

A baby monitor system detects motion using a sensor (A0=1). The system should
sound an alarm (B0=1) if no motion is detected for at least 60 seconds. A button
(A1) or detected motion resets the system.

Im supposed to design this using state machines on the RIBS software. Right now if no motion is detected for 60 seconds the alarm sounds, as normal, but when i trigger motion (A0) or the reset button (A1), it waits the full 60 seconds for the alarm to turn of (B0=0). How can I fix that so that it turns off as soon as A0 || A1? Here is my SM, I set the period to 6 sec instead of 60 for the sake of testing. Thanks in advance

 

You should have a timer say T0. The timer should start on system boot. The motion is detected by A0 = 1. If the timer runs for 60 seconds and during this time motion is not detected then alarm should sound which is B0 = 1 but if motion is detected by A0 = 1 during this 60 seconds or if button A1 is pressed (A1 = 1) then Timer should restart and alarm should stop.

Algorithm


Start Timer

If 60 sec passed && no baby motion > sound alarm

else if motion detected || button pressed > restart Timer
 
Last edited:

Okay so I'm having trouble with "else if motion detected || button pressed > restart Timer" I'm guessing that transition goes from the NoMotion state to Motion, but maybe my code is wrong or I havent set up the timer correctly? heres what i have:

 

I did something like this but it doesn't work.

S1 is initial state and it will be there until msec < 6 sec and A0 = 1

It goes to Buzz state if msec > 6 sec and A0 remains 0 (no motion)

In Buzz state (B0 = 1) it remains there for 3 sec and then comes back to s1 state and before coming back to s1 state it resets msec to 0 and B0 to 0 (Buzz Off)

109561d1411325271-sm.png
 

Attachments

  • test.rar
    8.2 KB · Views: 97
  • sm.png
    sm.png
    68.4 KB · Views: 210
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top