BS170 N and gps tx/rx error

Hi all,

I have cheap uBlox gps receiver and would like to turn it on and of with a breadboard atmega328(pro mini 8mhz, 3.3v bootloader).

With an Uno I can switch the gps on and off without problems.
When I use the breadboard Arduino there is only the first 6 character of the NMEA string over and over on the same line, a new line is only created after the mosfet turns of.

Have tried to connect a LED and it turn on/off as expected. The breadboard Arduino can also turn on and off the Uno without any problems with RX/TX. Its only the gps that's not working correctly.

Its the same result if I read the gps data trough the breadboard Arduino or an FTDI.
5v and 3.3v to gps makes no difference.

BS170(http://no.farnell.com/jsp/search/productdetail.jsp?SKU=1017687)

Any help would be appreciated.

Show us your schematics/wiring


This works with the Uno.
Have tried with a 10k on GND and it makes no difference.
The gps works on the breadboard Arduino if I don't use the BS170.

Are you trying to turn the GPS on and off, by cutting it's power supply, or using some kind of sleep or enable input ?

GPS consume quite a bit of power compared to other devices. I suspect your GPS is not getting enough power.

Yes, i'm trying to cut its power.
It looks like the bs170 is turning on and off rely fast. I can see a faint flash on a LED.
Tried to put a 470uf from drain to 3.3v and I get 4 more characters.

If I wire the GPS direct to ground there is no problems with nmea sentences and power.
It consumes 70mAh

Is your Pro Mini running from 5 or 3.3V? If 3.3V, it is not enough voltage to turn it on.

GPS devices take a while to start working, even with backup power for their satellite status. Turning it on and off really fast, seems to me to be a misconceived plan.

How do you know what serial output you are getting ?

You didn't try connecting both your GPS and your computer to the same Rx/Tx on your arduino, did you ?

polymorph:
Is your Pro Mini running from 5 or 3.3V? If 3.3V, it is not enough voltage to turn it on.
Its rated for 5-3v, have tried to run it on 5v but no difference.

It's 3.3v, do you mean turning on the mosfet or the gps?
Because the gps works fine on 3.3v without the mosfet

michinyon:
GPS devices take a while to start working, even with backup power for their satellite status. Turning it on and off really fast, seems to me to be a misconceived plan.

It's not going to be turned on/off fast. I need to save power.

michinyon:
How do you know what serial output you are getting ?

You didn't try connecting both your GPS and your computer to the same Rx/Tx on your arduino, did you ?

Yes, I'm just forwarding the RX sentences. Works fine without the mosfet.

3.3V is not enough to turn on the MOSFET. The UNO is 5V. That is why it works on the UNO, but it is pushing it as that is not a logic level (ie, completely turned on at 5V) MOSFET.

Rds(on) Test Voltage Vgs: 10V
Threshold Voltage Vgs: 2.1V

Threshold Voltage is the voltage at which it just barely starts to turn on.

For such a low voltage, you might want to use a bipolar transistor instead of a MOSFET.

Typical threshold voltages are where the device is conducting a mA or less.

Here the datasheet says the threshold voltage could be anything from 0.8 to 3V for
a 1mA drain current. Threshold voltages always have a big spread between devices BTW.

So basically the best you can expect from the best devices at 3.3V is in the few milliamps to
few tens of mA.

The device has its on-resistance only given for a Vgs of 10V - so that's the gate voltage
you are supposed to use. Not 5V, not 3.3V, but 10V.

The key specification you need to see for a 5V logic level MOSFET is this:

"Rds(on) at Vgs=4.5V" (or occasionally Vgs=5V but 4.5V allows for sub-standard
supply voltage)

For a MOSFET for 3.3V operation that would be Vgs=3V or less.

You can always ignore the threshold voltage when driving a MOSFET from CMOS
since you won't have any problem turning it off.

In practice most of the MOSFETs for 3.3V logic operation are surface-mount, you
might be better off with a good NPN switching transistor instead.

Try measuring the actual voltage you are getting at the power input of the GPS module.

I wonder if you should put a capacitor on the power input of the GPS module, to provide extra current supply when the power demand of the GPS module increases and decreases depending on its activity.

MarkT:
Typical threshold voltages are where the device is conducting a mA or less.

Here the datasheet says the threshold voltage could be anything from 0.8 to 3V for
a 1mA drain current. Threshold voltages always have a big spread between devices BTW.

So basically the best you can expect from the best devices at 3.3V is in the few milliamps to
few tens of mA.

The device has its on-resistance only given for a Vgs of 10V - so that's the gate voltage
you are supposed to use. Not 5V, not 3.3V, but 10V.

The key specification you need to see for a 5V logic level MOSFET is this:

"Rds(on) at Vgs=4.5V" (or occasionally Vgs=5V but 4.5V allows for sub-standard
supply voltage)

For a MOSFET for 3.3V operation that would be Vgs=3V or less.

You can always ignore the threshold voltage when driving a MOSFET from CMOS
since you won't have any problem turning it off.

In practice most of the MOSFETs for 3.3V logic operation are surface-mount, you
might be better off with a good NPN switching transistor instead.

You learn something new everyday. :slight_smile:

Is one of these and option?

http://no.farnell.com/on-semiconductor/bss138lt3g/mosfet-n-ch-50v-0-2a-sot-23/dp/2101819
http://no.farnell.com/fairchild-semiconductor/fdv301n/n-channel-mosfet-220ma-25v-sot23/dp/9845011

Do you have a link to a good NPN switching transistor?
I have had problems with transistor voltage drop, have not found a solution to that after searching.

I think the issue most people have with driving BJTs is insufficient base drive. The rated HFE may be 100, but that is nominal. It varies with temperature, current, and most importantly that is a linear rating.

To drive an NPN or PNP transistor to full saturation, the base current should be about 1/20th the maximum collector-emitter current expected. But don't try to draw more than about 30mA max from an Arduino output. If you need more, use another transistor to drive the first, but DON'T use a darlington configuration or the Vce drop goes up to about 800mV.

Both of those MOSFETs are rather high resistance, 5 ohms or more. I'm not sure that is going to work well with a GPS.

[quote author=m_maursund link=topic=212061.msg1557270#msg1557270
You learn something new everyday. :slight_smile:

Is one of these and option?

Do you have a link to a good NPN switching transistor?
I have had problems with transistor voltage drop, have not found a solution to that after searching.

[/quote]

Those MOSFETs have very high on resistance of 5 ohms or so, this might cause issues,
depends on the current draw and the decoupling arrangements for the GPS module. But
they turn on nicely at 3.3V.

Good NPN switchers I've used are ZTX851 and ZTX450, they'll likely have no problem (they
are very high current for a small package), but without knowing the current draw of the
GPS its hard to say, the "standard" 2N2222 might be OK.