Help understanding a Zener diode as a voltage regulator

Thread Starter

ba58smith

Joined Nov 18, 2018
62
Which Arduino board are you using? Some of them have a built in voltage regulator.

Bob
Bob, I'm using the WEMOS D1 mini, which can be powered by 5V, but the GPIO pins are actually 3.3V. I am providing power with a 7805 voltage regulator and a couple of capacitors, but this post is about stepping down the voltage to the digital input pins. I will use what's been discussed above, with a Zener that's at or just below 3.3V.
 

MrChips

Joined Oct 2, 2009
34,968
Zener diodes below 5.6V are not reliable because of the slow I-V curve.
For input protection, use two diodes similar to the ones as shown:

 

ebp

Joined Feb 8, 2018
2,332
When the circuit at #22 is used, consideration must be given to the possibility of raising the supply voltage above nominal due to current injection via D1. At 24 V input, the supply rail would begin to rise in voltage if the load on it were less than about 2 mA. In days gone by, this was rarely a concern. With modern micropower circuity, is is a distinct possibility, especially things like microcontroller boards that can be put into "sleep" mode where the current requirement can be extremely small. Often where sleep mode is to be used the external circuitry has also be carefully structured for ultralow power consumption. R1 can be increased in value, often enough to alleviate this problem.
 

Thread Starter

ba58smith

Joined Nov 18, 2018
62
When the circuit at #22 is used, consideration must be given to the possibility of raising the supply voltage above nominal due to current injection via D1. At 24 V input, the supply rail would begin to rise in voltage if the load on it were less than about 2 mA. In days gone by, this was rarely a concern. With modern micropower circuity, is is a distinct possibility, especially things like microcontroller boards that can be put into "sleep" mode where the current requirement can be extremely small. Often where sleep mode is to be used the external circuitry has also be carefully structured for ultralow power consumption. R1 can be increased in value, often enough to alleviate this problem.
I won't be putting the board to sleep, and I don't think I'll see voltage near 24V, so hopefully it won't be an issue. Thanks for the warning, though!
 

steveholt

Joined Feb 24, 2013
2
If I understand what I'm reading about the Arduino, the maximum load from the input pin is 40mA, and is always in the range of 10mA to 40mA. But honestly, as I think about it, I don't know how an input pin would draw any load at all. Maybe it's the current needed to activate the switch from LOW to HIGH?
40mA sounds very much like the maximum current for a pin configured as output, not input. Not sure where the 10mA comes from but probably relates to the maximum across all output pins
 

Thread Starter

ba58smith

Joined Nov 18, 2018
62
40mA sounds very much like the maximum current for a pin configured as output, not input. Not sure where the 10mA comes from but probably relates to the maximum across all output pins
From this Arduino tutorial: https://www.arduino.cc/en/Tutorial/DigitalPins

"...Input pins make extremely small demands on the circuit that they are sampling, equivalent to a series resistor of 100 megohm in front of the pin. This means that it takes very little current to move the input pin from one state to another, ..."

Somewhere else, I thought I read that the typical draw on a pin was 20mA, with a max of 40mA, but it's quite possible that I misunderstood that.

Looking at the datasheet for my actual microcontroller's cpu (https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf), I can't find anything about the draw on the GPIO pins when they are used as input. I don't know where else to look.
 

Thread Starter

ba58smith

Joined Nov 18, 2018
62
From Atmel ATmega328 data sheet, input leakage current is 1μA max @ Vcc = 5.5V.
My microcontroller (Wemos D1 mini) uses the ESP8266EX cpu, not the ATmega328. However, if "input leakage current" is the spec that answers the question "how much current is drawn by an input pin?" - then I can try to find that out for the ESP8266EX, or any other cpu I'm working with. Thanks!
 
Top