electronics help - zener diodes and voltage divider - combined?

skyflyer

Well-Known Member
Joined
26 Jan 2011
Messages
1,433
Location
Worcester, UK
Visit site
I am using a standard voltage divider to reduce voltages from 12v to less than 3.3 v for input into an Arduino Due.
I have to allow for some spiking, e.g. when alternator is running or mains battery charger, so am dividing by more than 3.63 (12/3.3).
But I thought in order to have a long-stop back up I could incorporate a 3.3v Zener diode to ensure that any spikes above my theoretical maximum are contained.
But I cannot find, online, any guidance as to whether it will work if I just stick a zener plus resistor between the input pin and ground - is it that simple?

This is my proposed circuit
2nkngqq.jpg

R1 300K, R2 100K, R3 470. ZD 0.5W, 3.3v

(Edited to add: my divider is only 1/4 because actual voltage to be measured is about 9v when 12v applied to boat. But if alternator goes to 14 or 15v the nominal 9v will also rise.)
 
Last edited:
Not going to work...., well not going to work a well as you would like.

An ideal zener has a reverse breakdown voltage, try to go above that voltage and it starts conducting really well.
There are, however, a few considerations.
First, and most importantly, they dont take a whole lot of current before they go poof and the magic smoke goes bye bye.
Second, they dont have quite the sharp cut off you might like, bit more of a curvy start, then the sharp drop.

So, what they are good at is voltage references, what they are not good at is shunting excess energy.

So, your circuit....
With Vin at 12V your Arduino will see 3V, not enough.
If Vin goes above 13V2 then the zener will start to conduct, putting current through R3,. causing the 3V3 for the Arduino to rise, not much, but still rise.

Either build a proper shunt regulator with zener reference (~4V0) and an NPN bipolar doing the grunt in-place of the potential divider
Or, and by far the best option, buy a buck converter.
 
The line is analog, a variable voltage from the masthead transducer proportional to wind angle. The arduino reads this voltage (after being divided) and two others and calculates the wind angle, as well as counting pulses from the anemometer and then creates an NMEA183 sentence that is readable by rest of network
12v goes up to the masthead but I get max 9v back probably due to ancient transducer which has pots not Hall effect sensors and thus probably some dirty or worn connections.
It's been tested on the battery and works like a dream but I suddenly realised that with the engine running it could be an issue at higher voltages.
The masthead 12v supply comes from the instrument (which has a separate 12v supply for itself, as it were) and I had assumed this was regulated so that no matter what the boat voltage was the masthead supply would be steady at 12.
Only thought to check today, and it isn't, it simply mirrors the boat voltage.
However I could put a simple voltage regulator into the masthead supply circuit I suppose.
I had hoped my original post would have made it obvious that my electronic knowledge is very very limited so unfortunately
All the suggestions above are almost totally meaningless to me! "Build a proper shunt"? "Buck converter"? "7803"? "schotky"? All Greek to me! Obviously I can Google what these are but I'm never going to be able to create a circuit to do what I want!
Regulate masthead supply has to be a better bet?
 
Use a simple divider, but add a Schottky diode to the positive power rail. If the input goes too high, the diode conducts and the spike is quenched by the power supply.

I think Nigel is a bit confused on diode types and names. ASFAIK Schottky diode is the same as a silicon diode but with lower forward volt drop (around .25v) He probably means Zener diode which is an avalanch diode conducting in the reverse direction (without damage if power dissipation is not too much) at around the rated voltage.
Yes zener diode can be used to dissipate voltage spikes but would need in OPs diagram to be of a higher voltage than 3.3v on a 3.3v line. As said the conduction is not at a sharp point but rather less sharp avalanch. olewill
 
I think Nigel is a bit confused on diode types and names. ASFAIK Schottky diode is the same as a silicon diode but with lower forward volt drop (around .25v) ...
For a change I am not confused. A Schottky diode is the best for this purpose, and for the reason you give.

Many microcontrollers already have ESD protection diodes from the input to the power rails (see image), but it does no harm to double up on the one to the positive power rail.

IC_Input-1.jpg


So take your signal from your divider, and just add a Schottky diode to the positive power rail.

I normally use a DO-214, but if you want leads rather than surface mount then see any of these.
 
Last edited:
For a change I am not confused. A Schottky diode is the best for this purpose, and for the reason you give.

Many microcontrollers already have ESD protection diodes from the input to the power rails (see image), but it does no harm to double up on the one to the positive power rail.

IC_Input-1.jpg


So take your signal from your divider, and just add a Schottky diode to the positive power rail.

I normally use a DO-214, but if you want leads rather than surface mount then see any of these.

+1.

It is also the reason the datasheet for the micro specifies the absolute min & max voltages for the IO pins as Vcc +/- 0.3V.

It's important to limit the current that can flow into the diodes (in the micro or external). In the OP's circuit, R1 is the main current limiting device. So if the OP adds a pair of diodes that will handle a constant 10mA, then the voltage applied to the input can reach 3000V before exceeding the diodes rating.

The current limit of diodes internal to the micro isn't often quoted on the datasheet; as diodes are inexpensive I like to add external ones to my designs.

It's also desirable to add a capacitor across R2. It will reduce spike amplitude and can be sized to prevent ADC aliasing.
 
Ok, i vaguely understand the principle of what you are saying, but do not have adequate knowledge of electronics to be able to work out which components i actually need. What specific resistor, diode or capacitor.

