Shop OBEX P1 Docs P2 Docs Learn Events
3.3 volts to 5 volts (and beyond) — Parallax Forums

3.3 volts to 5 volts (and beyond)

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2010-08-21 07:01 in Propeller 1
Hi,
I have been digging and digging for a good simple way to drive an IRF540 Mosfet from the Propeller (at 12 volts). After bouncing around on the internet and digging through 'The Art of Electronics', I found a few good ways. But one seems extremely attractive.

Has anyone used a 7406 with a pullup resistor? If one wants +5, the pullup is attached to that. If one wants to drive the IRF540, it seems that a pullup to +12 volts is okay as well (the little chip is rated to that up to +18 volts on the open collector).

On the input side, it seem to look at +2 volts as the threshold between high and low logic states. So unlike some other logic families (like the 74HCxx), there is no crowding around the 3.3 volts to signify high.

Of course there is one draw back. It is powered by +5 volts - not +3.3. But all my Prop boards have that.

I have been looking at other choices (such at 2N7000, 2n3904, and 4011 NAND gates), but this really seems quite direct. I suppose the pullup value might require some thought, but I am guessing that 4.7K would likely do fine.

Comments

  • AleAle Posts: 2,363
    edited 2010-08-19 09:14
    Did you think about a pulse transformer ?... galvanic isolation may be attractive for power apps.

    The "off" condition for the mosfet should be considered, or you may destroy the device during testing. (no drive on the 06 and the mosfet is always on).

    When some MOSFETs blow they short the gate to either drain or source... then you get 12 volts on the gate circuit... bad :(
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-08-20 03:21
    Ah yes, there are some concerns with having the pullup resistor in place.
    I guess that one might leave the +12 volt supply on while shutting down the Propeller and the logic chip.

    I was thinking of having an 'active pullup' by inserting a 2n7000 that would only enable the pullup if and when the +5 is on.

    There are other solutions. The simplest is to use a transistor to drive the IRF540, but that creates an inversion in logic (low is on and high is off). So it seems that having another inversion would bring everything back to a safe off condition when the Propeller is independently off.

    Here is what appears to be a very complete solution. The schematic came from an Explorer Project (Boy Scouts) for an ROV called 'The Black Perl'.

    I am not clear on what a 'pulse transformer' might be. Primarily I was pondering a minimal component solution. I'll try to read up on that as well.
    800 x 488 - 33K
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-08-20 08:52
    Is this what you are looking for?
    With 2 resistors and 2 transistors you can source up to 20V (limited by MOSFET Vgs limit) and any practical ampage. It has correct logic (high is sourcing, low is off). I have used it to 20+KHz (R72 will need to be reduced to do this).

    attachment.php?attachmentid=72626&stc=1&d=1282319775
    544 x 227 - 19K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-08-20 10:09
    Sorry, but I can't quite understand how a motor fits into the 'in' and the 'out' labels (I am used to more usual Vdd and Vss or V+ and V-). And I am not quite sure if I am looking at P-Mos or N-Mos as the diode has a funny squiggle to it as well that I associate with a Zener (which usually is backwards to a normal diode in circuits).

    Nonetheless, it looks like your are talking P-Mos (and that isn't a Zener, you a different graphic style) and I happen to have N-Mos.

    If the P-Mos will remain off when the logic is not powered, it certainly is better.

    The 7406 may not be ideal for a motor applications, but for driving +5 logic via +5 pullup, it still seems a very simple solution.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-08-20 10:46
    It is a P-channel MOSFET. There actually isn't a zener diode, it is there to represent a product of the MOSFET process (the p-n junction inside the MOSFET). If the source voltage gets too far above the drain power flows somewhat freely. Here is the datasheet of the MOSFET I use: http://www.irf.com/product-info/datasheets/data/irf7404pbf.pdf notice a similar symbol at the top of the document.

    This is an excerpt from a schematic I use, and I use this as a simple power switch, so the labels are some what proprietary. IN is voltage from a power supply (Vdd) and out is where the motor goes (between Out and GND). GND is the ground or Vss. 1/0 is controller input.

    Reducing the resistance on R72 reduces the time it takes the MOSFET to switch off. A fast recovery diode would also be suggested between Out and your motor to prevent backfeeding.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-08-20 10:55
    Thanks for the prompt reply. I'll consider the advantages of the alternative of P-Mos. Right now I only have a few power N-Mos and I am not doing surface mount.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-08-20 11:01
    You can use an N-mos (and it is even simpler wiring). Put the source to ground and drain to Vss of the motor. Run Vdd directly to the motor. Run the gate to an IO pin. As long as the Vgs threshold is low enough to work with the microcontroller you will control the motor just fine. No need to mess with the higher voltage mess.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-20 15:45
    Considered adapting the Philips-recommended (I2C) 3V-to-5V interface into a 3V-to-12V interface? There's no inverting, HI on one side yields HI on the other.
    357 x 235 - 10K
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-08-20 16:34
    Clever. It doesn't really need 3V on the gate does it? 3.3V or whatever the Propeller is running at is good enough, right? But it may be unnecessary
    It really depends on the power MOSFET that is being used and the power requirements of the motor, Loopy, can you let us know.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-20 17:01
    Yes, 3V, 3.3V, it's all the same.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-08-21 04:15
    Thanks, PJ. These days, the Parallax Forums are better than Google for this kind of topic.

    As usual, I get caught up in 'more is better' syndrome. I began to think I needed to provide 10v or more to the Vgs.

    The N-Mosfets I have are IRF540. They are supposed to do quite nicely with 4v to the gate, they don't really need 10v or 12v, but they just cannot use 3.3 volts.

    At 4Vgs, the Ron is rated .044 ohms. So I am considering it best to just drive the gate at 5 volts.

    And the amps rating is far beyond anything I suspect I will every require (17 or so amps). I did see one posting that 4.5 amps is a realistic use level -- they relatively cool

    As I don't have a stepper with that high an amperage rating, I am building for future by providing head room.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-21 05:33
    Then you could use 5V, if that's available, less is more.
    I decided a while ago that I would restrict my suggestions to the situations that members present: If a guy's on about 3V and 12V, then I won't introduce 5V.

    Head-room, more is better, blah, blah, blah. Tomorrow has worries all its own. There's no panacea; no one-size-fits-all, 0-100A, rock-solid "solution." Are you going to fish or cut bait?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-08-21 07:01
    Yeah, it certainly is difficult to discuss technical info over the internet. Either my memory is wrong or I get the math wrong. (It couldn't be age, could it?) It seems I have to read all the PDFs multiple times before I can get things right.
    .
    Now - regarding the IRF540 - I see that the 0.044 ohm resistance of Rds-ON is at a gate voltage of 10 volts (not 4.0 volts).

    And while the minimum gate is 4.0 volts, all the data curves go down to only 4.5 volts for gate.

    So maybe I'll simple provide a jumper for both a regulated +5 and an unregulated +12. But I am elated to get it down to one 2n7000 driving the IRF540.

    Now I can get into the software - a combined PWM and Stepper cog intended for smooth variable speed.
Sign In or Register to comment.