1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Logic Design: Interpreting entering and leaving a room.

  1. Dec 28, 2013 #1

    PrincePhoenix

    User Avatar
    Gold Member

    The problem statement, all variables and given/known data
    Hello. We have been given a project in our course "Digital Logic Design", which is an introductory course to Digital Logic. We are only allowed to use gates, multiplexers, flip-flops/latches, counters, comparators, simple displays (like seven segments) etc.

    I am making an automatic room lighting system, for a room with one door.

    The attempt at a solution
    My logic is that there will be two IR transmittors and receivers, one each on either side of the door pane. Depending on the sequence in which the receivers go dark, the circuit will detect whether someone entered or left the room, increment/decrement a counter, counting the number of people accordingly. If the counter becomes zero, the light(s) are switched off. For greater than zero, it will be switched on.

    So I thought it'd be two sequence detectors (made from different gates) (one for each sequence)(we've already built one in a lab, using flip-flops(so, synchronous)), with the two IR receivers acting as inputs to the sequence detectors. On detecting either of the two sequences one of them will increment and the other would decrement the counter through their outputs.

    Now since it'd give an ouput in each clock cycle, the sequence of states that the detector will actually get will hardly ever match the ones for which I will make the sequence detector.

    Any pointers on how this may be overcome? Is it possible to make it purely through a combinational circuit?
    Can this logic work with an asynchronous circuit? (we haven't and won't be studying them this semester. We haven't studied counter yet. So I apologise for any weird assumptions made above about counters)
     
  2. jcsd
  3. Dec 28, 2013 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    I don't understand that.
    Once the second detector gets interrupted, send a signal to the counter and reset both sequence detectors.
    Probably.
     
  4. Dec 28, 2013 #3

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    What happens if two people enter the room together, and then only one leaves? You don't want to leave the other one person in the dark.
     
  5. Dec 28, 2013 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    As long as they don't touch each other (in the projection of the sensors), the system can work.
     
  6. Dec 29, 2013 #5

    PrincePhoenix

    User Avatar
    Gold Member

    What I meant to say was that each sequence detector would be looking for a particular sequence.
    One sequence detector would output '1' for incrementing the counter when the input sequence for entering is detected. (lets say it would be 00->01->11->10->00), while the other does the opposite for the leaving sequence (sequences will be generated by the IR receivers, so depending on the sequence in which they get interrupted, two different sequences will be generated).

    Being a synchronous circuit, it will be taking inputs every clock cycle. So if the clock is too fast, for the person's movement, it might take each input twice or maybe more, so it might not match the required sequence.

    The second sequence detector gets interrupted? Or the IR receiver/detector?
     
  7. Dec 29, 2013 #6

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Your clock (if you use one) has to be much faster than the persons, otherwise the system cannot work. The sequence detector needs a "wait" operation if nothing changes (it has to remember its state).

    The second IR detector.
     
  8. Dec 29, 2013 #7

    PrincePhoenix

    User Avatar
    Gold Member

    What is the "wait" operation? Staying in the same state if the inputs from the IR receivers remain unchanged? Or is it something more complicated?
    For the sequence detector to wait if nothing changes is exactly what I think I need.
     
  9. Dec 29, 2013 #8

    berkeman

    User Avatar

    Staff: Mentor

    There's a reason that typical room occupancy sensor systems use passive IR (PIR) detectors to detect occupancy. Counting bodies entering and leaving a room has too many problems, and can be too easily fooled. The PIR sensor is used to turn on the lights when motion is detected in the room, and a timer is used to turn off the lights some amount of time after no motion is detected.

    Also, be sure to use a synchronizer circuit if you are detecting some asynchronous events for processing in a synchronous circuit. Are you familiar with synchronizer circuits? Why are they necessary?
     
  10. Dec 29, 2013 #9

    PrincePhoenix

    User Avatar
    Gold Member

    No. Haven't studied any synchronizer circuit or their uses.
     
  11. Dec 29, 2013 #10

    berkeman

    User Avatar

    Staff: Mentor

  12. Dec 30, 2013 #11

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Right.
    Sure.

    @berkeman: It is a course about digital logic. IR sensors in the room are a nice solution for a product, but probably not so interesting in terms of digital logic.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Logic Design: Interpreting entering and leaving a room.
  1. Logic Design (Replies: 2)

  2. Logic circuit design (Replies: 8)

Loading...