Friday 18 April 2014

buffer - How to remove spikes from switching transistor?


I am building a steady current source which delivers steady current (0-20mA) to an LED. The brightness of the LED (current) is controlled through a potentiometer's voltage and a voltage follower as shown in the picture below. Further, I want to blink (modulate) this LED with a square pulse frequency of 2kHz using a switch between the transistor gate and the voltage follower output.


The problem is that every time the switch closes, spikes are produced at the base and as a result at the source. Even when I reduce the current of the LED to 1mA (example picture 2), the spikes don't go away. Only when I set the current of LED to 0 do the spikes dissapear.


So the question is how can I remove/reduce these spikes? Is there some way?


[Steady current source controlled by pot and modulated with switch[1]


picture 2



Answer



One way would be to use a SPDT switch, add a series resistor to the inverting input:


schematic


simulate this circuit – Schematic created using CircuitLab



Real switches have a certain amount of charge injection so a little more finesse may be required in a real implementation. A series resistor to the gate would slow the switching edges a bit, but in that case a capacitor from the output to the inverting input of the op-amp may be required for stability.


Some op-amps take longer than others to recover from saturation, so you could also just shop around for a different op-amp. Offhand, however, I don't have any useful suggestions- usually I try to avoid this situation.


Edit: Here is a really simple way to do this:


schematic


simulate this circuit


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...