Building a Counter with IR Sensor and Manual Buttons

  • Thread starter Thread starter Kalagaraz
  • Start date Start date
  • Tags Tags
    Electronics
AI Thread Summary
The discussion centers on designing a digital counter that increments by one when an IR beam is interrupted and can be manually adjusted using + and - buttons. The user seeks advice on ensuring the counter only increments once per interruption and questions the effectiveness of using an IR LED and phototransistor for motion detection. There is also a request for recommendations on digital circuit design resources, as the user struggles with visualizing electrical flow and applying Ohm's Law. Clarifications are provided regarding the behavior of the circuit when switches are in high or low positions, emphasizing the importance of understanding voltage distribution and current paths. Overall, the conversation highlights the complexities of circuit design and the need for foundational knowledge in electronics.
Kalagaraz
Messages
27
Reaction score
0
I'm trying to learn to design digital circuits so as a project I wanted to build a counter that would work as follows:

When a reset button is pushed, it will set the counter at 0
When a + button is pushed, it will add one to the counter
when a - button is pushed, it will subtract one from the counter

and the complicated condition:

When a IR sensor/IR led pair gets interrupted it will add 1 to the counter

So basically I want to make a counter that goes up by one when something blocks the beam and then the +/- buttons are for manual adjusting it in case of an error or something.

I know I can build the sensor with a phototransistor as a switch, but the thing is I'm not sure how to limit the circuit incrementing the counter 1 and only 1 time when the beam is interrupted?

Also, I'd like some advice on whether an IR led / phototransistor is the best motion detection combination, if there is an easier alternative I would gladly hear it.

At work they have something similar, but I'm not sure it's IR. They have a beam that shoots and reflects off some kind of kalediscope looking mirror. I don't think it's IR, because when looking at mirror from angle is beam you can see red light being reflected. If I knew exactly what it was, I would make use of their beam and mirror, and just use my own detector.

Thanks for any help.
 
Engineering news on Phys.org
Any specific books you guys recommend? I understand a bit, like I got no problem with logic gates etc... stuff like that, but I do some have difficulty mentally visualizing the path electricity flows.

For example

circuit0002.jpg


I know that only low will light when the switch is low, and high etc..., but I don't know WHY. People have tried explaining it to me but I don't understand. I've been staring at it all day to try and figure it out on my own, tell me if this reasoning is right.

When the switch is high, the electricity has 2 paths it could possibly flow. Up around towards the low indicator, and then through the switch to the high LED. The up around would require it going through a total of 4 resistive elements, then switch 2 elements. So it takes the path of least resistance and takes the switch path first. This puts Y as +5v so now the electricity can't flow through the LOW indicator because there is no potential different +5v on both sides..

That's the only reasoning I can think of why it doesn't take both paths...
 
With the switch on HIGH, what will be the voltage at OUTPUT? How much voltage will be across the LOW indicator? How much voltage will be across the HIGH indicator?

Ohm's Law is the key to understanding these circuits. [ E = I * R ] How would you apply it to the above circuit?
 
skeptic2 said:
With the switch on HIGH, what will be the voltage at OUTPUT? How much voltage will be across the LOW indicator? How much voltage will be across the HIGH indicator?

Ohm's Law is the key to understanding these circuits. [ E = I * R ] How would you apply it to the above circuit?

V = IR, 5v / 780 ohms = ~6 milliamps. That's all I know :(
 
Kalagaraz said:
V = IR, 5v / 780 ohms = ~6 milliamps. That's all I know :(

In your circuit you show 5V connected to the bottom of the upper 390 ohm resistor. How much voltage would you say is across that resistor?
 
i think..when the switch is high the current will flow through high indicator because at junction"y" it is five volt and above it is also 5 volt so the low indicator LED will be reverse biased and hence will not conduct and so the current will pass thru high indicator and it will glow.

and when the switch is low the left side supply is isolated and the current will flow from the above voltage supply to low indicator led and then to the ground via the switch.current will not go through high indicator because it high resistive path.

i think it is clear now.
 
Back
Top