Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: P Channel MOSFET switching with Teensy 3.2

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    11

    P Channel MOSFET switching with Teensy 3.2

    Hey everyone, I've been struggling through circuit design and with this forums help have been able to get almost everything in this project working... now I'm stuck on why my teensy isn't switching my P channel MOSFET on/off.

    In case it wasn't already abundantly clear, electrical components are not something I have much (if any) knowledge about, so any and all advice would be greatly appreciated.

    Here's my best attempt at a schematic;
    Click image for larger version. 

Name:	Circuit Diagram.PNG 
Views:	18 
Size:	17.7 KB 
ID:	16940
    The specific parts are;
    N MOSFET: https://cdn.sparkfun.com/datasheets/.../FQP30N06L.pdf
    P MOSFET: https://www.sparkfun.com/datasheets/...l/FQP27P06.pdf
    Transistor: http://www.mouser.com/ds/2/149/BC548-888648.pdf
    Power Booster: https://www.batterysolutions.co.za/f...pdf?cache=3417
    Battery is a 12V Lithium Battery 51.2 Watt Hrs
    Teensy 3.2

    Quick outline of the project;

    1)There's a car battery that I pull 12V from and it is primarily used to charge the second battery.
    2)That battery is hooked into the input of a DC Power Booster (charger) which has an external control cable (remote on/off).
    a) When the charger external control switch is high the charger pulls from the car battery and charges the second battery.
    3)The teensy reads the voltage on both batteries and is also sending data over CAN to a logging system.
    4)When the teensy reads that the car battery is low it switches the P channel Mosfet off with a low signal
    a)This MOSFET's drain is hooked to the External control so that when it is off the charger turns off.
    5) When the teensy reads the second battery is low it turns off all the load components by cutting ground with an N channel MOSFET
    6) When the teensy has switched both MOSFETS off it goes into a low power mode (Thank you Duff)


    step 4 is where my problem is.
    I've tried running source of the P MOSFET to both batteries. it doesn't turn on when hooked to the car battery, and doesn't turn off when hooked to the 12V battery.
    At this point I'm 99% sure I just chose the wrong MOSFET or Transistor, but don't see where my error is or how to correct it.

    Thanks in advance!

  2. #2
    Junior Member
    Join Date
    May 2019
    Posts
    11
    Okay so continuing the trend of my incredible prowess in all things electrical, I took out the 10k resistor between the Teensy and the Transistor and it seems to be working fine now. I saw plenty of schematics online where that resistor was included... am I hurting anything by pulling it out?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,169
    Quote Originally Posted by Shadrach View Post
    am I hurting anything by pulling it out?
    If "pulling it out" means replacing the 10K resistor (the one between Teensy and the BC548) with a wire, then yes. Directly driving the B-E junction of a transistor will stress the Teensy pin beyond it's maximum recommended current.

    Definitely use a resistor, 330 ohms or higher.


    As a side note, when you draw a schematic, there are 2 broad guidelines. #1, which you did pretty well, inputs on the left, outputs on the right, so control or cause-effect flows from left to right. #2, which is where your diagram is a bit confusing to people used to conventions of schematics, is to arrange things so the most positive voltages are at the top and most negative voltages are at the bottom. Normally a N-channel mosfet is drawn with the source facing down and the drain facing up. If you arrange things this way, more people will be able to quickly and easily understand your drawing.

  4. #4
    Junior Member
    Join Date
    May 2019
    Posts
    11
    Thanks Paul! I threw in a 390 ohm resistor and it's still working like a charm. I'll clean up my schematic with your advice before my presentation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •