And if you drive the base from an op amp with the amp positive input connected to the emitter and set the amp negative input to the voltage you want on the base you have a genuine constant current generator. The negative feed back removes - to first order -- the effect of changes in Vbe with temperature. On 3 March 2015 at 18:14, Electron wrote: > > > Howdy Wouter, > > At 11.27 2015.03.03, Wouter van Ooijen wrote: > >Electron schreef op 03-Mar-15 om 10:15 AM: > >> Hi Wouter, > >> > >> At 16.27 2015.02.28, Wouter van Ooijen wrote: > >>> Electron schreef op 28-Feb-15 om 11:10 AM: > >>>> Hello, > >>>> please take a look at the following circuit: > >>>> http://oi57.tinypic.com/256h0fa.jpg > >>>> > >>>> I use a high voltage (500V) PNP transistor as a high side switch. > >>>> With a PIC pin I turn it ON or OFF, through the NPN high voltage > >>> (500V) transistor. > >>>> The 200K resistor is to partially turn ON the transistor when the > >>> PIC is in tri-state (e.g. during brief reset time). Then the PIC will > >>> be either ON or OFF, so it will be able to withstand also the leakage > >> >from that 200K resistor (2 mA worst case, the protection diodes can > >>> withstand it). 200K and 2K resistors are of course rated for 400V > >>> (actually I use a couple of 200V equal resistors (half resistance) > >in serie). > >>>> Basicly the PIC knows the voltage of both sides, and turns ON the > >>> switch when the left side voltage is higher than the right side > >>> voltage, with some exceptions. > >>>> It's like a diode, but being in software it allows me to do things > >>> that a diode cannot do. > >>>> Switching speed can be in the KHz region. The impedance is not > >>> really low (currents are 100 mA peak max, and limited by the source > anyway). > >>>> Now the question: do you think that the Rb resistor is really > necessary? > >>>> If so, why? > >>>> > >>> Static case: Without that resistor the off-current (leakage) of the N= PN > >>> will be amplified by the worst case (in this case: highest) Hfe of th= e > >>> PNP. The resulting current will flow through the PNP, even when it is > >>> supposed to be off. The Rb is there to 'take' this current without > >>> causing the BE junction of the PNP to conduct. So this resistor must = be > >>> less than 0.6V/(NPN leakage). > >>> > >>> Dynamic case: When the NPN switches off, the charge on the base of th= e > >>> PNP will keep it conduction for some time. The Rb resistor will amek = it > >>> switch off faster. > >>> > >>> Suggestion: add a 5V zener from NPN base to ground, and put the 2k in > >>> the emitter lead. That makes the NPN stage a constant current sink, s= o > >>> you will have more predictable properties. > > > >If 3.3V, make the zender 3.3V too. > > > >Choose the emitter resistor as 2.7V / (PNP base current). > >> But will it still be possible to turn it ON and OFF via the (3.3V) PIC= ? > > > >Yes, of course. > > Today I ran some simulations.. I understood that if I force a certain > voltage > at the base of the transistor, of course I will have that minus the Vbe > drop > at the emitter. But here comes the interesting part (that I never thought > of), > as I can "force" a constant voltage on the emitter, per Ohm's law I can > also > force a current through it. So if e.g. I force 3.3V on the base, I will > have > 2.7V (3.3V - 0.6V drop) on the emitter, now if I place a 1kohm resistor > between the emitter and ground, the current through the resistor will be = a > constant 2.7V/1k =3D 2.7mA > That's how and why the constant current sink works. > > Thanks again, your suggestion was enlightning beyond its practical value. > > With kind regards, > Mario > > > > >Wouter > > > >-- > >http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > >View/change your membership options at > >http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 __________________________________________ David C Brown 43 Bings Road Whaley Bridge High Peak Phone: 01663 733236 Derbyshire eMail: dcb.home@gmail.com SK23 7ND web: www.bings-knowle.co.uk/dcb --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .