From: William H. <wi...@ne...> - 2009-04-05 03:04:51
|
Hi Joey, Yes. If you use a GPIO to drive the base of a transistor, and the transistor activates the relay, that would work. You need a base resistor to limit the current base current, and a reverse-biased diode across the relay coil to absorb the inductive voltage spike that occurs when the transistor turns off (or else the transistor will be damaged when you shut off the relay). Here are some example circuits: http://letsmakerobots.com/node/4285 The third circuit shown in that webpage actually shows what I meant about using the 2N4401 to get more voltage for the MOSFET's gate. William Rizal Nor wrote: > Thanks William, > > Even half awake you can still give good advise:). > My circuits knowledge is limited so let me see if I understand you > correctly. > As I understand the GPIO can drive a source at 3ma/10ma. This is not > enough if I would like to have a transistor like 2N4401 reach full > saturation. Which mean that I won't be able to amplify the current to > drive something that requires 400mA. Am I correct. However, it should be > enough for a relay wouldn't it? > > So you are recommending that I use a mosfet with a 2N4401in > common-emitter inverted configuration so that i can achieve higher > currents...right > > On Sat, Apr 4, 2009 at 12:39 PM, William Hue <wi...@ne... > <mailto:wi...@ne...>> wrote: > > Please see clarification below. > > William Hue wrote: > > Hi Joey, please see my comment below. > > Rizal Nor wrote: > >> Hi Dave, > >> Thank you for the quick reply again. > >> > >> On Fri, Apr 3, 2009 at 11:14 PM, Dave Hylands > <dhy...@gm... <mailto:dhy...@gm...> > >> <mailto:dhy...@gm... <mailto:dhy...@gm...>>> wrote: > >> > >> Hi Joey, > >> > >> > I know i need a mosfet circuit to drive the relay. But > what I'm > >> not sure > >> > whether i need > >> > a relay in the first place. My device has a maximum load of > >> 400ma. According > >> > to tutorial sites you gave me, the ULN2803 can drive up > to 500ma. > >> > Should I still get a relay, or should i just drive it > directly > >> from the > >> > mosfet? > >> > >> It really depends on the type of thing that you're > controlling. Is it > >> inductive? or resistive? > >> > >> > >> I want to control a satellite modem and a DO sensor. > >> I'm not sure if its inductive or resistive. > >> > >> > >> > >> What voltage does your load require? Presumably your load > needs DC > >> rather than AC? > >> > >> > >> The DO sensor is using 12 volts. > >> And the satellite modem at 5 volts. > >> > >> As for now, the ULN2803 takes a while to get here. I'm going to use > >> 2N4401 that > >> i get from radioshack. It looks like this transistor can handle > up to > >> 600mA. > >> I'm going to go for the relay switch option for now, unless you > advise > >> otherwise. > >> Do you see any problems for using this transistor? > > > > To assure good saturation, you need 40 mA of base current at > Ic=400 mA. > > I doubt the Gumstix GPIO pin can supply this directly, and even if it > > could, it would not be good for it. I would use a MOSFET > instead, but > > you need to either use a logic-level MOSFET or you can use the > 2N4401 as > > an emitter-follower to provide approx. 12 V at the gate of the > MOSFET. > > Sorry, I am still sleepy this morning. Emitter-follower > configuration would only provide GPIO voltage minus VBE. To provide > more voltage at the gate of the MOSFET, the 2N4401 must be in > common-emitter inverting configuration. Sorry about that. > > > > >> > >> > >> > >> -- > >> Dave Hylands > >> Shuswap, BC, Canada > >> http://www.DaveHylands.com/ > >> > >> > >> > ------------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> gumstix-users mailing list > >> gum...@li... > <mailto:gum...@li...> > >> <mailto:gum...@li... > <mailto:gum...@li...>> > >> https://lists.sourceforge.net/lists/listinfo/gumstix-users > >> > >> > >> > >> > >> -- > >> Joey aka. Rizal > >> Home is where people think of you... > >> > >> > >> > ------------------------------------------------------------------------ > >> > >> > ------------------------------------------------------------------------------ > >> > >> > >> > >> > ------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> gumstix-users mailing list > >> gum...@li... > <mailto:gum...@li...> > >> https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > > ------------------------------------------------------------------------------ > _______________________________________________ > gumstix-users mailing list > gum...@li... > <mailto:gum...@li...> > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > > > -- > Joey aka. Rizal > Home is where people think of you... > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users |