Author Topic: Please help me understand this waveform.  (Read 3098 times)

0 Members and 1 Guest are viewing this topic.

Offline chipwitchTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: us
  • I barely know you!
Please help me understand this waveform.
« on: March 27, 2014, 05:45:54 pm »
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?
hello?.... <screech>.... is this thing on?
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: Please help me understand this waveform.
« Reply #1 on: March 27, 2014, 06:16:54 pm »
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.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7756
  • Country: de
  • A qualified hobbyist ;)
Re: Please help me understand this waveform.
« Reply #2 on: March 27, 2014, 06:35:13 pm »
 

Offline chipwitchTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: us
  • I barely know you!
Re: Please help me understand this waveform.
« Reply #3 on: March 27, 2014, 06:38:20 pm »
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.

Is this normal?
hello?.... <screech>.... is this thing on?
 

Offline chipwitchTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: us
  • I barely know you!
Re: Please help me understand this waveform.
« Reply #4 on: March 27, 2014, 06:39:38 pm »
There's an informative recent thread about piezo buzzers at https://www.eevblog.com/forum/microcontrollers/a-piezo-buzzer-that-affect-the-mcu-behaviour/.

Thanks, but it isn't really about the piezo.  It's about the waveform with the piezo removed from the circuit.
hello?.... <screech>.... is this thing on?
 

Offline chipwitchTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: us
  • I barely know you!
Re: Please help me understand this waveform.
« Reply #5 on: March 27, 2014, 06:52:21 pm »
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 then paralleled the 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.
hello?.... <screech>.... is this thing on?
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: Please help me understand this waveform.
« Reply #6 on: March 27, 2014, 06:55:28 pm »
Is this normal?

? 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.
 

Offline hlavac

  • Frequent Contributor
  • **
  • Posts: 536
  • Country: cz
Re: Please help me understand this waveform.
« Reply #7 on: March 27, 2014, 07:41:09 pm »
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...)


Good enough is the enemy of the best.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf