Making detecting pulses easier?

Thread Starter

wrybread

Joined Jul 3, 2005
32
I'm interfacing a computer to an old Seeburg tabletop jukebox unit (this kind of thing: http://canovan.com/store/media/JukeSee1.jpg). The unit sends pulses, which I'm trying to detect in a Python script. It generally works great, but from time to time I miss a pulse.

The pulses are about 50ms apart.

I'm wondering if there's some simple circuit I could make to make the pulses more pronounced and easier to detect? I'm a beginner at circuit design if that's a factor.

Thanks for any help.
 

Austin Clark

Joined Dec 28, 2011
412
Try looking at monostable multivibrators. http://upload.wikimedia.org/wikipedia/commons/5/59/Transistor_Monostable.svg

Triggering it will cause it to change state temporarily, based on the capacitor value and resistor values. Meaning a short pulse can cause the vibrator to change state for a longer period of time :)

Use a NOT gate to buffer and invert the input to the monostable multivibrator.

EDIT: You may also consider using a flip-flop. It'll change state with every pulse. You could just detect when the state changes. This is probably the best solution, actually. You can get ICs that perform this function easily, and at wide voltage ranges.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
The likely cause is a "python script" being a high level interpreted language that runs slowly and is subservient to all the PC interrupts etc.

If the script is just polling the PC parallel port then all the PC interrupts will interfere with the script and during any interrupt the pulse cannot be detected and will be missed.

If you provide more info on what the pulses do, and frequency. timing etc and info on your PC and how it detects the pulses we can help you a lot better.
 

Austin Clark

Joined Dec 28, 2011
412
The likely cause is a "python script" being a high level interpreted language that runs slowly and is subservient to all the PC interrupts etc.

If the script is just polling the PC parallel port then all the PC interrupts will interfere with the script and during any interrupt the pulse cannot be detected and will be missed.

If you provide more info on what the pulses do, and frequency. timing etc and info on your PC and how it detects the pulses we can help you a lot better.
I would assume close to 20Hz, beings that he said they were 50ms apart. This isn't very fast and, I suspect, should be easily detected by any computer, even using Python, IF they lasted long enough and weren't too short as to "slip" between the samples taken. Thus, his best solution, I feel, would still be the flip-flop idea.
 
Top