P-channel MOSFET Power Switch

This is a simulation showing that a p-channel power MOSFET should work fine as a battery cutoff / switch for the bike taillight (clicky for many more dots):

P-MOSFET power switch
P-MOSFET power switch

The general idea is to have a pushbutton or vibration sensor turn on the power, whereupon the Arduino wakes up and activates an output pin that holds the power on. When it’s time to shut down, the Arduino turns that output pin off, the power goes away, and everybody’s happy.

The MOSFET must be not only p-channel, but also have a logic-level gate, which is a rare and precious combination among cheap surplus MOSFETs. I’m hoping those FDS6675 MOSFETs work better than their package looks.

The capacitor and resistor over on the right simulate a reasonable load.

The voltage-controlled switch in the middle represents the vibration sensor, which is either shorted or open as determined by the voltage source at the bottom. There doesn’t seem to be any other Spice-ish way to do that.

The Arduino output, simulated by another voltage source drives the NPN transistor, which isolates the output pin from the 7.4 V (up to maybe 8.5 V when fully charged) Li-ion battery. It also isolates it from the switch, which would otherwise yank the output pin to ground if you pushed the button when the power was already on.

You’d want a few more pullup and pulldown resistors to ensure things stay where they’re put while the lights are out. I’d want to measure an actual vibration sensor; it may require a pulse stretcher to ensure the Arduino has enough time to wake up and smell the electrons.

The overall concept seems workable.

9 thoughts on “P-channel MOSFET Power Switch

    1. Not quite enough voltage for a two-cell battery, but Sparkfun makes great stuff.

      Digikey has FDS4465 p-MOSFETs at a little over a buck a pop in onesies. I should get a few the next time I send in an order…

  1. I think the microcontroller would also need to be able sense the vibration input so it has some idea of when the demand is gone and it is OK to shut down.

  2. I’m probably showing my lack of knowledge about analog circuits, but…
    Couldn’t you do away with a lot of that by putting the AVR into a deep-sleep mode (~7µa) that is woken up by the pushbutton or vibration sensor? I *think* it can detect a rising edge on an interrupt pin in that sleep mode, but I’d have to look at the datasheet again to be sure. Granted, it would probably draw more power this way than with the way you’ve outlined, but at 7µa, I would think the smaller and simpler circuit would more than make up for it.

    (Shameless plug: I did some investigation of battery life for a small device using an ATtiny85 in deep sleep, but woken every 8 seconds by a watchdog timer, not a pin interrupt. http://www.surprisingedge.com/112/)

    1. putting the AVR into a deep-sleep mode

      That would work, but remember this is on a bog-standard Arduino Pro Mini board. The on-board regulator powers all the other gimcrackery that’ll go in the taillight, so putting the microcontroller to sleep won’t shut off the rest of the circuit.

      I did some doodling on that a few days ago, but I don’t trust any of the power measurements.

      I’ll be mildly surprised if the overall leakage current for the whole lashup comes in under 7 µa…

      1. I remember doing similar work with a PIC a while back. It was clocked at 32kHz and spent most of its time in sleep mode. The PIC drew a few µA, but unfortunately, the voltage regulator powering it drew two orders of magnitude more.

Comments are closed.