Solved: Using transistor as switch for a line with increasing variable voltage

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I am using a BC557 as a switch to turn on a variable voltage line.I connected the base via a resistor a pin on arduino.I am toggling the pin high and low to turn off or turn on the transistor respectively.Problem is the emitter is connected to a line from a buck boost Vout which outputs voltage gradually from 0 to a max of 4.7V. Now even if the transistor switch is off the Load LED connected to the transistor lights up some times. I am unable to understand why.I am reading the voltage to reach 4.7V and then I turn the transistor ON but even before the Logic PIN is set LOW (to turn on the PNP) the LED lights up. I want to turn the VOUT ON only if the voltage builds up in the capacitor and reaches 4.7v but that is not happening, the voltage does not build up because the load is connected (even though the load is switched off with the PNP). Is it because the VOUT line from the buck boost is not a solid HIGH the transistor is misbehaving? Please let me know what to do here..

Last Edited: Thu. Feb 8, 2018 - 01:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The transistor is probably not 100% off & small current leakage could light the led.  The arduino might only put out 3.3v (???), not enough to turn off the transistor.  You could add an open collector npn (its emitter to gnd) to  drive the base of the pnp & the arduino drive the npn 

 

How much current do you hope to switch?   Use a p-channel mosfet instead, this will generally have much lower voltage drop going to your load. 

 

 

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

schematic?   Pictures are worth a 1k words!

 

JIm

 

Mission: Improving the readiness of hams world wide : flinthillsradioinc.com

Interests: Ham Radio, Solar power, futures & currency trading - whats yours?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree, need a schematic.

 

As mentioned above, you might need a transistor to interface between the micro and the high side PFet.

 

The schematic below shows one way to do this.

Everything inside the dotted line box is one chip, a dual N and P Fet in one package, in this case the:  DMC2038LVT.

 

JC

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

The transistor is probably not 100% off & small current leakage could light the led.  The arduino might only put out 3.3v (???), not enough to turn off the transistor.  You could add an open collector npn (its emitter to gnd) to  drive the base of the pnp & the arduino drive the npn 

 

How much current do you hope to switch?   Use a p-channel mosfet instead, this will generally have much lower voltage drop going to your load. 

 

 

 

I hope to switch anywhere between 10ma to 110ma. I am using an Arduino Leonardo which off a USB port. I will measure the voltage of the PIN HIGH on the arduino. But when I put the Load as an LED it was working better but still the switching issue was there that even when it was not intended to be ON it was getting ON. I am using a BC557 as the PNP. If this does not work I will put a BC547 between the arduino and the PNP as you suggested.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk #3 asked for a schematic.

These are wonderfull things.

From your description it is for example not clear if the Vcc of your uC is also connected to the output of your SMPS & emitter of your transistor.

What is the value of your resistor?

 

If you've never drawn a schematic on a pc before, then try KiCad. It's Open Source and FREE (as in Freedom).

A photograph of something drawn on a dead tree carcass will also do.

 

The chip from DocJC #4 is a "high side load switch"

https://duckduckgo.com/html?q=%22high+side+load+switch%22

These are cool components. A lot of them (especially the higher powered one's) have built in protection ( Over voltage, over current, over temperature).

 

One of the  reasons for wanting to do something like this is  some battery powered circuit & wanting to extend battery life.

Transistors are not the best for this, because they require a base current to work, which is a loss of valuable electrons leaking away.

 

Edit: Sometimes I forget that MOSfets are also transistors...

Wayne Holder has also been experimenting (and documented) High side switches. He used the TPS27081ADDCR:

https://sites.google.com/site/wayneholder/pushbutton-power-on-off-for-arduino

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

Last Edited: Wed. Feb 7, 2018 - 05:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Transistors are not the best for this, because they require a base current to work, which is a loss of valuable electrons leaking away.

Well, to be fair, transistors are exactly what is inside the high side driver.   Drivers may optimize internally to use the largest practical resistor values, or charge pump capacitors, to minimize waste.   BJT vs mosfet...the mosfet generally wins since its gate draws almost zero current when not switching.

 

Go with DOCJC's proposal...a great one.

When in the dark remember-the future looks brighter than ever.

Last Edited: Wed. Feb 7, 2018 - 04:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using NPN solved the problem but as people said I will use a MOSFET in the future...