0

A number of questions ask about max possible in/out current on a GPIO pin, that's not my question here. I'm asking if it's possible to set a maximum current limit on a GPIO pin, such that any attempts to draw more than that current would result in the Arduino entering a constant current mode e.g. reducing the pin voltage?

I've read this, this, this, and skimmed the Curie datasheet, but I don't see a feature like this mentioned anywhere.

The only half-answer I have seen is on the Ruggeduino website, which explains that they have added a fuse to each GPIO pin to avoid overcurrent draws due to short circuits.

For context - I have an external sensor that claims to be more reliable with a small amount of constant current. I didn't know if I could easily add that limitation (e.g. max 15mA at 3.3V) into the GPIO pin as a safety measure, so I went on a search to find out which has eventually led me here

Hamy
  • 103
  • 2

2 Answers2

3

No. I have never heard of a microcontroller with constant current or current limiting on the GPIO pins.

You may get a drive strength on the pins of an FPGA, but I have never seen such a thing on a microcontroller.

In general, if you have a need to reduce the voltage as the current increases you would just slip a resistor in the circuit. Or for more precise control using the GPIO pin to control a constant current source or constant current sink is the normal way of doing it.

GPIO pins are generally designed for communicating with other logic level devices. They require minimal current. Some microcontrollers provide a higher drive strength to work with larger fanouts (lots of devices connected to one pin, such as in SPI buses), but they are not intended for providing power to a device or giving control over their current.

Majenko
  • 105,851
  • 5
  • 82
  • 139
0

Typically port pins do have some current limiting inherent in the design of the chip. But it isn't something that should be used as protection. More line a fact that should be taken into account when implementing a design.

Say a 3.3 volt processor has a maximum rating of 12mA. With a 5 mA draw from the pin the high output voltage might be 3.0 volts. When 12mA is drawn from the chip the output voltage might only be 2.5 volts. It is important to check the data sheet to determine what you will get under the expected conditions.

A port with an internal pull up option may be considered more like (but not like) a constant current source. But that's stretching things a bit.

Rudy
  • 993
  • 5
  • 12