Please help me understand this waveform. - Page 1
Forum section: electronics / beginners

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 27, 2014, 05:45:54 pm
content: I bought some of those cheap piezo elements on eBay. Today, I started playing with it as a speaker rather than a detection device to see how loud they are outside of a case. Initially, using an Arduino to create a simulate an oscillator, I managed to get a descent sound out of it at 3 kHz just using the 5V output on one of the digital pins. Great. So far, so good.I decided to see what would happen with a higher voltage. So, using a 3904 NPN, I built the attached circuit on a bread board. The 7.5V input is a dying 9V battery. Using the same sketch and series resistor (100 ohms), I expected to get more sound. Instead, all I got was a faint "click." No oscillation. I connected my scope across the series resistor and piezo (positive source and collector). I got a steady DC voltage of ~7V. I removed the piezo and resistor from the circuit to get a look at the collector voltage. What I got was the waveform in the second photo. Peak is ~7V. It looks like when the output pin goes LOW, the voltage spikes a tiny bit, then decreases linearly until the pin goes HIGH again. I also checked the signal (base to ground) and it was the perfect square wave I expected. Is this normal behavior for these transistors? When I read the datasheet, it looks like they can switch in the MHz range. I originally had a 1000 ohm resistor to limit Ib, but lowered it trying to improve the switching time.What should have been the proper thought process in diagnosing this?

author: Andy Watson
author_rank: Super Contributor
timestamp: March 27, 2014, 06:16:54 pm
content: Tricky!The easy part first - think of the piezo as a capacitor - you need to drive current in and draw current out to charge/discharge it. The circuit with the transistor will only charge the piezo, so beyond the first, switch-on pulse the piezo remains charged and nothing much happens.The waveform: I think what is happening is that the rising edge of the signal driving the base is being capacitively coupled to the collector - hence the spike/overshoot. The level is then maintained, from the drive signal by the forward biased base-collector junction - remember the transistor is also conducting. I don't know what happens at the end of the flat period - where there is a momentary positive blip - you are possibly seeing the forward-recovery characteristic of the B-C diode. When the drive signal is low, the transistor turns off and what remains of the charge can be seen discharging through the oscilloscope input impedance.

author: madires
author_rank: Super Contributor
timestamp: March 27, 2014, 06:35:13 pm
content: There's an informative recent thread about piezo buzzers athttps://www.eevblog.com/forum/microcontrollers/a-piezo-buzzer-that-affect-the-mcu-behaviour/.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 27, 2014, 06:38:20 pm
content: Quote from: Andy Watson on March 27, 2014, 06:16:54 pmIs this normal?

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 27, 2014, 06:39:38 pm
content: Quote from: madires on March 27, 2014, 06:35:13 pmThanks, but it isn't really about the piezo. It's about the waveform with the piezo removed from the circuit.

author: chipwitch
author_rank: Frequent Contributor
timestamp: March 27, 2014, 06:52:21 pm
content: Andy, I can't say I understand all of what you said about the waveform, but it made me think about how I might be able to discharge a capacitance. It may be wrong thinking, but I decided to throw a 10k resistor in the circuit between the battery and the collector. That smoothed out the wave to a nice square, the way it ought to be. I thenparalleledthe piezo with it and got a faint sound. I removed the 10k and connected the battery direct to my 100 ohm resistor (90 mA). Not efficient, but it works. So, I'm guessing this means you were right. Without a load on the collector, the signal was picking up the effects of the transistor's internal capacitance. If that's the case... it's pretty cool. I've read about the internal capacitance of various components, but this kind of puts a face to it.

author: Andy Watson
author_rank: Super Contributor
timestamp: March 27, 2014, 06:55:28 pm
content: Quote from: chipwitch on March 27, 2014, 06:38:20 pm? I don't think it is abnormal! It might be instructive to display the signal at the base simultaneously with the collector waveform. I think my explanation fits reasonably well except for the source of the excess charge when the drive turns off - there does appear to be a lot of it.

author: hlavac
author_rank: Frequent Contributor
timestamp: March 27, 2014, 07:41:09 pm
content: Hmmm. The flat part might be due to the difference in voltage drop between the Base-Emitor and Base-Collector diodes due to higher current in Base-Emitor one? They are both forward biased when the square wave goes high, but base-collector one gets almost no current so collector gets ~0.25V higher than emitor...The diagonal part may be some sort of scope probe effect (looks like some more or less constant bias current discharging the collector/probe capacitance...)