I'm also not sure we aren't getting a bit theorectical here - I am trying to protect against possible voltage spikes of (say) 4v into a 3.3v limited pin on the £20 arduino, as a result of the 'boat' voltage spiking over 14.5v for some reason. If I get ever get 3000v down that wire, then the arduino is the least of my worries.

I nned the arduino to rapidly sense small voltage changes, via its analog input pins. I'm not sure adding a capacitor will not smooth all this out?

Because the algorithm that calculates wind angle works on the ratios of the three voltages measured, not the absolute values, any degradation or drop in voltage is irrelevant as long as it occurs in the same way on all three inputs.

In normal use the voltage divider and normal expected voltages will not produce a signal anywhere near 3.3v, hence I wasn't too worried if the zener were to start 'diverting' at slightly less than 3.3. Its a last stage backup to protect the arduino - worth £20 maybe; I don't want to spend hours and hours building a complex circuit!

I realise this is a bit like someone with no mechanical knowledge asking someone else to decide what gear ratios to use in a gearbox; you need to know a lot about what he intends to do with the gearbox first. Hopefully this post answers that.
 
I don't have a problem with it Nigel, I just don't understand it!

What is an ESD? just another name for the Schotsky diode you mention?
What is a power rail? My arduino will be powered from boat's 12v supply on its Vin pin - or maybe on the power connector, haven't decided yet. You say 'add ...between signal and power rail" ok, so the schosky goes there; but is it the same diode that goes between the signal and earth?
And this mall cap that I could add - where?

I realise that to those that understand electronics this is the equivalent of asking someone to explain the difference between the accelerator pedal and brake pedal on a car, but if you've never driven a car... !

edited to add: and the link to "any of these" - whats the difference, does it matter? Where/how on earth do you determine whether its limiting to 3.3v or any other Voltage?
 
Last edited:
Another option would be get a cheap adc off eBay and use that, no big shakes if it gets fried. Possibly more accurate that the arduino if the arduino input power isn't solid.
I got couple of these the other day but haven't had a play yet..
https://www.adafruit.com/product/856

If I was starting again, I probably would* but I am on final installation and anything that involves a major rewire etc isn't going to happen at this point.

The key thing in what I am doing is that the only reason I need this data in digital NMEA form is so that the a/p can sail to a constant wind angle rather than only on a given heading . So it doesn't really matter if the absolute value is wrong, so long as change is detected reasonably consistently .

If the real apparent angle is 60 degrees on the stbd bow it doesn't matter if the a/p see this as 40 or 50 or 70 degrees as all it needs to do is detect a change and correct for it.

Obviously it would be better if it was spot on but I don't think it's critical

* if i was starting again, I wouldn't; I'd buy new instruments - this has been 6 months of "saving a fortune on instruments'" that has probably cost me over 100 man hours, maybe more!
 
* if i was starting again, I wouldn't; I'd buy new instruments - this has been 6 months of "saving a fortune on instruments'" that has probably cost me over 100 man hours, maybe more!

yes, but making it all yourself means that you have the satisfaction of actually DOING it!
there's a minor issue that if/when it fails you wont have anyone to put the blame to :p

SF, please write down what you'll do regarding the 3.3V limiter, as I may need your help. Wont try these guys here as I only get 30% (max) of what they're talking about :eek:

good luck with the finalizing touches on your electronics

cheers

V.
 
I don't have a problem with it Nigel, I just don't understand it!

Does this help?

ybw_zpsrxr7alnv.png~original


At present this will give 3.3V for a 13.3V input, so adjust R1&R2 to suit. The signal is limited to a maximum of 3.3V by the diode.
ESD is ElectroStatic Discharge, I was just giving the reason for the built-in diodes.
The power rail is your 3.3V rail on the Arduino, as shown in the image.
The diode can literally be any of the ones I linked to.
 
Last edited:
Ahh. looks like I was barking up the wrong tree, or just barking mad... an input, not a power supply...


As Nigel said protection diodes are very common, all the GPIO on a Raspberry Pi have them and have saved many a Pi from over cooking. One thing though, if an input really tries hard it can end up powering the whole IC (and any other IC on the board that uses the same PSU rail), this will most certainly lead to a goodly puff of magic smoke, first the diode goes bye bye, followed by the input it was protecting.
 
Ahh. looks like I was barking up the wrong tree, or just barking mad... an input, not a power supply...


As Nigel said protection diodes are very common, all the GPIO on a Raspberry Pi have them and have saved many a Pi from over cooking. One thing though, if an input really tries hard it can end up powering the whole IC (and any other IC on the board that uses the same PSU rail), this will most certainly lead to a goodly puff of magic smoke, first the diode goes bye bye, followed by the input it was protecting.

Ah... as my 3.3v pin from the Arduino is being used as a power source to power a MAX3232 chip, (which does logic translations from 232 to TTL and vice versa) does this mean that, when the input voltage is exceeded on the pin that the Schottky is protecting, he Max3232 will blow?
 
Ah... as my 3.3v pin from the Arduino is being used as a power source to power a MAX3232 chip, (which does logic translations from 232 to TTL and vice versa) does this mean that, when the input voltage is exceeded on the pin that the Schottky is protecting, he Max3232 will blow?

Only if the current through the diode exceeds the current drawn by the circuit from the 3V3 rail. Not a lot of chance of that in your circuit since there is a 300k resistor in line as well.

No load power for Max 3232: 3V ~ 5V5 @ 0.3mA. You would need to hit it with over 90V for this to be a problem.

http://www.ti.com/lit/ds/symlink/max3232.pdf
 
Top