Microcontroller I/O pin Voltage and Current Charts¶
ATmega and ATtiny¶
Microcontroller | VDD Max | IPIN Max | Reference |
---|---|---|---|
ATmega48A/PA/88A/PA/168A/PA/328/P | 6.0 VDC | 40 mA | Page 322 Microchip Data sheet |
ATtiny24V/44V/84V | 6.0 VDC | 40 mA | Page 174 Microchip Data sheet |
ATtiny24/44/84 | 6.0 VDC | 40 mA | Page 174 Microchip Data sheet |
ATtiny212/412 | 6.0 VDC | 40 mA | Page 409 Microchip Data sheet |
ATtiny1624/1626/1627 | 6.0 VDC | 40 mA | Page 474 Microchip Data sheet |
AATtiny3216/3217/3224/3226/3227 | 6.0 VDC | 40 mA | Page 504 Microchip Data sheet |
Note 1: all chips above are 5VDC output tolerant when VCC = 5VDC. If VCC = 3.3VDC outputs cannot power a 5VDC output, even if a separate power supply is used with a common ground. (This still does not make sense to me, more info is needed.) Note 2: I am starting to think that if the CPU can take 5vdc VDD then the outputs can also be run at 5vdc. Note 3: What about servos? Many people mistakenly think servo current is running through the output pin, this is not the case, the 5vdc power to the servo runs straight from the power source into the servo power supply. The PWM for the servo runs from the PWM output pin and is a low current signal. Current for driving servos is limited by the traces on your board, your servo power wires, and the current capability of your power source. For example 4 AA alkaline batteries (6.0 vdc) can power 1 hobby servo at ~1 amp max, however 4 AA NiMH batteries (4.8vdc) can power up to 4 hobby servos at ~4 amps max and possible more amps. This is because NiMH battery chemistry can supply more current than alkaline battery chemistry. L Note 4: Lithium batteries can supply even more current than NiMH batteries, so why are they not used to drive servos? I’m guessing it’s because most Lithium-ion cells are 3.2 to 3.7 volts nominal per cell which cannot be easily multiplied into 5.0 volts. However, there are now high voltage hobby servos that can handle higher voltages, but they are a bit more expensive and run at 7.4 VDC nominal. If you want very high performance high voltage hobby servos are the way to go. See Using High Voltage (HV) Servos on Your RC Car for more info.
SAMD¶
| Microcontroller | VDD Max | Source Max per cluster | Sink Max per cluster |Reference | | SAM D11 | 3.8 VDC | 46 mA | 65mA | Page 935 Microchip Data Sheet | | SAM D21 | 3.8 VDC | 46 mA | 65mA | Page 1002 Microchip Data Sheet |
Note 1: What the heck is source vs sink? See: Current Sourcing and Sinking Note 2: This means 3.3 to 5vdc step-up level shifter circuits would need to be added to SAMD output pins to reliably work long term.
Xaio¶
The Xaio range of microcontrollers use different chips, see various microcontroller data sheets for more info. But I suspect only 3.3VDC on the output is safe. This means 3.3 to 5vdc step-up level shifter circuits would need to be added to all Xaio outputs to reliably work long term.
ESP32¶
| Microcontroller | VDD Max | Cumulative IO output current |Reference | | ESP32 | 3.6 VDC | 1200 mA | Page 46 ESP32 Series Data Sheet |
Note 1: ESP32 input pins are 5VDC tolerant, HOWEVER! output pins are NOT 5VDC tolerant, you must use a step-up level shifter circuit to convert 3.3VDC up to 5VDC. Good news is that this is not hard to do. Read on below for more info:
Here is a hackaday article on how to do 3.3V to 5V level shifting with low-cost diode and resistor circuits.
Originally the ESP32 data sheet listed the inputs as 5VDC tolerant but this was causing so much confusion for end users this info was later removed from the datasheets. See this discussion for more info: Are the ESP32 and ESP8266 (inputs) 5V tolerant (Yes they officially are) Once again this applies only to the inputs NOT outputs.