Programmatically turning off GPS causes Arduino reset

Hello,

I am working on some project with GPS Quectel L80 and Arduino Pro Mini. For reason of saving battery I need to turn off GPS with circuit of BJT and MOSFET. GPS module also uses backup supply for saving last satelits (please see picture of schematic attached). More on this you can find in this topic:

https://forum.arduino.cc/index.php?topic=598544.0

My problem is, when I turn GPS_ON output on "HIGH", it causes reset of Arduino. VCC is Pro Mini's Vcc voltage (3,3 V). I tried with a big capacitance between VCC and GND, but it resets all the time.

If I just short cut 3,3 V to GPS's VCC supply pin it works normally, I can read GPS data. But this is not efficient, because I'm working on battery supply and GPS needs to be turned off most of the time.

For test I tried manually shortcut VCC with wire to 3,3 V and it also causes reset for the first time.

Please help, what I'm doing wrong.

Best regards

Nothing wrong with the circuit diagram. Use a magnifying glass and a multimeter to check for solder bridges or incorrect wiring.

Power supply details are lacking. If the GPS power comes from the Pro Mini's regulated output then stop doing that. Both the Arduino and the GPS need to be powered from a supply that can handle the demand. Doesn't sound like you're doing that.

The Quectel L80 uses only 20 mA, according to the manufacturer. That should not be a problem for the 3.3V regulator.

@OP Are you absolutely certain that the Pro Mini Vcc is 3.3V? It won't be if you are using a 5V FTDI programming adapter.

I am confused, the title of the post is;

Programmatically turning off GPS causes Arduino reset

Yet the body of the post says;

My problem is, when I turn GPS_ON output on "HIGH", it causes reset of Arduino.

When the GPS_ON pin goes high the GPS turns on ?

So is the Arduino reseting when the GPS is turned on and off ?

MK1888:
If the GPS power comes from the Pro Mini's regulated output then stop doing that. Both the Arduino and the GPS need to be powered from a supply that can handle the demand. Doesn't sound like you're doing that.

Yes, GPS Supply is on the same potencial as Arduino's regulated VCC 3,3 V. You think that voltage regulator on Pro Mini hasn't got enaugh power?

jremington:
@OP Are you absolutely certain that the Pro Mini Vcc is 3.3V? It won't be if you are using a 5V FTDI programming adapter.

Yes I am sure, I measured it. I am using FTDI converter that has jumper to select 3,3 V or 5 V.

srnet:
I am confused, the title of the post is;

Yet the body of the post says;

When the GPS_ON pin goes high the GPS turns on ?

So is the Arduino reseting when the GPS is turned on and off ?

Yes, when I turn GPS_ON pin on "high", program resets, I am sure about it because I print out start of program.

So, what to try? I don't like the idea to have another voltage regulator for GPS, because I want to have small as possible PCB.

Thank you for your help.

Regards

So, what to try?

The suggestions in reply #1.

What, exactly, are you using for a battery supply?

teslaas:
So, what to try?

Read the thread you quoted in your first post, the switching solution I use is given there.

An additional step is to set the Pro Mini brownout fuse to 1.8V, most all of them come with it set to 2.7V, which is a bit close.

jremington:
Nothing wrong with the circuit diagram. Use a magnifying glass and a multimeter to check for solder bridges or incorrect wiring.

Well its clearly crow-barring the main supply every time it turns on due to the 10uF capacitor.

The problem is this switch turns on very fast, you want supply to come up more slowly to avoid the current spike. 10uF of ceramic cap will pull amps if you charge it up at the full speed of a transistor or FET. Charging 10uF to 5V in 1µs needs 50A, which is why the circuit doesn't work.

Change R4 to 100k, lose Q1 and its ground connection, and add a 100nF cap to Vcc at the gate of the MOSFET. Now the Arduino pin's sense is reversed, but the switch-on will take a millisecond or two rather than a fraction of a microsecond and all will be well I think.

The NPN was never needed as the switch p-FET runs from Vcc, and the RC filter of the 10k R3 and the new 100nF cap has a 1ms time-constant. 10uF charges up to 5V in 1ms using 50mA, much more managable.

