Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    N-Channel MOSFET works on USB power but not battery

    Scheduled Pinned Locked Moved Discussion
    6 Posts 2 Posters 185 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z Offline
      ZachH
      last edited by

      Hi everyone, I have posted previously about trying to get an ultrasonic sensor to switch off while in deep sleep mode with a LoPy4 and expansion board 3.1. I decided to try using a low side MOSFET switch, so I currently have the MOSFET connected to the ground pin of the LoPy4 with P20 used to trigger it on or off. The ultrasonic is then connected to the MOSFET and the 3.3v pin on the LoPy.

      This setup works when powered though the USB, with the sensor being switched off correctly and then powering back up when the device comes out of deepsleep. Readings appear to be correct as well so I'm fairly confident it is running properly.
      The issue shows up when I try to power the device from battery or using the VIN pin, in both cases the LoPy4 and expansionboard LEDs come on, however the sensor does not power up. I dont know too much about electronic design so I was hoping someone else would have some ideas

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @ZachH
        last edited by

        @ZachH So I understand you have an N-Channel MOSFET in the found line of the sensor. What is the part name of that MOSFET? The Gate voltages vary a lot. And what is the voltage of the battery you are using?

        Besides that I would have used a P-Channel MOSFET and switch the Vcc of the sensor.

        Z 1 Reply Last reply Reply Quote 0
        • Z Offline
          ZachH @robert-hh
          last edited by

          @robert-hh Thanks for the reply. Yes, im using an N-Channel mosfet in the groud line of the sensor. I agree that a P-Channel one might have been a better idea but I didnt have any on hand.
          https://www.freetronics.com.au/products/n-mosfet-driver-output-module#.XfbJYugzY2w
          This is the MOSFET that I'm using, and the battery is just a standard 3.7v Li-Po one.

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @ZachH
            last edited by

            @ZachH It could be that when running on battery the the GS voltage is just a little bit too low for the MOSFET to switch. What I see form the data sheets is, that the on resistance increases dramatically for Gate voltages below 4V. You do not need such an high power MOSFET. I assume that the sensor needs less than 20A. Low power MOSFETS typically have a slightly lower GS voltage. But anyhow you might better use a bipolar PNP transistor, which are current controlled and require lower voltages to switch. Like a BC327 or 2N3702 with a resistor for current limiting.

            Z 1 Reply Last reply Reply Quote 0
            • Z Offline
              ZachH @robert-hh
              last edited by

              @robert-hh Thanks for the help, that does make sense. I will see if I am able to get some other transistors so I can try those out. Its been a bit difficult to source parts where I am in Australia at the moment which is why i'm having to try out these other parts that I already had.

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @ZachH
                last edited by

                @ZachH The type of these bipolar transistor is not critical at all. Assuming that the sensor consumes less than ~200mA, almost any small signal type will fit.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom