Thomas, One quick comment, If the PIC is powered and the driver pin is set as an output, then it will present a low impedance load to the piezo, and protection diodes are unlikely to be required. However, protection diodes are advisable if the piezo is likely to produce voltage when the PIC is turned off, or while the pin is set as an input. TVS diodes generally will not clamp at an accurate enough voltage to protect the PIC properly, e.g. a 5V TVS is only likely to become effective at 6V or so. (eg the SM05, spec'd at 1mA at 6V), Also, as they protect to a fixed voltage, they will give minimal protection to an unpowered circuit. Protection diodes (schottky) to the rails are a better idea - unless the prospective current is sufficient to pump up the rail voltage, in which case a zener or TVS etc. on the power line will also be advised. RP 2008/6/25 Vitaliy : > Tom=E1s =D3 h=C9ilidhe wrote: >>> The voltage generated has opposite polarity (relative to the driving >>> voltage), so you just need to put a diode in parallel (cathode to >>> anode, anode to cathode) with the speaker, if you're driving it with >>> one pin. Although I've heard that vibration (or a strong impact) can >>> also generate high voltage, in which case polarity is not guaranteed. >> I don't quite understand how putting a reverse-biased diode in parallel >> would work. The more I think about it, the more I think it actually just >> does harm. >> >> Here's my attempt at breaking it down: >> When the piezo is not generating a voltage, the diode will be reversed >> biased and so nothing will flow through it. If the cathode of the piezo >> were to raise above the voltage of the anode, then the diode would allow >> current to flow directly from the piezo's cathode into the PIC's pin >> (e.g. from 6 volts to 5 volts). Is this not a horribly bad thing? > > The diode will act as a short, bringing the voltage across the piezo to 0V > (well, OK, -0.7V). To understand what it does, replace the diode with a > piece of wire in the schematic I attached earlier. > >> if the anode of the piezo were to increase in voltage, then current >> would flow directly into the PIC pin. The diode will have no effect on >> this. So what exactly does the diode do? > > It protects against reverse voltage "kickback". > >> It appears to me that four things can happen: >> 1) Voltage on piezo anode increases >> 2) Voltage on piezo anode decreases >> 3) Voltage on piezo cathode increases >> 4) Voltage on piezeo cathode decreases >> >> Number 2 and number 3 seem to be harmless, they'll just result in less >> current flowing overall. > > Not true. If votage on piezo anode decreases, eventually anode becomes mo= re > negative than the cathode -- that's your worst possible situation. What y= ou > get is this: > > --- PIC pin (+) ---- (-) piezo anode, piezo cathode (+) --- ground > > Essentially, you have two voltage sources connected in series, so the tot= al > voltage on the PIC pin is roughly Vdd + Vpiezo. If Vpiezo is high enough, > the PIC pin will be zapped. > >> Number 4 will result in more current being sourced from the PIC pin. > > The cathode is connected to the ground, so you will never measure a volta= ge > below 0V on the cathode. > >> Number 1 will result in current being sunk into the PIC pin. > > True. > > [snip] >> Number 1, however, seems to be much more sinister, it appears that >> current will flow directly from the piezo's anode into the PIC pin. > > Theoretically true, but I have never seen it happen. Short of directly > impacting the membrane, how can you make the piezo anode more positive? > >> So, taking all this into account, it seems to me that the remedy is to >> put a normal forward-biased diode in series with the piezo to ensure >> that no current gets sunk into the PIC pin. >> >> If I don't understand correctly then please help me out! > > The disadvantage of that approach is, you're dropping 0.7V across the dio= de. > Also, I'm not sure how much kickback voltage a piezo can deliver -- anyon= e? > > For example, the reason the diode is put across the relay coil, and not in > series, is because the kickback voltage can be in the hundreds of volts (= the > diode may suffer reverse break down if connected in series). > > I'm sure the kickback voltage from a piezo is higher than the supplied > voltage. Think of it as a bow-string: you put in a lot of energy slowly (= low > voltage), and then release all that energy in the opposite direction, > quickly (high voltage). > > Vitaliy > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist