1
\$\begingroup\$

I was designing a people counter that uses two infrared leds and two phototransistors. The logic was derived using a finite state machine where by I derived a circuit that detects an entrance sequence, then sends a pulse, and one that detects the exit sequence. Both the outputs of these sequence detectors are combined together using an OR gate. the output of the OR gate is connected to the clk pin of the 4510 counter. Meanwhile the output of the entrance sequence detector circuit is connected to the up/pin. I connected LEDs at the output of the counters to display the values in binary. The problem I'm having is that the counting is strange, for instance it will start from zero to 66 to 120... it will continue showing random numbers. When I replace the sensors with toggle switches it works perfectly but when using sensor it counts erroneously. Why is this happening and how can I fix it?

I used j-k flip flops for the sequence detector. I'm clocking my flipflops with a 555 timer in astable mode having a frequency of 65 kHz.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Add a schematic, please. Do you have access to an oscilloscope or logic analyzer? \$\endgroup\$
    – uint128_t
    Commented Apr 27, 2016 at 6:27
  • \$\begingroup\$ Not today.since today is a holiday the campus labs are closed so i don't have access to oscilloscope and signal analysers,what would i have to do with them??. how do i send the schematic in this forum \$\endgroup\$
    – ntuli_kid
    Commented Apr 27, 2016 at 6:57
  • \$\begingroup\$ @ntuli_kid: You can either insert you own schematics as a picture or you can edit your question and use the built in schematic editor (CTRL M) to redraw your schematic. \$\endgroup\$
    – JRE
    Commented Apr 27, 2016 at 7:23

1 Answer 1

1
\$\begingroup\$

Most probably your sensors don't generate sharp enough edges to be used as a clock. That would explain why your circuit works with toggle switches.

You should pass the signals from the sensors through Schmitt triggers, if you want to keep your current design. If you were to start from scratch, I would advise NOT to use input signals as CLK altogether. Get a nice and clean clock signal from the resonator, and make your system sample sensor data often enough so that no human could sneak through in between the samples.

\$\endgroup\$
1
  • \$\begingroup\$ thank you very much Dmitry i will try that..for the clocking part i have changed the counter im now using 74192..so i inverted each sequence detector output, entrance output clocks the up pin and exit clocks the down pin..for the sensors i tried using the LM311 comparator to try convert the signal from analog to sigital but that you have mensioned the schmitt trigger i will have to try that \$\endgroup\$
    – ntuli_kid
    Commented Apr 27, 2016 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.