Produce sound for keypad tacktile feedback

ZOR

Senior Member
I am trying to get an audiable click when pressing a keypad.

I tried sinking a Picaxe port into a device with sound B.4,(255,1), but it was too quiet. The device was buzzer.jpg

I then tried using a transistor to drive it. The device was louder, but sounded too sqeaky!

After this I went to a speaker which sounded better, but still was not a true click. As well as all this I want other frequency tones (siren). Am I using the wrong sound device? Thanks
 

Technical

Technical Support
Staff member
255 is not a correct note value for the sound command, try values 1-127 instead. The piezo should be fine for a click noise.
 

ZOR

Senior Member
Thanks Technical, will try tomorrow. Am I correct the piezo I am using will not produce different frequency notes for a siren? Regards
 

techElder

Well-known member
I've had success by capacitive coupling the buzzer you show to the output pin. Then you can adjust the "click" noise by adjusting the capacitor value. You may find that you have to provide a small bias current to the buzzer. Depends on the buzzer.

You can also use the buzzer as an "alarm" by driving it in the normal way. I would probably run the capacitor to a pulse output through a diode if adding this "alarm" function. The click would occur on the rising edge of the pulse.
 

ZOR

Senior Member
Many thanks Texasclodhopper, I will give that a try. I also have just seen/ordered a miniature pcb 8 ohm loudspeaker from the Picaxe store to see how they work out getting different frequency outputs.

I was greatful Technical came on to help, with so many Black Friday questions out there. Not surprised though, they do have costs running the ship and need some return on their investments, greatful for what they and the forum do for all of us.
 

premelec

Senior Member
I suggest a higher impedance sound device - e.g. earpiece from old telephone handset or cell phone... there are also 50 ohm 2" speakers around... a mechanical tuning tube [paper cylinder or can] can help a lot...
 

ZOR

Senior Member
Thanks premelec, erco. The buzzer identified is the one I was playing with, and the link provided showed me Frequency: 2300 +/-500Hz, which is why I cannot get away from a single frequency noise. The clicking device uses a flashing LED, so to control for a keypad single press/click would need taming. I think I will investigate more with the speaker ordered from the Picaxe shop when it arrives. Might need to trigger a 555 with the Picaxe to get a smooth up/down siren noise in addition to clicks (single click metronome type sound)
 

ZOR

Senior Member
Thanks. At least I can get different tone frequencies out of a 555. I am connecting a speaker via transistor to a 14M2 port, and tried all permutations of the sound command to get different frequencies out. Now been trying tune, but see only 08M2 has a tune pin, nothing on 14M2?

So to get a single click for Keypad feedback and get up/down frequency siren it's putting an 08M2 in circuit or going descrete. I thought this bit would be the easy part. Duh!
 

Technical

Technical Support
Staff member
Buzzers and piezos often look very similar.

A buzzer will produce a sound when connected directly to battery all by itself - as it has an internal drive. Single frequency, PICAXE control with high/low commands.

A piezo will not make any sound when connected to a battery, as it needs the PICAXE chip to create the waveform using sound or tune commands.

On 08M2 tune is fixed on pin 2. On 14M2 you can use any pin.
 

hippy

Technical Support
Staff member
All latest PICAXE, except 08M2, can put SOUND and TUNE commands out on any output pin.

You can also use PWM and perhaps even bit-banging to vary the sound of the piezo / speaker. There should generally not be a need to offload work to a 555.

If you are trying to create sounds for a siren to scare burglars off you probably need a genuine burglar alarm 'sound bomb' which can put out 100dB or so.
 

ZOR

Senior Member
Thanks both. No hippy, it's just a warning noise and not a true siren. Again thanks both, and hope I have not shot myself in the foot with what I have done, but working with tune I could not find a tune pin on the 14M2. So in my horror It has drawn attention with what I have been working on. I have tried to use a 14M2 for what was an 08M2 phone dialler together with other operations. I then realised C.2 on the 08M2 was a tunes pin, but I am trying to use B.5 on a 14M2.

14M2DIALLER.jpg

Am I in a mess?
 

ZOR

Senior Member
And I hope you have a Good Christmas when it arrives. In my 08M2 version, my code calls tune 0, 4,($30,$40,$50,$40,$50,$60,$70) so maybe that will need tweaking. Regards
 

ZOR

Senior Member
Thanks again hippy, technical, that's got me sorted nicely. The tune command solves everything. Regards
 

tmfkam

Senior Member
I use a piezo 'buzzer' (with built in oscillator, and a similar centre frequency to Erco's) in conjunction with the sound command for confirming button presses in menus and the like. I have an LED and resistor in parallel with the buzzer which lights as the sound is played, giving both visual and audible feedback. The buzzer and LED/resistor are connected directly from pin c.4 to ground, no transistors are fitted to amplify the signal.

Symbol definitions:
Code:
Symbol Buzz=c.4
Symbol SPitchHi=104
Symbol SPitchLo=100
Symbol SPitchChirp=110
Symbol SLenL=50
Symbol SLen=35
Symbol SLenS=10
Symbol STick=2
Symbol ShtDelay=250
My command for a 'Tick' to confirm button presses is:
Code:
Sound Buzz,(SPitchChirp,STick)
It is surprising how much difference there is between sounds of relatively small changes in pitch (110 to 104 to 100) and varying the duration (50 to 35 to 10 to 2).

Further differentiation is made by combining sound sequences.

For an option turned on: (Beeps start low and end with a longer high)
Code:
Sound Buzz,(SPitchLo,SLenS)
Pause ShtDelay
Sound Buzz,(SPitchHi,SLenS)
Pause ShtDelay
Sound Buzz,(SPitchChirp,SLenL)
For an option turned off: (Beeps start high and end with a longer low)
Code:
Sound Buzz,(SPitchChirp,SLenS)
Pause ShtDelay
Sound Buzz,(SPitchHi,SLenS)
Pause ShtDelay
Sound Buzz,(SPitchLo,SLenL)
My intention was (and I think I succeeded) to provide a simple menu that had only audio (with visual confirmation from the associated LED) feedback, allowing selection of five or six options with on or off of the options indicated on change, as well as incrementing those that had numeric options, with no LCD display fitted and with only two buttons.
 

ZOR

Senior Member
Thanks tmfkam, interesting, will try that over the weekend. Don't know if my buzzer has a built in oscillator, it's the same device erco has. Regards
 

erco

Senior Member
I think you're there already, just wire it active low (sink current) and send a short pulsout.

high 2
do
pulsout 2,500
pause 300
loop

 

ZOR

Senior Member
Thanks erco, I tried beeper and speaker, and opted for speaker as the beeper is too shrill. Also getting my tick with the sound command and my low level warning noise from Tune mode. Ordered a nice small speaker from the Picaxe shop (new product) so I should be home and dry, but thanks for your addition.
 
Top