Logic Design: Interpreting entering and leaving a room.

  • Thread starter Thread starter PrincePhoenix
  • Start date Start date
  • Tags Tags
    Design Logic
Click For Summary

Discussion Overview

The discussion revolves around the design of an automatic room lighting system using digital logic components. Participants explore the feasibility of using IR sensors to detect entry and exit through a door, focusing on the logic required to count the number of people in the room and control the lighting accordingly. The scope includes theoretical considerations of synchronous and asynchronous circuits, as well as practical implications of the proposed design.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related
  • Mathematical reasoning

Main Points Raised

  • One participant proposes using two IR transmitters and receivers to detect entry and exit sequences, suggesting that a counter could be incremented or decremented based on the detected sequences.
  • Another participant questions the reliability of the system if two people enter simultaneously and only one leaves, raising concerns about the lighting control.
  • There is discussion about the challenges of using a synchronous circuit, particularly regarding the clock speed and the potential for miscounting due to rapid movements.
  • A participant mentions the need for a "wait" operation in the sequence detector to maintain its state when inputs remain unchanged.
  • One participant introduces the idea of using passive IR (PIR) sensors as a more reliable alternative for occupancy detection, citing issues with counting bodies accurately.
  • Another participant highlights the importance of synchronizer circuits when dealing with asynchronous events in a synchronous system, although some participants express unfamiliarity with these circuits.

Areas of Agreement / Disagreement

Participants express various concerns and suggestions regarding the proposed design, indicating that multiple competing views remain. There is no consensus on the best approach to implement the system, particularly regarding the use of synchronous versus asynchronous circuits and the reliability of the counting method.

Contextual Notes

Participants have not yet studied counters or synchronizer circuits in detail, which may limit their understanding of the implications of their proposed designs. Additionally, the discussion includes assumptions about the behavior of the IR sensors and the timing of inputs that have not been fully resolved.

PrincePhoenix
Gold Member
Messages
116
Reaction score
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
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.
 
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.
 
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.
 
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?
 
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   Reactions: 1 person
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.
 
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?
 
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
8K
Replies
3
Views
8K
Replies
2
Views
2K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
5
Views
2K