Parallax Forums
  HomeLog InRegisterCommunity CalendarSearch the ForumHelp
   
Parallax Forums > Public Forums > Stamps In Class > Source or Sink current  Forum Quick Jump
 
New Topic Post Reply Printable Version
[ << Previous Thread | Next Thread >> ] | Show Newest Post First ]

Vincenzo1309
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 75
 
   Posted 6/5/2009 8:37 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Dear all, I am currently working on a project. I am connecting a transistor BD679 to a I/O pin of Basic Stamp 2. This NPN transistor is used to drive a solenoid actuator. I know that the source/sink current of BS2 = 20/25mA

But I am confused, so actually how much max. current actually flow out of the pin? is it 20 or 25mA?
Do I use source or sink current?
Kindly advise

Thanks and Regards,
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13558
 
   Posted 6/5/2009 9:18 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
The Microchip PIC that Parallax uses for the BS2 can source 20mA or sink 25mA from any single I/O pin. There's also a limit of 50mA for each group of 8 I/O pins and a total current limit of 150mA for the entire chip. You should always leave some safety margin, so plan on 10mA to 15mA for the base current of your transistor. Since it's an NPN transistor, the BS2 will be sourcing current for the base (from +5V). Sinking current refers to 0V.
Back to Top
 

Vincenzo1309
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 75
 
   Posted 6/5/2009 9:34 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
So, it means that in my case, I should be concerned about SOURCE current. Since 20mA will flow out of the pin, therefore I need to limit this 20mA to the range (10-15mA).
I can use a resistor to do that.
But how do I calculate the value of the resistor?

Kindly advise..

Thanks and Regards,
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13558
 
   Posted 6/6/2009 3:58 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Ohm's Law: Voltage = Current x Resistance

A Stamp I/O pin provides roughly 5V when HIGH (actually about 4.7V, but this depends somewhat on the current drain). A transistor's base-emitter junction requires roughly 0.6V, that's 4.7V - 0.6V = 4.1V left for the resistor to drop. Pick 15mA for the current, so you have: 4.1V = 15mA x Resistance or R = 4.1V / 0.015A = 273 Ohms. The closest standard value is 270 Ohms.
Back to Top
 

eod_punk
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Jan 2009
Total Posts : 27
 
   Posted 6/6/2009 6:30 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
You are a great source of knowledge Mike, and you break it down so easily for everyone. Maybe Parallax should put you on the payroll!


There is no problem that can't be solved with a suitable amount of explosives!

EOD Memorial

Back to Top
 

Vincenzo1309
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 75
 
   Posted 6/6/2009 6:34 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Dear Mike,

Will it be logically wrong if I did it this way, my supply voltage for the actuator is 9V, measured resistance of the actuator is 8 Ohms.
Direct Current Gain of BD679 = 750 (from datasheet)

Rb = (IC supply voltage * Direct Current Gain) / (5 * load current)

load current = 9V / 8 Ohms = 1.125A

Rb = (5V * 750) / ( 5 * 1.125) = 667 Ohms, in this case, I use the 1K resistor. It works though.

So am I right for the above calculations? Can it be done this way?

Kindly advise.

Thanks and Regards.
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13558
 
   Posted 6/6/2009 3:52 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
I'm not sure where you got the 5 in the denominator. I get:

Minimum base current = 1.125A / 750 = 1.5 mA.

The gain of the transistor may be lower than 750. You would use the minimum hFE (DC gain) from the datasheet. I would probably just use 10mA. This would guarantee that the transistor is saturated (fully conducting) and the extra few milliAmps won't normally make a difference. If you were using several I/O pins at the same time and the total BS2 I/O pin current was an issue, I might decrease this to 2-3mA. In your case, I'd still use something like 470 Ohms which would give a base current of around 8mA.
Back to Top
 

Vincenzo1309
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 75
 
   Posted 6/6/2009 7:24 PM (GMT -8)    Quote This PostAlert An Admin About This Post.
Hi Mike, I got the formula from this website, http://www.kpsec.freeuk.com/trancirc.htm#darlington

So in my case, if I use the 1K resistor, my base current is only 4.1A / 1000 ohms = 1.4 mA
therefore when this 1.4mA is amplified, the resulting Ic is enough to drive the actuator.
Ic = Current Gain * Ib
= 750 * 0.0014
= 1.05A

So do you think my method might be wrong, even though it works?
Back to Top
 

Mike Green
Registered Member



Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Oct 2004
Total Posts : 13558
 
   Posted 6/7/2009 7:09 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
The 1.4mA base current is just enough when amplified to provide current to the actuator. There's no room for error. If the gain of the transistor is too low or if the actuator current is a little bit higher as will happen with temperature changes, it won't work as well. In addition, the transistor is not saturated, so there's more power dissipated in the switching transistor itself.

For power switching, you really want to drive the transistor into saturation to minimize the collector to emitter resistance and the power dissipation of the transistor.

By the way, don't forget the protective diode across the actuator coil!
Back to Top
 

Vincenzo1309
Registered Member

Email Address Not AvailablePersonal Homepage Not AvailablePrivate Messaging Not AvailableAIM Not AvailableICQ Not AvailableY! Not AvailableMSN Not Available
Date Joined Dec 2008
Total Posts : 75
 
   Posted 6/8/2009 5:59 AM (GMT -8)    Quote This PostAlert An Admin About This Post.
Hi Mike,

Thanks alot! Sure remember about the diode!
Back to Top
 
[ << Previous Thread | Next Thread >> ]
New Topic Post Reply Printable Version
 
Forum Information
Currently it is Saturday, November 21, 2009 11:30 AM (GMT -8)
There are a total of 393,855 posts in 55,536 threads.
In the last 3 days there were 84 new threads and 706 reply posts. View Active Threads
Who's Online
This forum has 17692 registered members. Please welcome our newest member, old guy.
66 Guest(s), 13 Registered Member(s) are currently online.  Details
heater, Siri, Kenny Gardner, keith_kw, Jay Kickliter, mctrivia, Alsowolfman, Shawn Lowe, dMajo, Harprit, Beau Schwabe (Parallax), Leon, MicroDirk