Decrease Voltage to a Microcontroller

panic mode

Joined Oct 10, 2011
5,002
you can check schematic of your arduino and see if there is a bypass capacitor. and you can always add a bit more (it does not hurt). increased capacitance allows absorbing more energy if it reaches that rail...and example of this is if there is a surge at input...

for example instead of 12V input you see something unexpected and much higher such as 30V.

if you are using first circuit in post #6 (with D1/D2) then current would flow from 30V through R1, through D1 to 5V rail. if capacitance there is small, voltage would rise. instead of 5V, it could be something like 8V (just an example) and harm the MCU. so increased capacitance allows absorbing that and as a result voltage increase is smaller (instead of 8V, maybe it is only 6V). and that is why D3 is there to clamp it down to a safer value (5,1V or 5.6V).

think of capacitor as a something that holds water... like a drinking glass (small capacity or "capacitance"). if you insert an object (an egg or pebble or tablespoon of water) water level in that glass will rise. and it does not take much to create "disaster" (water spill). but if you the same experient with larger capacity container like a bathtub, water level rise would be negligible (for adding same quantity like to drinking glass).

you want to limit GPIO current - always. i never go for more than 5mA on MCU GPIO. this way high and low are still clearly high and low values and not something "close enough". when GPIO is configured as input, current is negligible. so this only applies to outputs. and if more output current is needed, i use additional components so that MCU is not stressed. don't want MCU suffer heart attack...

voltage divider is scaling down voltage. current through voltage divider does depend also on used resistor values but to work, voltage divider need TWO resistors. you are measuring voltage across lower resistor (R2). R1 is there to absorb excess. and - what you are measuring is VOLTAGE, not current. if R2 was missing (and the diodes used for protection), MCU input would see FULL voltage that is applied (12V). to prevent that, R2 is REQUIRED.
 

MisterBill2

Joined Jan 23, 2018
27,584
One detail that I have not seen provided by the TS is if the inputs are ANALOG or DIGITAL. That matters.
What confuses the issue a bit is THE INPUT CURRENT LIMIT: "a Seeeduino Nano that has a max pin current rating of 40 mA and voltage of 5 volts " That seems like an input clamp circuit current rating. It seems that all responders have assumed that it is an analog input, not a digital input.

Post #13 addsa bit of uncertainty: " I only need to know two states: if the voltage is 0 or 1.5 V would be state 1 and if the voltage is 12v then that would be state 2. " That could be either a binary digital signal or an analog condition signal.

But still I see no clarification as to if the Arduino input is analog or digital, or if the signal source is a variable voltage or an analog signal. I think it has input protection for every input, analog or digital. AND it seems that some inputs on some models can be programmed as either.
 
Last edited:

Thread Starter

Jibebuoy

Joined Nov 5, 2025
59
One detail that I have not seen provided by the TS is if the inputs are ANALOG or DIGITAL. That matters.
What confuses the issue a bit is THE INPUT CURRENT LIMIT: "a Seeeduino Nano that has a max pin current rating of 40 mA and voltage of 5 volts " That seems like an input clamp circuit current rating. It seems that all responders have assumed that it is an analog input, not a digital input.

Post #13 addsa bit of uncertainty: " I only need to know two states: if the voltage is 0 or 1.5 V would be state 1 and if the voltage is 12v then that would be state 2. " That could be either a binary digital signal or an analog condition signal.

But still I see no clarification as to if the Arduino input is analog or digital, or if the signal source is a variable voltage or an analog signal. I think it has input protection for every input, analog or digital. AND it seems that some inputs on some models can be programmed as either.
I was planning on using digital input pins. The source voltage can be any one of three values: 0v, 1.5v, or 12v. I want to scale down the 12v so it falls in the 3.5-5v range so it can be read as HIGH. The 0 and 1.5v values are low enough to be read as LOW on the MCU.
 

MisterBill2

Joined Jan 23, 2018
27,584
I was planning on using digital input pins. The source voltage can be any one of three values: 0v, 1.5v, or 12v. I want to scale down the 12v so it falls in the 3.5-5v range so it can be read as HIGH. The 0 and 1.5v values are low enough to be read as LOW on the MCU.
OK, so we have a binary digital input. The simple and cheap way to safely use 12 volts to provide a "logic high" is to use a series string of 5 silicaon diodes shunting the input, with a 4700 ohms series resistor, to the input signal voltage. When the input goes to 12 volts the diodes will be biased into conduction and limit (clamp) the input voltage to between 3.5 and 4 volts. The series resistor should be about 4700 ohms.
 

Thread Starter

Jibebuoy

Joined Nov 5, 2025
59
OK, so we have a binary digital input. The simple and cheap way to safely use 12 volts to provide a "logic high" is to use a series string of 5 silicaon diodes shunting the input, with a 4700 ohms series resistor, to the input signal voltage. When the input goes to 12 volts the diodes will be biased into conduction and limit (clamp) the input voltage to between 3.5 and 4 volts. The series resistor should be about 4700 ohms.
I am not following. Are you saying to have a 4.7k resistor and 5 forward-biased diodes all in series? How would that result in a voltage drop of ~ 12v - 8.5v = 3.5v?

Perhaps I should have mentioned this earlier, but I am powering this with a 12v, 5amp power supply plugged into my wall. Does this make this whole conversation moot - does the power pack act as a regulator so I don't have to worry about a voltage spike?
 

MisterBill2

Joined Jan 23, 2018
27,584
I am not following. Are you saying to have a 4.7k resistor and 5 forward-biased diodes all in series? How would that result in a voltage drop of ~ 12v - 8.5v = 3.5v?

Perhaps I should have mentioned this earlier, but I am powering this with a 12v, 5amp power supply plugged into my wall. Does this make this whole conversation moot - does the power pack act as a regulator so I don't have to worry about a voltage spike?
OK, you need to understand that "shunting the input" means connected between the signal input and the input circuit COMMON side. Only the resistor would be IN SERIES with the input signal, to limit the current.
HOWwould you expect the POWER INPUT voltage to have an effect on the digital DATA input specification / requirements ?? In most systems the supply voltage specification is independent of the data input requirements.
 
Top