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

  • 1
    you could add an external circuit that accomplishes the current limiting that you need – jsotola Jan 20 '19 at 19:13
  • Which sensor is it and who claims that? I have not heard of something like that for a sensor. – Jot Jan 20 '19 at 19:27
  • INPUT_PULLUP should be fairly current-limited, but might not help... – dandavis Jan 22 '19 at 17:31
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.

  • Ok, that makes sense. Kind of what I expected, and I am happy to have someone other than myself confirm. (I can only accept the answer in 7 more minutes as I'm new to this SE site...) – Hamy Jan 20 '19 at 18:59
  • Point of clarification: CMOS needs minimal input current for logic signals. (they have nearly infinite input impedance.) TTL is another story – Duncan C Jan 21 '19 at 15:29
  • @DuncanC CMOS has a relatively high capacitance on the gates though, and that means a higher drive strength for a high fanout count to get them thar capacitors charged fast enough. – Majenko Jan 21 '19 at 15:34
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.

  • Really? At ≈1/3 of its rated max power, its voltage would droop by almost 10%? I would have expectred the output to be "stiff" enough to keep the voltage at the spec'ed voltage up to nearly the max current draw. Are there readily available current;/voltage graphs for the various models of Arduinos? And are they consumable by mere mortals? I'm pretty comfortable with most spec sheets, but I'm a CS guy, not an EE. – Duncan C Jan 21 '19 at 15:28
  • "I would have expectred the output to be "stiff" enough to keep the voltage at the spec'ed voltage up to nearly the max current draw." My example did not use a specific processor. This is a problem I see often, assumptions. What I am saying is that the specs need to be read. Because the capability is specified, and not all chips will have "stiff" outputs. And also the specification over the temperature range must be considered if that would be a condition that it will operate. The 12mA I was thinking of was maximum output of the ESP8266. Yes it can put out 12mA but with quite a voltage drop. – Rudy Jan 21 '19 at 17:35
  • And the Intel Curie (used in the Arduino 101, that the question was about) is specified with a maximum current of 20mA. – Rudy Jan 21 '19 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.