MarkT:
Well its clearly crow-barring the main supply every time it turns on due to the 10uF capacitor.

The problem is this switch turns on very fast, you want supply to come up more slowly to avoid the current spike. 10uF of ceramic cap will pull amps if you charge it up at the full speed of a transistor or FET. Charging 10uF to 5V in 1µs needs 50A, which is why the circuit doesn't work.

Change R4 to 100k, lose Q1 and its ground connection, and add a 100nF cap to Vcc at the gate of the MOSFET. Now the Arduino pin's sense is reversed, but the switch-on will take a millisecond or two rather than a fraction of a microsecond and all will be well I think.

The NPN was never needed as the switch p-FET runs from Vcc, and the RC filter of the 10k R3 and the new 100nF cap has a 1ms time-constant. 10uF charges up to 5V in 1ms using 50mA, much more managable.

Yes, thank you for your help, obviously is problem in circuit exactly as you are describing. I manually triggered BJT and measured voltage on Drain, it is exactly VCC, so transistors works but supply doesn't handle spike.

I am building low power system, so the way you suggest me your solution to overcome the problem is not suitable for me, because in deep sleep when output pin GPS_ON goes low, GPS will have supply in reversed logic. What do you think if I just reconnect C2 and C3 on the VCC potencial (same potencial as the Source of FET) close as possible to GPS module? I think in that way capacitors will be charged already when I switch the state?

I have to cut the connections to try this because I have already build PCB prototype.

teslaas:
I have to cut the connections to try this because I have already build PCB prototype.

I have a PCB for the L80/L86 and L70/L76 already, they use the switching circuit in the thread you quoted in the first post.

I have used the same circuit on small tracker PCBs for maybe 4 years to switch external devices, including GPSs.

The switching circuit works and is reliable, during extensive testing, and even deals with the more power hungry devices like the old Ublox GPS.

srnet:
I have a PCB for the L80/L86 and L70/L76 already, they use the switching circuit in the thread you quoted in the first post.

I have used the same circuit on small tracker PCBs for maybe 4 years to switch external devices, including GPSs.

The switching circuit works and is reliable, during extensive testing, and even deals with the more power hungry devices like the old Ublox GPS.

Maybe is VCC supply of my Pro Mini so sensitive, because I ordered it in my county from web and it's Chinese version. Voltage regulator is some no brand... :confused:

teslaas:
Maybe is VCC supply of my Pro Mini so sensitive, because I ordered it in my county from web and it's Chinese version. Voltage regulator is some no brand... :confused:

No, its not just the regulator, even my own 'bare bones' Pro Minis using known parts sourced from Farnell, suffer from the problem.

Turning the GPS rapidly on, or any device with a significant amount of capacitance, say more then 22uF, generates enough of a spike on the VCC side of the regulator to trigger brown out on the ATmega, its easy to spot on a scope.

So you need a circuit that lets the power for the device you are switching come on slowly and for added protection you need to reset the ATmega brown out down to 1.8V.

Slowing down the power on of an external device, is not that unusual, there are small integrated high side switches that include adjustable slew rate limiting.

Did you try putting the device in standby with software?

$PMTK161,0*28

Leo..

Wawa:
Did you try putting the device in standby with software?

$PMTK161,0*28

Leo..

You can, but the standby current is circa 1mA and there appears to be a bug.

If you power it down (with $PMTK161,0*28) as soon as you get a valid fix, which you might supose is the normal thing to do and you do this for say 30 minutes.

The GPS can then get stuck in that when it powers up again, it can take a very long time to get fix again, 30 or 40 minutes.

I did not investigate further but I suspect the way out of the problem migh be to cold restart the GPS when it gets stuck, takes longer than say 60 seconds to get a fix.

The Ublox GPSs have an equivalent command, but that puts the GPS in backup mode, the current then is circa 8uA.

srnet:
I have a PCB for the L80/L86 and L70/L76 already, they use the switching circuit in the thread you quoted in the first post.

Did you mean this circuit from thread I quoted in the first post?

gps_power.jpg

teslaas:
Did you mean this circuit from thread I quoted in the first post?

Yes.