Logic Design: Interpreting entering and leaving a room.

In summary, an automatic room lighting system is being created using synchronous logic. Two sequence detectors are used to detect the sequence of events for entering and leaving a room. If two people enter the room together, the system will not leave the other person in the dark. If two people enter the room together, the system will leave the other person in the dark. The system needs a "wait" operation if nothing changes to remember its state. The "wait" operation is staying in the same state if the inputs from the IR receivers remain unchanged.
  • #1
PrincePhoenix
Gold Member
116
2
Homework Statement
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)
 
Physics news on Phys.org
  • #2
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.
I don't understand that.
Once the second detector gets interrupted, send a signal to the counter and reset both sequence detectors.
Can this logic work with an asynchronous circuit?
Probably.
 
  • #3
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.
 
  • #4
D H said:
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.
As long as they don't touch each other (in the projection of the sensors), the system can work.
 
  • #5
mfb said:
I don't understand that...

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.

mfb said:
...Once the second detector gets interrupted, send a signal to the counter and reset both sequence detectors...

The second sequence detector gets interrupted? Or the IR receiver/detector?
 
  • #6
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.
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 sequence detector gets interrupted? Or the IR receiver/detector?
The second IR detector.
 
  • Like
Likes 1 person
  • #7
mfb said:
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).

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.
 
  • #8
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?
 
  • #9
No. Haven't studied any synchronizer circuit or their uses.
 
  • #11
PrincePhoenix said:
What is the "wait" operation? Staying in the same state if the inputs from the IR receivers remain unchanged?
Right.
For the sequence detector to wait if nothing changes is exactly what I think I need.
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.
 

1. What is logic design?

Logic design is the process of creating a detailed plan for how a system or process will function. It involves breaking down a complex system into smaller, more manageable parts and designing the logic or decision-making process for each component.

2. How do you interpret someone entering a room?

The interpretation of someone entering a room can vary based on the specific context and situation. However, generally speaking, it can be interpreted as a sign of someone's presence or arrival in a space.

3. What is the process of interpreting someone leaving a room?

The process of interpreting someone leaving a room is similar to that of entering a room. It involves observing the individual's actions and movements and making conclusions about their departure from the space.

4. How does logic design play a role in interpreting entering and leaving a room?

Logic design can play a role in interpreting entering and leaving a room by helping us understand the different components and decision-making processes involved in the actions of individuals entering and leaving a room. It can also help us make predictions about future actions based on past observations.

5. Why is it important to understand the logic behind entering and exiting a room?

Understanding the logic behind entering and exiting a room can help us make sense of our surroundings and interactions with others. It can also help us make informed decisions about how we enter and leave a room, and how we interpret the actions of others in a given space.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
7K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Back
Top