Diode voltage clamping - Page 1
Forum section: electronics / beginners

author: NEoX
author_rank: Contributor
timestamp: October 27, 2018, 12:17:04 pm
content: Hi!I want to step down voltage from sensor signal (9v) to 3.3v for MCU and generaring smallest amount of heat as possiblebecause next to circuit is temperarure sensor that need to be acurate . I was searching for best solution to doo that but got more confused than before.-basic voltage divider? -waste of energy and heating up-zener voltage shifting? -im looking for more protection way (zener shifting is just Vin-Vbreakdown..if there is more than 9v on sensor input thing wil blow up)-op amp as comparator? -overkill?/dumb?-simple transisotr (base 9v, collector to emiter 3.3v and to mcu?)-better way and cheaper than this?..and at the end circuit below.. but the problem? I DON'T UNDERSTAND how it works? where that extra voltage goes..how to calculate resistors? Is this the best option?edit: sensor is digital logic(0v or 9v)

author: madires
author_rank: Super Contributor
timestamp: October 27, 2018, 01:26:19 pm
content: Is the sensor's signal an analogue signal which will fed into an ADC or is it a digital signal?

author: NEoX
author_rank: Contributor
timestamp: October 27, 2018, 01:43:10 pm
content: Sensor is digital..But I'm just searching for best oprion to convert signal from 9v to 3.3v

author: madires
author_rank: Super Contributor
timestamp: October 27, 2018, 02:18:41 pm
content: The magic term is "level shifter". There are a lot of different types of level shifters, and it's hard to tell which might be a good solution without knowing more about your circuit.

author: spec
author_rank: Frequent Contributor
timestamp: October 27, 2018, 03:09:42 pm
content: + NEoXThe attached simple schematic will convert 0V and 9V logic levels to input logic levels suitable for a MOS MCU running with a 3.3V supply.I have assumed that the MCU is an ATmega 328 with the input pull-ups disabled, and that the 9V logic level input is not fast.With a 9V input logic level the current through R1 and R2 is 10uA and with a 0V logic level input the current through R1 and R2 is 0uA, so the interface will generate very little heat.This simple logic level converter will also give good protection from input voltage more negative than 0V and more positive than 9V. You could quite safely apply -9V and 18V without damaging the MCU input (the MCU has built in catching diodes at the Gnd pin and VCC pin).

author: spec
author_rank: Frequent Contributor
timestamp: October 27, 2018, 03:30:01 pm
content: Quote from: NEoX on October 27, 2018, 12:17:04 pmOnce the input voltage to the MCU reaches 3.8V (3.3V +0.5V), D1 becomes forward biased and conducts all 'excess' current flowing through R1 to the 3.3v supply line, thus clamping the input voltage to 3.8V.D1 does not conduct unless it has 0.5V forward voltage across it.Incidentally, R2 and D2, are there to protect the MCU input from negative voltages from the 0V to 9V logic input, and have no function under normal operation.

author: NEoX
author_rank: Contributor
timestamp: October 28, 2018, 01:19:39 pm
content: So how to connect small load on this like LED without voltage drop on mcu input pin? When sensor turn I want led to turn on and MCU to get 3.3v signal ..i tryed it and got voltage drop.

author: rstofer
author_rank: Super Contributor
timestamp: October 28, 2018, 03:58:43 pm
content: Your original circuit drops the excess voltage across the resistor and about 0.7V across the conducting diode.Let's say your input is 9V Diode D1 will conduct and the anode will be about 3.3V + 0.7V or 4V. Therefore, R1 drops the difference, 5V. One end of R1 is at 9V and the other end is at 4V so the drop is 5V. How much power it dissipates is determined by the resistance value P = E2/RIf you use a 1k resistor, you dissipate 25/1000 or 25 mW. If you use a 10k resistor, you dissipate 2.5 mW.I would use a Schottky diode because, internal to the uC, they are using Schottky diodes for the very same purpose - input pins are clamped (usually). If you use a Silicon diode, the internal diode will turn on first (0.2V?) and it will have to do all the clamping and your external circuit is mostly useless.1N5817 has a very low forward voltage drop at low current:https://www.diodes.com/assets/Datasheets/ds23001.pdfIn this case, the voltage at the pin might be just 3.3V + 0.15V or 3.45V. Much better. But you need to keep the current low so you need to so some math to figure out how much resistance you can handle. You get that from the input characteristics of the uC pin. How much current do you have to source at what voltage? Those numbers come from the uC datasheet. You need to consider how much voltage drop over R1 is added because of the input current. It won't be much but it is not zero. You also need to ensure you get over the input threshold voltage.