🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Piezo Transducer or BC548 Transistor problem.

Started by
0 comments, last by hplus0603 15 years, 6 months ago
help.. i managed to do the drumset using parallel port. the problem is, i cant use the piezo properly.here how i do it. i connect pin2(d1) of the parallel port to the COLLECTOR of the NPN transistor(BC548). then i connect the positive wire of the piezo to the BASE of the transistor. then i connect the ground to the EMITTER of the transistor. I also connect the negative wire of the piezo to the ground. The problem is, when i hit the piezo,sometimes the PC reconizes the input,sometimes don't. I tested using a switch,it works perfectly. So my guess it that the voltage of piezo that is giving then BASE is very low. OR maybe the BASE of the transistor is expecting high voltage than a piezo can give. so how will i solve this problem? please help me..
Advertisement
It may be that you're not polling the parallel port at the exact time that the signal is high? I don't think the parallel port is latched?
If so, you should put a latch (or flip-flop) on the detect pin. Then wire one of the outgoing parallel port signals to the "reset" of the latch.
Then, reading looks like:
1) read parallel port input
2) set reset bit
3) clear reset bit

This will make sure that any hit that happens between reads is still detected (turns an edge event into an acknowledged level event).

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement