GPS Power Management - Reset Loop

Hi guys,

I'm hoping I can ask for some advice on how to best control power to my Adafruit Ultimate GPS Breakout using an N-channel MOSFET.

In the past, I've used the FQP30N06L N-channel logic-level MOSFET to turn power to the GPS on and off. This has been when I had the MOSFET's drain pin connected directly to my 4.2-5V battery. However, as I'm now looking to power my circuit from a 7.4-11.1V battery, I'd like to power the GPS directly from the 3V pin of my Adafruit Pro Trinket 3V. The Ultimate GPS notes that it has a minimum operating voltage of 3.0 V and a current draw of ~25 mA and the Pro Trinket's regulator can output a maximum of 150 mA. When I connect the GPS directly to the Trinket's 3V/GND pins it works fine. However, when I add the MOSFET and connect the circuit as shown below, my Pro Trinket enters a reboot loop as soon as the MOSFET is enabled. I have on hand two different N-channel MOSFETS: the FQP30N06L and the TN0702. I've observed the issue with both.

From researching this issue, it appears that the reset loop problem may be due to the voltage drop experienced by the Pro Trinket when the MOSFET is enabled and power is supplied to the Ultimate GPS. It sounds like the voltage drop may be triggering the ATmega328's brown-out detection and reseting the microcontroller.

When I replace the Adafruit Pro Trinket 3V with a SparkFun Pro Mini 3.3V this problem goes away. Could this perhaps be explained by the differences between the Pro Trinket's MIC5225 and the Pro Mini's MIC5205 regulator? It looks like the Trinket's 5225 has on average about twice the dropout voltage than that of the Pro Mini's 5205, though I'm unsure if this would be the cause of the problem.

Given that I'd like to continue using the Pro Trinket, I'm wondering how to best tackle this issue. Possible solutions I've seen involve slowing the power on/off cycles of the GPS, adding a capacitor to buffer the spike and/or using a high-side P-MOSFET.

If anyone may have any suggestions or pointers on what I might be doing wrong, I'd greatly appreciate it!

Cheers,
Adam

and/or using a high-side P-MOSFET

Yes, I would recommend starting there. It somehow looks cleaner switching a module high side.
The datasheet of your mosfet does not specify switching behaviour at less than 5v. [Rds(on)]

Maybe with something like this: http://www.aosmd.com/pdfs/datasheet/AO3401.pdf

Maybe with a big capacitor somewhere between the Trinket's +3.3volt and ground. From the datasheet, it looks like there is only currently 10uF.

Maybe delay switching the enable pin on the GPS receiver after power up (if you have not already done this ).

If you look at the schematic here;

https://github.com/LoRaTracker/Locator2

You will see how I did it, the circuit slows down the rise time when switching the GPS on, which can as you have found cause a brownout. This circuit seems to be reliable.

With the Ublox GPSs you can put them to sleep with software, which avoids the need for a MOSFET switch. Not sure if this functionality exists with other brands of GPSs.

Don't switch GND on an active device. This method is only suitable for devices with only 2 wires, such as a motor or light.

Pololu has some neat power switches that may be useful here.

Thanks all for the replies.

I had to push this issue aside to prioritize another project, but it's now at the top of my list of problems to resolve.

Based on the advice I received, I decided to pick up a P-Channel Logic Level MOSFET. I chose the NDP6020P, as it has a suitable Rds(on) for 3.3 V operation, low resistance, and comes in a TO-220 package.

When I connected the NDB6020P into my circuit (shown below), I discovered that the Arduino was still resetting itself when the GPS was turned on. Connecting my oscilloscope to the 3.3 V source revealed that when the GPS was turned on, the voltage would drop to ~1.7 V and the reset would occur immediately after. This was with a 220 Ohm resistor connected to the gate of the MOSFET. When I connected my scope leads to the MOSFET's drain/source I was able to measure that the turn on time was approximately 50 μs.

After researching this issue further, I came across another post of someone using the NDB6020P, which had a good suggestion by @MarkT to simply increase the value of the gate resistor to slow the switching of the MOSFET. So, I increased my gate resistor to 47 kOhm, watched as my turn on time increased to 150 μs and was pleasantly surprised to discover the Arduino didn't reset when the GPS was turned on! Out of curiousity, I increased the value of my gate resistor again to 100 kOhm, which further increased the turn on time to 250 μs and also seemed to fix the reset problem. With these higher value gate resistors, I put my scope leads back on the 3.3 V source, and measured the voltage dropping to only ~3.0 V when the GPS is turned on (~250 mV).

I'm happy to have found a relatively simple fix for my problem, but I'd like to be sure that I'm not creating further problems for myself, as I've read that there can be noise immunity issues (false triggers, etc.) with higher value gate resistors. I also believe adding a capacitor to the 3.3 V source could help to prevent the voltage drops when the GPS turned on, but I'm not sure how big of a capacitor I should use and whether it matters if it's polarized/non-polarized.

Thanks for your help!
Adam

In addition to the P channel mosfet, you really need an N channel mosfet (or NPN transistor) maybe something like this:

HighSideSwitch.JPG

Edit:
I've just seen you are controlling a 3.3 volt device with 3.3v so it is OK with a single P channel mosfet.
What I've illustrated is for controlling a 5 volt device from a 3.3 volt device.

Hi 6v6gt,

Thanks for the input. I'm glad to hear a single P-channel MOSFET should work, as I'm experiencing some really strange issues with voltage drops on the 3.3 V output of the Adafruit Pro Trinket. The oscilloscope reveals that the voltage begins to drop about 10 seconds after the GPS is turned on. I've included a simplified version of my circuit and the output from my oscilloscope below. The strangest part is that this only occurs when I use a 12 V battery. If I connect a 7.2 V battery, or use the FTDI, which provides 5 V, this behaviour does not occur. I'm completely stumped as to what could be causing this.

If anyone has any thoughts, or if I've made a mistake in my circuit, I'd greatly appreciate the feedback!

Simplified circuit:

Oscilloscope output:

It is a bad idea to use 12V as input to an Arduino, when you are powering external devices with the Arduino regulated output. The on board linear regulator wastes an enormous amount of energy and overheats.

Unless you really want to learn the hard way, don't waste your time. Use an external switching regulator and a Pololu power switch, as recommended in reply #3.

jremington:
It is a bad idea to use 12V as input to an Arduino, when you are powering external devices with the Arduino regulated output. The on board linear regulator wastes an enormous amount of energy and overheats.

Unless you really want to learn the hard way, don't waste your time. Use an external switching regulator and a Pololu power switch, as recommended in reply #3.

Thanks for the input Jim,

While I wasn't ever planning on using a 12 V battery, I did want to understand why the issues I was observing were taking place.

I decided to delve into the data sheet of MIC5225 regulator onboard the Pro Trinket 3 V and do the math in the thermal considerations section. It really helped me to gain a better understanding of the behaviour of the regulator when it was attempting to supply 75 mA with a 12 V supply. At ambient room temperature, it's only capable of handling around 8.6 V and ~425 mW of heat dissipation with that kind of load, so it was definitely overheating.

Since I was enjoying the math, I went further and calculated the theoretical maximum input voltage with a current draw of 100 mA and an operating voltage of 3.3 V, over a temperature range of -40 to +40°C. As it turns out, the regulator can't ever handle an input of 12 V with that kind of current draw:

Max power dissipation @ +40°C = 361 mW
Max input voltage @ +40°C = 6.7 V

Max power dissipation @ -40°C = 702 mW
Max input voltage @ -40°C = 10 V

Interesting stuff!

Cheers,
Adam

While I wasn't ever planning on using a 12 V battery

Glad you did those calculations and learned something.

Considering the above quote, please explain why you posted a diagram, clearly showing a 12V battery power supply.

jremington:
Glad you did those calculations and learned something.

Considering the above quote, please explain why you posted a diagram, clearly showing a 12V battery power supply.

I posted the above circuit with a 12 V supply because it was under those conditions that I first observed the issues with a fluctuating 3.3 V supply on the Pro Trinket. At the time I didn't understand why it was occurring and I was worried that it could manifest itself later on when using a different lower supply voltage. I feel much better now that I understand what had been causing the problem in the first place. Knowing that you don't know what you don't know is a rough place to be in sometimes!

Cheers,
Adam

Do note that this is a problem generic to many of the Arduino devices. While the more modern boards such as the Due have properly rated 5 V regulators, that on the UNO, Nano, Pro Mini, Leonardo and such is able only to power the processor itself and a few other LEDs and low-power sensors.

It seems to me to have been a quite ill-conceived design "gimmick" to place a power connector commensurate with common power supplies providing 500 mA to 2 A at 9 or 12 V, on a device which could never handle anywhere near that figure. The UNO in particular is designed as a "demonstrator" rather than for serious end-applications, which means it has a number of options able to be demonstrated, but note necessarily integrated together.

The Raspberry Pi made a better judgement, using the micro USB connector that had been agreed upon as the universal charging port of mobile phones and the simplest (and safest :roll_eyes: ) way to power a "UNO" (Nano etc.) is still to use a USB charger with a suitable - readily available and cheap - USB cable.