Shop OBEX P1 Docs P2 Docs Learn Events
Mosfet Trouble — Parallax Forums

Mosfet Trouble

crgwbrcrgwbr Posts: 614
edited 2006-08-15 18:36 in Robotics
Hey,
I have been trying to use a mosfet (IFRZ44N) as an on/off switch for a motor, but as soon as I compleate the circuit and turn on the BOE, the motor turns on and won't turn off untill I disconect the power.· It's like the gate doesn't do anything.· Please Help!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
«1

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-07-10 15:23
    Try a 4K7 - 10K resistor from Gate to Ground.· Also, place a 2K2 between the STAMP Pin and the Gate.
  • crgwbrcrgwbr Posts: 614
    edited 2006-07-10 15:31
    When I do that, the motor runs slow when it should be off, and fast when it should be on.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-07-10 15:42
    What if you disconnect the STAMP completely?

    You've had exactly this problem before, I remember.· [noparse]/noparse] [color=red]Post Edit addition[/color] -- [url=http://forums.parallax.com/showthread.php?p=590196]http://forums.parallax.com/showthread.php?p=590196[/url][color=white]·[/color

    With a 10K from Gate to Ground, alternately apply +5V to the Gate through a 2K2 (no STAMP) and then Ground the Gate through the 2K2.· What then are the results?

    The diode across the D-S of your FET is backward in your drawing (anode should be at Ground -- it should be "backward biased", not forward-biased.)

    Post Edit -- see DWG atttached.

    2nd Post Edit -- I've verified circuit how_to.jpg, using an IRF620; on/off totally good (as I knew it would be.)· You can go full-tilt without the 2K2, but I dunno if I'm really into that (it's a judgement call, IMHO.)· But, the 10K, definitely --·or the Gate will stay charged (there's a capacitive element involved) keeping the FET "on".

    Post Edited (PJ Allen) : 7/10/2006 4:44:52 PM GMT
    625 x 382 - 14K
    625 x 458 - 17K
  • crgwbrcrgwbr Posts: 614
    edited 2006-07-10 15:47
    I reversed the diode and removed the stamp. Same result, slow and fast instead of on and off.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • bennettdanbennettdan Posts: 614
    edited 2006-07-10 18:41
    DO you have the motor connected to the middle pin on the mosfet and the ground of the battery on the right pin looking at the writing on the mosfet and the left pin hooked to the Basic Stamp?



    Post Edited (bennettdan) : 7/10/2006 6:53:23 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-10 18:49
    Dan -

    My bet is on an IRFZ44N. The original was just a bit dyslexic, as I've done many times before :-)

    FWIW, that datasheet is attached.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • bennettdanbennettdan Posts: 614
    edited 2006-07-10 18:54
    I found it bruce and updated my post..

    I usually dont use a 2k2 resistor from the stamp I usually use a 220 ohm but I put a 2k2 in my breadboard and it works fine for me with a IRF510.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-10 19:18
    Dan -

    I'm a software guy, and NOT an analog guy by any means, so please forgive my query. Isn't the relationship between the source/drain (I forget which) and the gate important, if this isn't a logic level MOSFET? I didn't get the impression that it was a logic level MOSFET.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • crgwbrcrgwbr Posts: 614
    edited 2006-07-10 19:18
    Bruce Bates said...
    Dan -

    My bet is on an IRFZ44N. The original was just a bit dyslexic, as I've done many times before :-)

    You were right, the source and drain are flipped from what the data sheet says.· That's wierd, but I got it working now.· Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-07-10 19:26
    With a HEXFET, D & S are important, because of that internal diode, for one thing.

    A small-signal FET, like an MPF-102, is different -- you can swap D & S.
  • bennettdanbennettdan Posts: 614
    edited 2006-07-10 19:29
    crgwbr,
    The hexfet you have has an internal diode plus you need the external one.
  • crgwbrcrgwbr Posts: 614
    edited 2006-07-31 13:42
    If it has an internal diode, why do I need a exturnal one?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • Tech HelperTech Helper Posts: 3
    edited 2006-08-05 00:27
    Before·this goes any farther, I just want to say a couple of things.· First of all, a MOSFET is not the best choice of a transistor for this situation.· MOSFETs are designed to be EXTREMELY sensitive, and work in a different way than a bipolar transistor.· Also, you have a motor connected on the same circuit as a MOSFET; you might want to put a capacitor accross the motor's leads.

    Anyways, I think you should swich to a standard NPN transistor (see attached pic).· Any one should work.· When you use a MOSFET, you just need to remember that they are EXTREMELY sensitive and will respond to the slightest change in voltage.· Only JFETS·can be·more sensitive.

    Also, what are you trying to run using this circuit?· Why are you using a transistor in the first place?· You don't really need one; unless you connect the drain (MOSFET) or collector (NPN) to Vin, you won't get much more power, if any.· Also, you have to remember that you are using a motor, not a servo; servos can be very precise, but motors are generally either going or they aren't.

    So basically, I think your just working with the wrong parts for this circuit.· You're working with precision parts when you should be working with standard parts.

    P.S. Excuse the bad attachment; lol


    Post Edited By Moderator (Chris Savage (Parallax)) : 8/5/2006 1:49:30 AM GMT
    1000 x 1000 - 29K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-08-05 16:25
    · Tech Helper, that·circuit (emitter-follower / common collector), connected to a STAMP output would only be suitable for a 5V relay, possibly, because the voltage at the emitter (a.k.a. the output) will be = VB - VBE;best case 5V - 0.7V = 4.3V and that's marginal.

    · The best solution is to connect the relay in a common emitter circuit, if it's a 5V coil/relay,·between +5V and the collector with the emitter at ground (assuming NPN.)· And this is·only cool with the BoE whose LM2940 has current aplenty, if not infinite, to spare.· The HomeWork Board and its LM293 (approx 100mA) doesn't have the current to spare from its VDD for running relays and motors.

    · What's more, with the common emitter, you can use any coil provided your V+ is = to the relay's coil.· It's the most efficient, too

    · But, as you'll see around here, people·too often·have it wrong, knowing nothing, wanting to do·thus & sundry·and·see the answer as little more than to just cram some wires in a breadboard and not to learn right things,·because "working" (ha-ha)·is in the eye of the beholder:

    Post Edit --
    e.g.
    (This thread)
    http://forums.parallax.com/showthread.php?p=598355
    http://forums.parallax.com/showthread.php?p=599176
    http://forums.parallax.com/showthread.php?p=590196

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When you get 1st Place in the "Darwin Awards", you're a Winner & a Loser.

    Post Edited (PJ Allen) : 8/5/2006 4:34:26 PM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2006-08-05 19:25
    Tech Helper, first of all, a mosfet IS the right choice for this· circuit.· That is because this circuit was simply to test the mosfet and make sure it worked, before I installed it permenently in an H-bridge, desinged to run a large motor.· Next, I am using a transitor because, a motor will not run of of the avalible 20 mA from a stamp pin, and a relay is to slow to do PWM.··Third, you really need to work on your drawing.· So finnally, before you insult somones electronic desing skills, get the facts FIRST.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-07 03:05
    Tech Helper said...(trimmed)

    Before·this goes any farther, I just want to say a couple of things.· First of all, a MOSFET is not the best choice of a transistor for this situation.· MOSFETs are designed to be EXTREMELY sensitive, and work in a different way than a bipolar transistor.· Also, you have a motor connected on the same circuit as a MOSFET; you might want to put a capacitor accross the motor's leads.

    Anyways, I think you should swich to a standard NPN transistor (see attached pic).· Any one should work.· When you use a MOSFET, you just need to remember that they are EXTREMELY sensitive and will respond to the slightest change in voltage.· Only JFETS·can be·more sensitive.

    Tech Helper,

    ·· I must respectfully disagree with you on MOSFETs in this use.· If connected properly they are completely suitable for this task, and in fact are commonly used in H-Bridges.· The fact that they don't consume current to drive them makes them even more appropriate for logic signal control, whereas transistors usually require a Darlington pair.·

    ·· In fact, your transistor circuit has a few flaws, some of which have been pointed out, but on top of that you have no resistor shown on the base of your transistor, which would likely damage the I/O pin connected to it.· I would recommend a little more research on transistors and MOSFETs.· Beau Schwabe has posted to this forum several times, a nice tutorial.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • studysessionstudysession Posts: 66
    edited 2006-08-13 03:26
    Have a question about this picture. Please forgive me if this is to simple but I am trying to learn how to read and understand everything here....

    Right Way - Picture posted by - PJ Allen
    http://forums.parallax.com/forums/attach.aspx?a=8297

    Hope it is ok that I ask a couple of questions about these -
    What is the G, S & D

    And it looks like the middle one is connected to the bottom one on the drawing. I assume they go to ground, the both of them? So if I understand it right, this is what you have:

    Some kind of voltage regulator and the middle and bottom pin in the drawing both go to ground. And the bottom also goes to pin1 on the BOE. Then a diode of some kind connects from the same ground to the negative terminal on the motor. And the positive terminal of the motor goes direct o power supply? And the ground is the VSS on the BOE?

    I am learning and trying to understand this thread with all the drawings. Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-08-13 04:10
    G stands for gate, S for source, and D for drain. The diode is often part of the FET, but some devices don't have a built-in diode so you add one. The "middle" thing is the device substrate and this is internally connected to the drain. There are some special purpose FETs where the substrate comes out to a separate pin, but you won't run across one. The ground is Vss on the BOE. There's no voltage regulator on the picture. One terminal of the motor is connected to +5V and that is supplied by the BOE regulator, but the motor could be connected to another power supply. If you're running the BOE off a 6V battery pack or "wall-wart", you could run the motor directly off that (assuming it's made for 6V power). The connection from the gate is to P1 of the Stamp. Please note that the gate, source, and drain are different pins on the FET. Look carefully at the drawing. The drain and source are usually strips of conducting material on/in the surface of the FET silicon. These are covered with an insulator (silicon dioxide) and the insulator has a strip of gold or aluminum (usually) applied on top. This is the gate. The diagram is supposed to suggest the physical layout. The substrate connection looks a little like a diode because the FET is constructed within a diode-like structure at the surface of the FET's silicon.

    Post Edited (Mike Green) : 8/13/2006 4:18:32 AM GMT
  • studysessionstudysession Posts: 66
    edited 2006-08-13 04:28
    I appreciate the explaination -

    Couple of more questions -
    One is -- how do I know if mine would or would not have a diode already part of it?
    Two is -- I hooked up the circuit like your picture shows. Used it to power a LED and works fine. But when I tried it with the little 3-5v motor from radio shack and it did not work. So not sure if I did something right or wrong.

    "Not plugged in using BOE. Just a breadboard and direct 2 AA power for the LED and then a 9v for the 3v motor"
    I am not using same chip. Still 3-prong like your drawing. but it is a 7805 5DC voltage regulator. Saw in some google searches people were using this chip for their h-bridge and they had it at radio shack so got it for now.

    Thanks
  • studysessionstudysession Posts: 66
    edited 2006-08-13 04:31
    GOT IT TO WORK!@!@

    HAPPY ME!@!@

    Now try with the BOE.

    problem - one of my books said have a resistor between the input pin and what ever was plugged there. Took it out and it works fine.
  • studysessionstudysession Posts: 66
    edited 2006-08-13 04:37
    Sorry for all the questions -

    I assume the positive is the VDD?

    Thanks -
  • studysessionstudysession Posts: 66
    edited 2006-08-13 05:37
    I am not sure if I did it right or not. This is what I did with my LED connection -
    I put the positive on the VDD to see what happen and made sure the other was on VSS and the LED lit up. Then put the positive on pin0 and sent the following from the PBASIC

    DO
    DEBUG "on", CR, CR
    HIGH 0
    PAUSE 2000
    DEBUG "off", CR, CR
    LOW 0
    LOOP

    LED came on and then off. Now tried same with the motor in the circuit instead of LED and nothing happened. Put LED back in and it worked.

    I am thinking maybe I hooked it up wrong, but if LED work then would think it is correct. Maybe not enough power for the motor when coming off the BOE? Can I have seperate power supply for the motor?
  • studysessionstudysession Posts: 66
    edited 2006-08-13 14:51
    I did not think this would be so hard. Loked at some things around the net and trying different things. I can power an LED and control it with the BOE but not the motor. Not sure why. This time this is what I plugged in and where:

    input pin to p0
    ground pin to vss
    output pin to resister which goes to negative side of my led
    positive side of my led goes to vdd

    high 0 --- turns led off
    low 0 --- turns led on

    But that does not work with the motor.

    This is my motor:
    1.5 to 3VDC Hobby Motor
    http://www.radioshack.com/product/index.jsp?productId=2102822&cp=&origkw=3v+motor&kw=3v+motor&parentPage=search

    I want to use bigger motors. but using this to setup and learn from for now.

    Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-08-13 17:21
    Your motor may draw enough power initially from the regulated +5V supply to cause the Stamp to reset. I suggest getting a 3V battery holder (2 C cells or 2 D cells) from Radio Shack and connecting the red (+) wire to the (+) wire of the motor and the black (-) wire to Vss. Do not connect the motor to Vdd. This way, the motor is powered by the batteries and the Stamp is powered by a different supply. You particularly want to use a motor-only supply with larger motors. The newer revisions of the BOE have a switch for servos that connects them directly to the battery pack that's feeding the 5V regulator. This serves the same purpose. I wouldn't run a 3V motor from a 6V or even a 5V supply. It won't destroy the motor, but the motor will take more current, the brushes will wear out faster, and it will overheat more easily. In general, pay attention to voltage and current specifications.
  • studysessionstudysession Posts: 66
    edited 2006-08-13 17:25
    Thanks - I will try that.
  • studysessionstudysession Posts: 66
    edited 2006-08-13 17:27
    This thread is full of great info - I have learned a lot. But still a lot more to learn. Does anyone have a link that explains the same stuff and how to make it work with a 4 wire stepper motor? I want to try that after I understand the DC motors better.

    Thanks
  • studysessionstudysession Posts: 66
    edited 2006-08-13 18:38
    Sorry for all the questions - but

    When I do what Mike says about the battery to positive side of motor and negative to vss of the board. It just runs without any signal from the output of my chip. Right now testing with LED before doing motor though. If it works there should work with something else.

    Input to pin0 and from your drawing it should also be connected to vss. Tried it with and without it connected and get same results.
    Ground to vss
    Output to negative of LED

    2 AAAA Battery positive to positive of LED and negative to vss.

    LED stays on and not even connected the 9v battery to the BOE yet.

    Thanks

    EDIT: -
    I tried same thing using seperate 2 AAA battery pack as seperate power source with motor but use the 2N3904 transistor that came with the "What is a Microcontroller" kit instead of the 7805 that I was using. And it worked. I guess now I need to figure out why and figure out how to know when to use what size of transistors and when to use resistors & capacitors·for XYZ motors.

    Thanks again.....

    Post Edited (studysession) : 8/13/2006 7:07:45 PM GMT
  • SawmillerSawmiller Posts: 276
    edited 2006-08-13 19:16
    study,
    one thing i do for fun is to tear apart old printers , and other gadgets ppl have thrown away....
    if you look where a stepper motor ( for ex) was plugged into a printer motherboard and follow the traces , you will come to a chip that is probally a stepper controller..
    you can look it up using google on the web ( type in various part numbers on the chip ) and find a datasheet.. this will give you a pinout of that paticular chip. and by looking at how it was connected , you might be able to see how the expert engineers used it... then emulate it on your breadboard...

    this is also a way to get some free parts if you have more time than money. have found lots of good parts on old boards, just stay way from tv's due to the high voltages inside .
    dan
  • studysessionstudysession Posts: 66
    edited 2006-08-13 19:22
    Thanks!@ I have a HP deskjet I can tear down.

    I do have another question -
    Now that I got it working and powering my motor with the 2N3904 - How can I reverse the direction? Thanks again for everyones help/
  • SawmillerSawmiller Posts: 276
    edited 2006-08-13 19:28
    need to make a H-bridge , basicly 4 2n3904's so you can swap + and - leads on the run.. look up h-bridge on google, several leads there
    dan
Sign In or Register to comment.