Please help me choose a transistor

Discussion in 'The Projects Forum' started by luv2code, Jul 4, 2008.

  1. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    Here's the diagram:

    [​IMG]
    The description of my project is on this thread. The Arduino MC has an ATMega168, and the Input and Output [O] pins are +5v signals.

    I need help choosing a component for the "MOSFET" spot. I've looked on mouser and digikey; but I'm unable to find what I need. I'm just learning this stuff, so if you could find a part that will fit in that spot on either website, please link to it and tell me your search terms and why you used them (teach a man to fish).
     
  2. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,672
    899
    What you have drawn is a P-channel mosfet. The mosfet supply is 12V, but the MC is only 5V, so you will probably have problems with the gate drive.

    I suggest using a logic-level N-channel mosfet. At only 200 mA, almost any of the small ones will work. Most important, put the mosfet switch to ground, i.e., low-side, and have the camera connected to the +12V. So, you will have camera to +12V, ground on camera to drain of mosfet source on mosfet to ground. The gate may need a small resistor, say 10 ohm. John

    Edit: I have used a 2N7002 directly from a PIC MC to act as a switch with a 5V gate. You may need a resistor from gate to ground to turn the gate off. I checked Digikey, and most of the other small mosfets seem to be surface mount. Are you willing to go that route?
     
    Last edited: Jul 4, 2008
  3. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    A pnp would be easier and cheaper. Either way, you will need a level shifter.
    Below is how I would do it.
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Don't forget to total up all of your current demands to get an idea of how long your batteries are going to last.

    If you're using alkaline batteries rated at 3000mAh, and your load is just the camera (200mA @ 12v) and the boost converter is 92% efficient, then:
    RunTime = 3000mAh / 2 *.92 / 200mA
    RunTime = 6.9 hours.
    If you're trying to use rechargeable batteries, your run time will be very significantly reduced. The boost converter will pull more and more current from the batteries as their output voltage drops. The more current you draw from batteries, the less efficient they become due to heating.
     
  5. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    Yeah, that's why I want the MC to switch the camera on. If I had power to the front porch, I could leave the camera on, and the MC would just have to tell me when someone has approached.

    The way I'm doing it, the camera is only on while someone is moving on the porch. So, battery operation should be fine. Reading your post gives me the idea to put a sensor into it so that the MC can signal when the battery is low.
     
  6. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    How did you produce that diagram? is there a tool that makes them quick and easy to draw?
     
  7. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    Can I use them on a perf board?
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    If your uC has a "sleep" low-power function, I suggest you make the most of it. Have it sleep for several seconds, then wake up and take a quick "look around" - if nothing, then go back to sleep.

    You'll still need to figure out your average power consumption with the camera off. You'll also have to make sure nothing could be flapping around on the porch that would keep your uC awake, PIR on and the camera running - otherwise, your batteries will be dead in just a few hours.

    SMT's on a perf board: you can, but it's not easy nor fun.

    Ron H used LTSpice/SwitcherCad III from Linear Technology.
    You can download it for free from Linear Technology's website. Google is your friend.
     
  9. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,672
    899
    Here's what I was talking about. I don't think the 2N7002 is the best choice, but it is time for the holiday party to start. My first choice would be a true logic-level mosfet or even an BJT (2N2222) might work. R1 may not be needed for the mosfet. John
     
  10. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    Notes on the diagram:

    Q2 is PNP. R1 and R2 keep the base positive until Q1 (NPN) is saturated. While Q1 is in an off state, there is no current flowing through Q2? Keeping a positive charge on the base of Q2 prevents current from flowing from the collector to the emitter, right?

    Is R3 in place to drop the voltage from the output pin to match the saturation voltage of Q1?

    C1 and C2 are in place for filtering?

    So, while the output pin is low, there is no current flowing through the system?

    I looked at the datasheet for 2N3904, and it looks like I could use it to control the camera. Why wouldn't I connect the camera directly to the emitter on Q1?
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    2N3904's will get more than a bit toasty at that current level. They really run out of steam at around 100mA.
    2N7002's don't cut the mustard either. 2N7000's might, but it'll be running ragged.
    2N4401's would be much better than the above.
    2N2222's would work also.
     
  12. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    Your notes are basically correct. Q1 is driven with about 1mA of base current, determined by R3, when the MC input is high (assuming you are running the MC on 5V). This ensures that Q1 has adequate base current to keep it in saturation with the ~20mA of collector current, which is determined by R2. R1 ensures timely turn off of Q2 when the control input is zero volts, and could be much larger, since speed is not important.
    Coming off the emitter of Q1 will not work, even if you use a beefier transistor. This would give you an emitter follower, and your output voltage would only be about 4.2V, again assuming you are running the MC on 5V.

    EDIT: If you can switch the low side of the camera, then jpanhalt's circuit is simpler. I think 2N7000/2N7002 would give you undesirable and unnecessary voltage drop, but there are plenty of logic-level MOSFETs that would work well.
     
  13. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,672
    899
    Now that the hot dogs are finished....

    As I mentioned, the 2N7002 would not be my first choice. It was just something I had in my file. I did a quick parametric search on Digikey. There are lots of choices. One that seemed reasonable is this: http://www.fairchildsemi.com/ds/ND/NDS355N.pdf

    You would be looking for something with a Vgs (on) (not threshold) of 4.5V or so and adequate current capacity. Unfortunately, they are mostly either TO220 or surface mount, not TO92.

    John
     
  14. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    You don't need R2. R1~47 ohms.
     
  15. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,672
    899
    Agreed. John
     
  16. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    what parameters did you use on digikey? I need to learn how to look stuff up for myself.

    And I think TO220 would be fine. If the circuit is simple enough, I could forgo a board altogether and just heat shrink my connections.
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Just to give you a quick answer, he might've looked for an NPN BJT that had twice the current and around twice the voltage specifications you mentioned in the beginning. Well, that's what I would've done.

    Mouser.com has a very nice parametric search; it includes lots of devices they don't stock but you might find elsewhere.
    Fairchildsemi.com also has a nice parametric search, but limited to what they make.

    If you have a part number, Octopart.com can be helpful for locating stock and prices.

    Half the struggle is just knowing where to look stuff up.

    Heatshrink is good. However, having your stuff mounted to a board gives it a great deal of structual integrity that it won't have in free-form mode.

    Then again, you could always pot it. Build your circuit to fit inside the lid of a spray paint can. Once it's working well, put it inside a spray paint can lid, and fill it with red silicone RTV or (preferably) potting compound, and it'll have all the support and insulation it needs.

    And yes, the above technique works. I used it for potting Sparrow missile simulators I built for my squadron's F-4J Phantoms a number of years ago.
    Really.
    I even still have a couple of un-potted examples that were left over.
     
    Last edited: Jul 5, 2008
  18. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,672
    899
    Search steps:
    mosfet
    single (14,926 items)
    N-channel, N-channel+diode
    surface mount, through hole
    cut tape, tube, bulk (not too important), because later you search for in stock only
    THEN, scroll through Rds On and look for values up to 500mOhm at <=5volt -- that was the pain. As typical, hold the ctrl key to select separate lines.
    See what you get -- you may limit Vgs and Vdss according to your design. For example, in your design, you want Vdss >12V, etc.

    As for learning the Digikey search, I suggest a stepwise application of the filters. That is, highlight one, as opposed to several at the same time, then check to see its effect on the number of pages. As you get more experience, you can select several, get rid of most of the junk, then continue. In this case, I was surprised Digikey didn't have logic level as a separate filter; its print catalog does.

    As for construction, you might consider using perf board with multiple, separated pads. That gives you something to solder too and support for heat shrink. For heat shrink, I prefer the really thin stuff used typically for making battery packs, instead of the thicker stuff used in wiring. Either type will work, however. Finally, I would not pot, unless you need it. Potting makes modification harder and can seriously decrease heat transfer. Although, with a multi-amp mosfet, running only at 200 mA, I would not expect it to get very hot.

    Please let us know how your design works out.

    John
     
    Last edited: Jul 5, 2008
  19. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    I followed your instructions for the digikey search, and figured out what I was doing wrong before. Thanks for spelling things out.
     
  20. luv2code

    Thread Starter Member

    Jun 16, 2008
    24
    0
    One last question: in the original thread about the project, I mentioned that I wanted to use a darlington transistor in the MOSFET space, and someone suggested that a MOSFET would be a simpler design; but they didn't explain.

    With my new digikey search skills, I found a darlington transistor that I think would work well: MPSA62. And it's much cheaper than the MOSFETs. I picked that one because it will take logic level input and handle the camera's voltage and current with no problems. What do you guys think?
     
Loading...