GPIO to power a sensor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO to power a sensor

3,102 Views
etronic_arg
Contributor II

Hi,

I just wandering if a single GPIO can power a sensor which its current supply is only 200uA.

The sensor has about 3uF of decoupling capacity so it will be a current peak to charge those capacitors when GPIO turns high. ¿Could the GPIO be damaged? 

Thanks,

Pablo

pastedImage_1.png

Labels (1)
12 Replies

2,799 Views
myke_predko
Senior Contributor III

HI pabloliberman‌,

No, the IO Pin should not be damaged. If this is a Kinetis part, I assume that a pin can drive 3mA which means I would expect the 3uF cap to charge in around 1ms. 

Why did you choose 3uF?  I would think for a situation like this a simple decoupling capacitor of 0.01uF to 0.1uF would be more appropriate.  There (relatively) long charge time will have to be accounted for before you try to access the sensor.  

I'm guessing that you are doing this as a very low cost way to turn off the sensor in a low power mode.  I'm not a big fan of powering devices from the Kinetis' (or any other SoC's) GPIOs but there are cases, like this, where it makes sense.  

You didn't say which device you are using and what is the interface to the Kinetis, but you're going to have to make sure that in low-power mode, all other connections will have to be at "0" (low voltage value) otherwise you will find that the sensor is not shutting down because current is flowing from the other connections to it's VDD via the high side ESD protection diodes on the IO pins.  Along with this, make sure your device drivers can handle low IO pins (this tripped me up a few months ago when I was turning off the power to a UART connected BT module and the RX pin caused the UART driver to treat the low line as a "Break" condition).  

Good luck,

myke

0 Kudos

2,800 Views
etronic_arg
Contributor II

Hi Mike,

Thank you for your comments again.

Yes, I followed the power distribution as indicated in fig. 59. I showed only one capacitor for simplicity.

Putting the device in standby mode means 21uA. In most cases, it could be acceptable but unfortunatelly it is not the case.

Pablo

0 Kudos

2,800 Views
Ray_V
Contributor V

You could connect the GPIO to a MOSFET to control the 3.3V power to the sensor

0 Kudos

2,800 Views
etronic_arg
Contributor II

Hi raymundovelarde‌,

You could connect the GPIO to a MOSFET to control the 3.3V power to the sensor

Thanks for your recommendation.

Yes, also I could use a load switch.

But in this case the question is if a GPIO could withstand a capacitive load and it could power a low current sensor.

Pablo

0 Kudos

2,800 Views
myke_predko
Senior Contributor III

Hi Pablo,

I fgiured as much - good luck with your project and keep us up to date as to your progress.

myke

0 Kudos

2,800 Views
etronic_arg
Contributor II

Hi mykepredkomimetics,

Thank you for your comments.

No, the IO Pin should not be damaged

I really need to be sure. Does the gpio's output transistor withstand high current peaks?

I just didn't want to ask about my case in particular. 3uF is an example.
The sensor I'm using has two different supplies, each one requires 1uF and 0.1uF decoupling capacitors giving a total of 2.2uF plus two LDO with the same capacitance.

I'm guessing that you are doing this as a very low cost way to turn off the sensor in a low power mode.  I'm not a big fan of powering devices from the Kinetis' (or any other SoC's) GPIOs but there are cases, like this, where it makes sense.  

Yes, you see it right.

The interface is SPI so yes, all other connections should be low if I want to turn it off ("backpowering"). Care should be taken specially in low power modes.

Another solution could be:

pastedImage_3.png

1) GPIO1 input or disabled, GPIO2 = LOW

2) GPIO1 input or disabled, GPIO2 = HIGH

3) Wait for capacitor to charge t >= 5*1K*3uF = 15mS

4) GPIO1=HIGH, GPIO2 input or disabled

What do you think?

0 Kudos

2,800 Views
myke_predko
Senior Contributor III

pabloliberman‌,

Okay, I think there are a few things that we need to discuss.  

