Thursday, March 15, 2018

Tick... tick... tick...

One of my goals in designing a new PCB for the Canon P170-DH calculator is to add a key-click sound to positively indicate that a valid key-press has been detected. This was more important before I decided to implement the fluorescent display, but I think it's still valid.

Some people have done this by taking a piezo-electric transducer and driving it with a single, narrow pulse. Apparently this gives a sharp "TICK" sound. But I want something longer. And probably louder.

I came across a discussion on exactly this topic on a site called A user there who goes by the name Yoe posted a link to a YouTube video with the sound of the keyboard in the background, and this snippet of a schematic showing the circuit that produces the sound:

The sound is produced by one half of a 556 timer operating in astable mode (R7, R5, C15) which produces a roughly 2 KHz tone through R6 and speaker LS1. The microprocessor disables the tone by holding the Threshold and Trigger pins (2 and 6, respectively) low through CR5. To make the key-click sound the microprocessor drives its output P24 high for 10-15 milliseconds.

I thought I'd duplicate this circuit and see how it sounds. I happen to have a 556 dual timer in my parts bin, and I wired up the first half of the timer pretty much the way shown above. I wired the second half to generate a 15 millisecond pulse once per second, and used its output through a transistor to control the first half's RESET line. This produces a periodic chirp from a piezo-transducer. It sounds pretty good!

In the final implementation I'll generate the key-click sound from a pin on the FPGA rather than using a 555 timer. Before I can settle on the final circuit, though, I need to buy a different piezo-transducer. The one I have is from another project, and it's optimized to produce a 4 KHz tone rather than the 2 KHz signal this circuit generates.

Speaking of which, I've just discovered that the last of the electronics stores in my area has closed. The only local source for electronic parts is now Microcenter, which does seem to have at least common parts in stock, though they seem to be focused on the Raspberry Pi and Arduino communities rather than the electronics hobbyist. Other than that it's DigiKey or Mouser, and a couple days wait for delivery.

No comments:

Post a Comment