Shop OBEX P1 Docs P2 Docs Learn Events
transistor to use with propeller — Parallax Forums

transistor to use with propeller

mikeamikea Posts: 283
edited 2012-08-01 07:07 in Propeller 1
Hi, can anyone recommend a transistor or mosfet that is fully turned on by the 3.3 volts of the propeller and can handle at least 12 volts? Right now all i'm doing is switching the coil of a 12 volt auto solenoid. Thanks-mike
«1

Comments

  • Mark_TMark_T Posts: 1,981
    edited 2012-07-22 03:39
    Auto solenoid doesn't tell us much - might need 50mA, might need 10A... 12V isn't going to be a limiting factor, current is more important.

    For 12V a darlington transistor is an obvious choice since the 1V drop isn't a problem (heat dissipation might be if really is 10A).

    Simple bipolar switching transistors like 2N2222 good to several hundred milliamps, superbeta devices like ZTX851 can handle several amps without needing heatsink.

    MOSFETs specified for 3V3 drive are usually surface mount in my experience. SSM3K02T is an example, 0.2ohm at 4V Vgs, 0.25ohm at 2.5V Vgs:
    http://uk.farnell.com/toshiba/ssm3k02t-te85l-f/mosfet-n-ch-2-5a-30v-sot23/dp/1714376

    Remember to use a free-wheel diode connected across the load as its inductive - this is required.


  • mikeamikea Posts: 283
    edited 2012-07-22 04:15
    looks like 85 ohms. thats 140ma at 12 volts right? Thanks Mark -mike
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-07-22 04:24
    Hi mikea;

    A very nice MOSFET is the IRF3708
    IRF3708 30V 62A 12mO Vth2.0 TO-220
    MOSFET_IRF3708_Vgs[1].gif

    Guaranteed specifications at Vgs at 2.8V of 29 mOhm.
    Here are lists of devices I've used:
    http://www.redrok.com/electron.htm#nch

    Duane J
    713 x 433 - 9K
  • mikeamikea Posts: 283
    edited 2012-07-22 04:57
    Thanks Duane , a catagorized list is a good idea. your weather tracker is cool btw.-mike
  • Mark_TMark_T Posts: 1,981
    edited 2012-07-22 05:25
    mikea wrote: »
    looks like 85 ohms. thats 140ma at 12 volts right? Thanks Mark -mike

    In that case a 2N2222 or equivalent with 220 ohm base resistor should do I think. And any small diode (even a 1N4148) will handle free-wheeling.
  • g3cwig3cwi Posts: 262
    edited 2012-07-22 05:43
    This comes up so frequently that maybe it should be a sticky - or an App Note!

    Cheers

    Richard
  • mikeamikea Posts: 283
    edited 2012-07-22 10:51
    So all of these transistors need current limiting on the base, then mosfets need the same (appropriate value) current limiting for the gate? These mcu's have resistors internal before i/o's right?These arn't enough?Thanks for the info-mike
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-07-22 12:17
    Hi mikea;

    For bipolar transistors you need "Current Limiting" resistors.

    For MOSFETs the resistor is, strictly speaking, not required.
    However, "Pin Protection" resistors are often used in case there is damage to the MOSFET's gate. Maybe 1K in value.
    Also a high value resister, 100K or so, as a pull down to guarantee the MOSFET is off when the pin is set to an input or power is shut off.

    Duane J
  • mikeamikea Posts: 283
    edited 2012-07-22 12:33
    Thanks Duane
    Ive been using 1k from gate to source while trying to make an h bridge. Still hav'nt resolved the problem yet, but the i/o is 3.3v and i don't think it turned the mosfet on/off all the way. I will switch to 100k and try the irf3708 like you recommended, but just for reference is the 1k alright and only an unecessary power drain? I appreciate the info, i would like to understand these better so i can get past the h bridge hurdle.Thanks-mike
  • jmgjmg Posts: 15,179
    edited 2012-07-22 23:11
    mikea wrote: »
    but just for reference is the 1k alright and only an unecessary power drain? I appreciate the info, i would like to understand these better so i can get past the h bridge hurdle.Thanks-mike

    A pull-down on a N MOSFET G-S is a good idea (and a pull UP, also G-S, if you ever drive a P-MOSFET), because the Prop resets Floating-pins. They do not need to be as low as 1K, as they are there to define a floating state. 33K-100K would be fine.

    If you are driving a H-bridge, how are the upper-switches handled ?
    Some of the simpler designs use a SPCO relay on the upper arms for Direction, and 2 N-FETS on the lower arms for PWM control.
  • mikeamikea Posts: 283
    edited 2012-07-23 04:02
    Thanks jmg, the upper h were p mosfets, lower ones were n. i like the spco relay idea a lot, you can still pwm the lower mosfets. I think i will try that next. Still like to figure out using 4 mosfets sometime to end the mystery and i think it would be cheaper. Thanks-mike. Also is it necessary to use pull up/down resistors on all transistors or is it just mosfets?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-07-23 05:50
    Hi mikea;

    Try this Simple MOSFET H-Bridge.
    Simple_MOSFET_H-Bridge.png


    Duane J
    387 x 602 - 11K
  • mikeamikea Posts: 283
    edited 2012-07-23 07:24
    Thanks Duane I appreciate the info. Cant wait to get that working. Also do you put resistors on transistors between base and emitter similar to the mosfet or do those not float? Thanks-mike
  • BitsBits Posts: 414
    edited 2012-07-23 07:48
    g3cwi wrote: »
    This comes up so frequently that maybe it should be a sticky - or an App Note!

    Cheers

    Richard

    Maybe an app Note to properly run and select a Fet so people learn something :)
  • Mark_TMark_T Posts: 1,981
    edited 2012-07-23 07:54
    mikea wrote: »
    Thanks Duane I appreciate the info. Cant wait to get that working. Also do you put resistors on transistors between base and emitter similar to the mosfet or do those not float? Thanks-mike

    Base is a low impedance input (100 ohms ballpark), it can't float, and secondly a bipolar transistor is current-controlled so it wouldn't matter. MOSFET gates are totally insulated (10^13 ohms is typical for small devices!), and are strictly voltage controlled.

    Having said that sometimes a base-emitter resistor is added to speed-up switching-off of a bipolar transistor, it helps to clear the stored charge in the device after it's been conducting large currents.
  • mikeamikea Posts: 283
    edited 2012-07-24 11:43
    Having trouble keeping a circuit running smoothly, it will run for a second..stop then pick up again with a little relay chatter. It works great with steady 3.3v, but does not with the code i'm using. i'm wondering if it's a too slow frequency the datasheet for 2n2222 which i'm using says min. transition freq. 250mhz, not sure what that means exactly. http://www.csus.edu/indiv/t/tatror/projects/met highway safety project 2010/npn transistor.pdf
    The prop is reading a r/c receiver and switching a 2n2222 (w/100ohm resistor at the base) to turn on a relay. there are 2 sets of these, one 2n2222 runs a relay coil of 12volt 85 ohm, the second one runs a 12volt relay coil 160ohms. Not sure how to speed the code up to test the frequency idea. The plow method runs in its own cog. I can post the rest of the code, if its needed. Any ideas would be appreciated.Thanks-mike

    pub plow 
    dira[5..7]~~
    repeat                                                                       
      if pulsewidthv>132_400 and pulsewidthv <160_000            'if stick is pushed up then turn on transistor to switch relay 1
        outa[5]~~
      
      else 
        outa[5]~
         
              
       if pulsewidthv<110_400 and pulsewidthv >83_000          'if stick is pushed up then turn on transistor to switch relay 2  
           outa[6]~~
       else     
        outa[6]~
    



















  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2012-07-24 12:04
    IRF-510 is also a good choice if your current needs are moderately high (Beyond 2N2222)
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-07-24 12:05
    Hi mikea;
    mikea wrote: »
    i'm wondering if it's a too slow frequency the datasheet for 2n2222 which i'm using says min. transition freq. 250mhz, not sure what that means exactly. http://www.csus.edu/indiv/t/tatror/projects/met%20highway%20safety%20project%202010/npn%20transistor.pdf
    I believe Transition frequency is where the gain is 1.
    The gain is higher at lower frequencies.
    The "minimum" thing is saying that the actual Ft will be most likely higher but not lower.
    The Prop can't switch a pin at this rate so don't worry about that spec.

    Duane J
  • mikeamikea Posts: 283
    edited 2012-07-24 12:50
    ok cool, thanks guys. I'm not sure what to think now, the only difference between working or not was touching the base(through 100ohm) of the 2n2222 with 3.3v which works well or letting the prop deliver it through the code, which acts either low power or not a solid enough 3.3 volts. If the "if" statement is true, which makes pin 5(or 6) high would there be any fluctuation in the pin state each cycle through the code when the "if" is tested? When run through the prop it acts like a really bad duty cycle if i'm saying that correctly, like it's not fully on all of the time and makes the relay chatter a bit and only move the plow a section at a time. -mike
  • cavelambcavelamb Posts: 720
    edited 2012-07-24 15:22
    It sounds like a noise problem feeding back to the power supply.

    Spikes from the inductive kickback of the relays?
    Do you have snubbing diodes across the relay coils?

    What filtering cap are installed?

    Would you post the actual complete schematic?

    Do you have a scope?
  • jmgjmg Posts: 15,179
    edited 2012-07-24 16:38
    mikea wrote: »
    .. deliver it through the code, which acts either low power or not a solid enough 3.3 volts. If the "if" statement is true, which makes pin 5(or 6) high would there be any fluctuation in the pin state each cycle through the code when the "if" is tested?

    You do have catch diodes on the relays ?

    In a situation like this, it pays to divide and conquer.

    Change the code to a simple Read-Pin -> Write Pin, which exercises all the hardware, and check you get reliable pin-following.
    Measure the voltage across the 2N2222 when it is on, and the prop pin, so you know what a ON measures like.
    Any deviation from those values, in more complex code, indicates problems.

    Also test without any relay loads, as arcing contact closure can have effects you do not expect.
  • mikeamikea Posts: 283
    edited 2012-07-24 17:13
    HI Jmg,cavelamb, bid on a scope today, but didn't get it. I have 48v transil unidirectional clamping diode across each relay with the band toward the +12. i tried from around 3mf cap up to around 63 thinking it might smooth out the input from the prop to the base of the transistor(there is a 100ohm resistor before the base). I put the + just before the 100 ohm and the neg side to the ground trace. Where would you locate filter caps? I will try to get a drawing here. I like the divide and conquer gonna approach it that way.Thanks for the good ideas.-mike
  • mikeamikea Posts: 283
    edited 2012-07-24 18:18
    Got it fixed! Added a 1/10 sec wait after the pin(s) get set high. Have not totally narrowed it down yet but i think the radio signal jitters outside of the parameters. let a repeat loop run the circuit up/down first which was ok then added the wait to the original code with the radio. Just for the future, where/when do you add filter caps and figure them? Thanks everybody for the help.-mike
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-07-24 18:33
    Hi mikea;

    You don't want to put big caps on the prop pins.
    PropRelayCaps.png

    You won't need the wait with this circuit.

    Duane J
    762 x 278 - 12K
  • mikeamikea Posts: 283
    edited 2012-07-24 19:00
    Thank you sir, that happens to be my next project. What happens in a circuit if a cap is oversized? -mike
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-07-24 19:09
    Basically nothing for filter caps except the bigger ones take up more room.

    Timing caps need to be the right value though.

    Duane J
  • mikeamikea Posts: 283
    edited 2012-07-24 19:13
    Ok, thanks for the help and the circuit.-mike
  • cavelambcavelamb Posts: 720
    edited 2012-07-25 14:59
    And note the schematic shows no cap on the transistor base.
    That would just slow down the base signal.
  • cavelambcavelamb Posts: 720
    edited 2012-07-26 06:25
    Another thought - how much "overhead" does the power supply provide,
    as this could easily cause the kind of problems you described.

    When the relay it turned on there is a high current flow for a millisec or so before the
    current flow through the coil stabilizes. If there is not enough excess supply (current)
    then the supply voltage will drop (same kind of time period) causing what we call
    "noise" on the supply voltage.

    It might be possible that with a small 12 volt supply, that the coil is banging the 12 volt
    source hard enough that the regulator is dropping out momentarily.
    (it's a stretch, I know, but we don't know what that 12v source is. Could be a 100 ma wall wart?)

    Anyway, this is one of the reasons for the big caps in the regulator circuit (input side)
  • mikeamikea Posts: 283
    edited 2012-07-27 06:24
    Thanks cavelamb, the power supply is one of 2 12volt batteries. the 2 are in series for 24v motors. I just attatched to the +/- of one of them for control power. they are the size battery for a rider lawn tractor. My protoboard is connected to 2 parallel 9 volt batteries, but i just got a 9v regulator and gonna put that in per Duane j diagram in this thread. The problem turned back up again. since i used 2n2222 the relays don't chatter anymore, but when raising the plow up or down it will go a ways then pause, and continue. Also i've noticed sometimes even without my input, the plow will go either direction for a fraction of a second. If i electrically skip past the r/c receiver and propeller and apply 3.3v to the base of the 2n2222 the thing runs without problem. It looks like filter caps in Duane j regulator drawing a few posts back, are there additional places in a circuit these would be helpful? -mike
Sign In or Register to comment.