First off, could you share the sensor part number and datasheet?  I want to understand exactly what you are working with.  

The Kinetis GPIO pins are current limited - there shouldn't be a problem unless you back drive them outside the Voh/Vol range with a high current source (a capacitor on the line with what is effectively an open circuit won't have any problems).  Don't make the Kinetis GPIOs high current (leave them at the normal 3mA) and you will be fine.  

Next, you CANNOT just sum the power filter capacitances from the datasheet and run with that.  If the datasheet says two power inputs with 1uF and 0.1uF then that's what you use.  Power capacitance is very important for sensors. 

On the same point, two 1uF bulk capacitors going into a sensor chip that only draws 200uA doesn't seem right - are you planning on running it in a very low power mode?  I'm asking because I want to understand the use case/work flow and does it start off in a high/normal power mode and then commanded into a low power mode (which, if this is the case, then you should not be powering it by a GPIO pin).  

I'm not sure what you mean by "two LDOs with the same capacitance".  Is this explained in the datasheet or is this part of your circuit?  If the output of the GPIOs are driving LDOs, why aren't you connecting the LDOs to the same power supply as your Kinetis VDD and controling them using GPIO pins?  

As for your proposed circuit, I think you're going off base - I would be very concerned about a 15ms power up time.  I'd like to see the datasheet to understand if this is okay.  

So, I think it's obvious that I would like to see the sensor's datasheet.  Please share it and together we can figure out what makes the most sense for your application.  

myke

0 Kudos

2,800 Views
etronic_arg
Contributor II

Thank you @Myke Predko for your comments. Sorry for having omitted that information.

The sensor is an accelerometer with digital output ADXL357. The microcontroller I'm using is MK27FN2M0AVMI15.

Please refer to fig. 59 of datasheet. I connected both power Vsupply and Vddio to the same point.

Pablo

0 Kudos

2,800 Views
myke_predko
Senior Contributor III

HI Pablo,

Thanx for the pointer.  I've worked with the ADXL357 before so I'm familiar with it.  

The part won't work if you tie the (four) voltage inputs together with a single capacitor - sorry you must follow the wiring shown in fig. 59.  

Can I suggest that you:

a) Follow the power wiring with the specified capacitors shown in figure 59 of the datasheet

b) Use the 3.3V supply you use for the MK27 for the ADXL357

c) Put the device in standby mode (Set bit 0 of the POWER_CTL register) via SPI rather than turn off the power

This will simplify the application and while not be the abssolute lowest power, it will mean that yoiu don't have to worry about driver/pin mux operation or any leakage currents.  

Let me know what you think.

myke

0 Kudos

2,800 Views
nxf56274
NXP Employee
NXP Employee

Hi,

It can't. But you can add some components to meet your demands. R will limit the current. The D will prevent reverse charge.

pastedImage_1.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,799 Views
myke_predko
Senior Contributor III

nxf56274‌,

Can I ask why are you recommending putting in the diode and the current limiting resistor?  

The diode will drop the voltage at the sensor by 0.4V (Schottky) to 0.7V which may be problematic in terms of the operating limits of the part and if the pin can drive the capacitor charging current when it's output is high, it should be also able sink it without any issues. As for the current limiting resistor, that will significantly slow down the sensor start up (3uF is a pretty large cap) which may be a problem for the sensor (which is expecting a faster power on rise time).  Adding both these parts can negatively affect the operation of the sensor.  

What Pablo has described is similar to putting a one wire DS18B20 Temperature Sensor (which has a 1mA current draw which is higher than the sensor he is using) on a Kinetis GPIO.  You can see how it's used here: Implementation of 1- Wire Protocol and supported by Erich Styger's MCUOnEclipse Components.  

My personal concern is with the size of the cap, but I think driving the sensor directly from the Kinetis GPIO shouldn't be a problem.  

myke

2,800 Views
nxf56274
NXP Employee
NXP Employee

Hi,mykepredkomimetics

Thanks for the advice. I will think again.

BR,

Da

0 Kudos