How to make use of the ADC in a proper way in automotive

Go To Last Post
67 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

I made a quite faulty design on my project which ia a voltage measurement device in a Truck (24V) as I learned when tested. I used SMAJ littlefuse in the measurement channel- which lead through its leakage to diffrent voltage readings in between those two channels. Also the leakage is non linear- which provided me from fixing this with a scale value. So I digged in this great forum and found a very interesting thread:

 

https://www.avrfreaks.net/forum/...

 

In my project I would like to make use of the analog ins of the 328P to measure 0- 30V DC (calculated as 0-33VDC to have some margin). The 328P runs on 5V controlled by a Traco TSR 1 2450 (I guess I need to ask also about that one, later) 

 

The above thread was super helpfull but I am still a bit stuck. 

 

Here is what I wonder:

- I changed the design to two diodes per channel, I think I will need a diode with ultra low leakage to be sure not to alter my measurement signal, right? any suggestions? 

- A cap was mentioned to get rid of AC ripple and to calm the input. Was it thought in the way I did it? 

- Any suggestion on size for that cap? I still would like to use the data at approx 100Hz sampling, so I don´t want something that big that it averages out my measurement, right? 

- Is the input impedance ok? Or should I chose other voltage divider rating? I saw something with 1Meg Ohm in series on the input - and thought that must also be a great source for noise, insn´t it?

- As I understood this diode approach needs a stable VCC rail, since I use a Traco TSR-1-2450 with a 0,01mF on direct out and a 10muF on the PCB to stabilize the VCC, is that rigid enough? Or shall I consider another approach? 

 

 

With my first approach, with the littlkefuse:

I desoldered them and tried just the circuit. I found that the 0V and the 33V Point are quite accurate. But in between the thing looses this accuracy, and is of a few hundrets mV (like 800-1200mV). Of cause I only check with a scope, but I am afraid to maybe got something else wrong. At least both channels show the same behaviour. 

Even if a 10bit adc has its limitations, I would at least expect it will work reliably, or am I mistaken and should look for some other ADC that will just work out of the box?

 

 

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
I will need a diode with ultra low leakage to be sure not to alter my measurement signal, right?

what, exactly, is your signal?

 

I don't think truck electrics are known for being particularly high-impedance ... ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. Quoting the mega328 datasheet:

The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less

You could sample slower to accommodate the high source impedance.

 

2. There's little point in putting a TVS diode after a 100K/18K potential divider. Put a higher rated diode before it. You could put a smaller resistor (<= 1K) in series with the input to limit the power if you wish.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

BetaCarotin wrote:
I will need a diode with ultra low leakage to be sure not to alter my measurement signal, right?

what, exactly, is your signal?

 

I don't think truck electrics are known for being particularly high-impedance ... ?

It is meant as a general purpose voltage measurement device 0-30V with aprox 100Hz sampling, for example battery voltage or even external sensors (wherever 10bit is enough).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what, exactly, is your signal?

 

More information is needed about the signal you are trying to measure, and how accurately you need to measure it.

 

Do you need to measure it accurately over the entire range, or just over the middle part of the range?

 

Often one might have a small cap, perhaps 0.1 uF, from the ADC input to Ground.

This gives a low impedance source for the ADC to measure its voltage.

The cap, however, also forms a Low Pass Filter with the input resistor.

This is usually a good thing, for digital sampling, but you need to be aware of the cut off frequency if you are trying to accurately following  a varying signal.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:

1. Quoting the mega328 datasheet:

The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less

You could sample slower to accommodate the high source impedance.

 

2. There's little point in putting a TVS diode after a 100K/18K potential divider. Put a higher rated diode before it. You could put a smaller resistor (<= 1K) in series with the input to limit the power if you wish.

 

 

1. That means I should meet 10k or less on the input also? I struggle a bit with understanding what output impedance means here. 

 

2. The idea was to protect against higher voltages than 5V at the adc. So you think a higher rated at the input (like 30V) wouldn´t have that big impact through the leakage? So that I do not need to take the two diode approach I sketched in the other attachment? 

 

2a. What will the power limiting do/ or why a smaller one? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Back in the annals of this site, about twenty years ago, there was a very extensive series of threads on automotive datalogger.  Start with telling whether you understand load-dump.

 

[edit]  User was Chancy99.  First thread in 2002...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

https://www.avrfreaks.net/forum/...

 

I think that if you go through that series, you will find very pertinent information on protecting your device in general, conditioning the input(s), using AVR8 ADC versus external, and storage.  Of course in this generation one would consider more capable platforms to start, such as Xmega or other more modern generations with more ADC features, and even e.g. moving to ARM or similar.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Sat. Jun 5, 2021 - 01:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

what, exactly, is your signal?

 

More information is needed about the signal you are trying to measure, and how accurately you need to measure it.

 

Do you need to measure it accurately over the entire range, or just over the middle part of the range?

 

Often one might have a small cap, perhaps 0.1 uF, from the ADC input to Ground.

This gives a low impedance source for the ADC to measure its voltage.

The cap, however, also forms a Low Pass Filter with the input resistor.

This is usually a good thing, for digital sampling, but you need to be aware of the cut off frequency if you are trying to accurately following  a varying signal.

 

JC 

 

As accurately as it can get with the 328 at hand. :-)

Yes- I want to be accurate over the entire range, because I do not know particular what these channels will be used for, as they are meant as general purpose - add on. 

I expect easier slow signals like battery voltage or a bit harder things like sensors, where a bit more accuracy is needed. (always considering th 10bit limitation). 

But my goal is, that it shows as best as possible the voltage. 

Since I am only able to process this data at 100Hz there is a possibilty to Lowpass at 1000Hz- or is that thought wrong ?

And, it has been some years since I calculated filters, the RC is affected by all resistors isn-t it? not just the input one?

 

I am a bit lost with the standards RC formula in my old literature, since I never have done it with a voltage divider. 

 

I would also be happy if you could point me to some reading tips, I am willingly to learn :-)  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:

Back in the annals of this site, about twenty years ago, there was a very extensive series of threads on automotive datalogger.  Start with telling whether you understand load-dump.

 

Yes I do, there are quite a lot, especially on trucks due to their many solenoids. 

 

Ahh I may look for that search word here: datalogger automotive..hopefully these threads are still online?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
I struggle a bit with understanding what output impedance means here. 

Atmel are considering your measurement input as a  Thevenin Source and use the term output impedance where perhaps source impedance would be better. (Your Thevenin Equivalent Resistance is (100K || 18K) ≈ 15K)

 

BetaCarotin wrote:
So you think a higher rated at the input (like 30V) wouldn´t have that big impact through the leakage?

No that isn't the thinking. Any leakage before your potential divider wont affect the measurement much, if at all, whereas even a small amount of leak current after the potential divider will.

BetaCarotin wrote:
What will the power limiting do/ or why a smaller one?

By moving the TVS directly to the input, it is directly across the battery where you have infinite current available. Automotive protection is hard and specialist devices for Load Dump Protection exist.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
Ahh I may look for that search word here: datalogger automotive..hopefully these threads are still online?

See my edits above...

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:

Of course in this generation one would consider more capable platforms to start, such as Xmega or other more modern generations with more ADC features, and even e.g. moving to ARM or similar.


 

For now I would like to go with the 328P, and max out what it can do. It is already on the brink of my comprehension and I do not want to get totally stuck with the project. 
but of cause- seeing below that rabbithole frightens a bit and lets me wonder if there is maybe a simpler solution like an external chip, with build in protection circuitery that maybe communicates via I2C and makes live easier. 
 

even the linked max protection component adds a lot of extra parts. There must be a easier solution :-) 

 

thanks for the links- I am reading now :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


BetaCarotin wrote:
I used SMAJ littlefuse in the measurement channel- which lead through its leakage to diffrent voltage readings in between those two channels.
Also from Littelfuse are the SP72x series of low-voltage SCR that reduce the leakage by a few orders of magnitude.

BetaCarotin wrote:
I think I will need a diode with ultra low leakage to be sure not to alter my measurement signal, right?
Low leakage; ultra-low leakage diodes are specialty.

BetaCarotin wrote:
any suggestions?
Your preferred jelly bean silicon diode; some PCBA manufacturers will have a parts list of parts that are in-stock in large quantities.

BetaCarotin wrote:
Was it thought in the way I did it?
A resistor in front of that capacitor will reduce dv/dt (iow reduce EOS, time constant of RC = 100ns approximate)

A charge storage capacitor is next to the ADC's input; SAR ADC will charge the sample-and-hold capacitor from the charge storage capacitor (first rule is twenty times the S&H capacitor)

BetaCarotin wrote:
so I don´t want something that big that it averages out my measurement, right?
An anti-aliasing filter (AAF) is common for ADC and DAC.

1-pole (RC) AAF may be adequate if the sampling rate is high enough else an active AAF.

BetaCarotin wrote:
Is the input impedance ok?
Yes

BetaCarotin wrote:
I saw something with 1Meg Ohm in series on the input - and thought that must also be a great source for noise, insn´t it?
Yes though some noise may aid precision (oversample-and-decimate)

Can reduce the 1Meg ohms by three orders of magnitude by high speed current limiting.

BetaCarotin wrote:
... is that rigid enough?
Stiff (very low impedance) is good though the criteria are

  • stability
  • noise
  • efficiency

A regulator is typically conditionally stable.

PSRR is extremely rare in AVR datasheets.

Efficiency may not be a concern.

 


ESD and Transient Protection Using the SP720 | Littelfuse AN9304.4

due to 

 

Low Leakage Diodes | DMOS Switches, JFET Amplifiers, BIFET Amplifiers, MOSFETS | Linear Systems

 

AN-D66 Depletion-Mode MOSFET: The Forgotten FET (Microchip Technology)

[page 2, right column]

The authors of AoE add to that

  • dv/dt reduction
  • current steering
  • current division

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

[page 12, middle of right column]

5.15.5 A riff on robust input protection 362

 

TSR 1-2450E TRACO Power | Mouser

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

because I do not know particular what these channels will be used for, as they are meant as general purpose 

So might as well use the ADC within the M328.

It doesn't sound like you have a good reason to use an external ADC.

 

protection component adds a lot of extra parts  

 

Yes.  Vehicles are a tough environment in which to use electronics.

 

You need Load Dump / voltage limiting on EVERY part of your project that goes within a vehicle.

That means that the power supply, and ALL of your input signals that connect to the vehicle's power need protection.

Otherwise the voltage spikes can still enter the micro and cause damage / problems.

 

Once you have the electrical parts of the project all worked out you are in for still more fun!

 

Vehicles typically operate in a wide temperature range, and also have to deal with humidity and vibration.

 

What looks like a simple project on the workbench can be a challenging project once placed in a vehicle!

 

JC

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh yes, I really feel the project already exploding. I thought way to naive in the beginning and still I am drowning (Dunning Kruger curve...). 

Ok. 

So I need to protect my power input and my voltage measurement inputs. 

 

I also use a CAN tranciever mcp2551 datasheet that will be connected to vehicle CAN. But as I understood the transciever already got its inbuild protection. 

 

 

Another question, when using surpressor diodes, don´t I need to use resistors in every case? To avoid the diode from taking too much current? Or will I slow it down in reaction time? (does that make any sense?) 

 

And: Why do I want the limiting resistor for these diodes on the Vin line? Wouldn´t it be better to have the resistor on the ground side of the TVS diode? Than it would not alter the input signal but is still there when the diode kicks in? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:
You could sample slower to accommodate the high source impedance.
AVRxm (XMEGA) can disable discharge of the sample-and-hold capacitor to which XMEGA E add variable sample duration (like AVRxt)

N.Winterbottom wrote:
You could put a smaller resistor (<= 1K) in series with the input to limit the power if you wish.
R-TVS-R greatly improves ESD tolerance.

 


AVR® Dx - Additional Features | ADC | Migration from the megaAVR® to AVR® Dx Microcontroller Families

...

  • Programmable Input Sampling Duration

...

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
And: Why do I want the limiting resistor for these diodes on the Vin line?
For when you, or the one who provisions, mis-wires.

Though Littelfuse PolyZen don't have an automotive rating, these do reach to 24V or a few to 48V; edit : oops, in reverse, forward is 15V working max.

BetaCarotin wrote:
Wouldn´t it be better to have the resistor on the ground side of the TVS diode?
Atypical; clamp's voltage is TVS's voltage plus I*R.

 


PolyZen Devices for Overvoltage-Overcurrent Protection - Littelfuse

PolyZen Device Fundamentals (Littelfuse)

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Sat. Jun 5, 2021 - 06:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
For when you, or the one who provisions, mis-wires.

 

Though Littelfuse PolyZen don't have an automotive rating, these do reach to 24V or a few to 48V; edit : oops, in reverse, forward is 15V working max.

 

I dont understand that, what I meant was something like this: see attachment. 

 

Where the current limiting resistor does not affect the voltage divider during normal operation. Or am I thinking wrong here? 

 

Edit: second drawing with resistor in front of TVS

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

R-TVS-R greatly improves ESD tolerance.

 

Do you mean an additional R on the GND side or do you mean something that I draw one post above with one R upfront, than TVS than voltage divider?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Differing contexts (power input, ADC input) (low impedance, "high" impedance)

One way to limit power input is PPTC then a zener diode; another way is PPTC, switching diode (reverse voltage protection), zener diode (over-voltage protection)

 

 

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
Do you mean an additional R on the GND side
No

BetaCarotin wrote:
or do you mean something that I draw one post above with one R upfront, than TVS than voltage divider?
Yes

 

Reference :

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

[page 16, right column]

12.1.5 Input protection 804

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

BetaCarotin wrote:

so I don´t want something that big that it averages out my measurement, right?

An anti-aliasing filter (AAF) is common for ADC and DAC.

 

1-pole (RC) AAF may be adequate if the sampling rate is high enough else an active AAF.

 

Did I just comprehend that a C alone is more or less a very basic low pass? 

And thats what will keep my input away from high frequencies?

 

And that is basically AAF- to cut out higher frequency parts, that may interfere with the sampled (lower)frequencies ? 

 

So when trying to find a proper C for my analog in, I need to consider the other R from the voltage divider, didn´t I ? 

#confused

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

Differing contexts (power input, ADC input) (low impedance, "high" impedance)

One way to limit power input is PPTC then a zener diode; another way is PPTC, switching diode (reverse voltage protection), zener diode (over-voltage protection)

 

 

 

Ahhhhhh! 

PPTC - I love those, but am a bit afraid putting them in a box, that goes in a car (temperature). I found at least a automotve graded TVS diode :-) So I will try to move on with the TVS approach. 

Now I am gonna read the The Art of Electronics 3rd Edition | by Horowitz and Hill , I am reading through all your links, thanks for the help! 

 

Hopefully I can soon understand which approach and why is good for my project. 

I found also this here NXP Application note that I thought was a bit helpfull to understand the different stages 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
Did I just comprehend that a C alone is more or less a very basic low pass?
Very minimal

BetaCarotin wrote:
And thats what will keep my input away from high frequencies?
RC low pass filter (1 pole)

BetaCarotin wrote:
And that is basically AAF- to cut out higher frequency parts, that may interfere with the sampled (lower)frequencies ?
Yes (Nyquist sampling theorem)

BetaCarotin wrote:
So when trying to find a proper C for my analog in, I need to consider the other R from the voltage divider, didn´t I ?
Yes and the sampling frequency and the signal's maximum frequency (fundamental, first harmonic, ..., usually fifth harmonic is enough though third harmonic may be good enough)

Sometimes a one-pole AAF isn't enough; AVRxt's ADC is an order of magnitude faster than AVRe+.

 


The Sampling Theorem | The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D.

[in second paragraph after Figure 3-3]

Aliasing is a double curse; information can be lost about the higher and the lower frequency. 

 

ADC | Migration from the megaAVR® to AVR® Dx Microcontroller Families

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
An anti-aliasing filter (AAF) is common for ADC and DAC.

 

1-pole (RC) AAF may be adequate if the sampling rate is high enough else an active AAF.

 

Please don´t shout at me now.... but how do I estimate the sampling rate correctly? I am running on 8 MHz, and calling a read with the famous analog.read(). So the reading should take 13 ADC clock cycles..but only when I call it? So when my program takes longer than 13 clock cycles to execute it is my program cycle time that will be the sampling rate? How will I know how many time my program needs to execute? 

Flicker a port on every execution and look with a scope? 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
Yes and the sampling frequency and the signal's maximum frequency (fundamental, first harmonic, ..., usually fifth harmonic is enough though third harmonic may be good enough)

 

Sometimes a one-pole AAF isn't enough; AVRxt's ADC is an order of magnitude faster than AVRe+.

 

So my maximum writing speed (the speed I can get the measurements out to the user) is 100Hz, that would be also my signals max frequency that I can measure.

Going backwards from there I would want to sample with at least 500Hz and cut also of with a Low Pass at 500Hz?  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Often times, one sets up a Timer/Counter to generate an interrupt at your desired rate, in your case 100 Hz, or one interrupt every 10 mSec.

 

In that interrupt you would read the LAST ADC measurement and store it somewhere.

Then trigger the ADC to take another reading.

Then do whatever else you need to do, and exit the interrupt.

 

So you are displaying / uploading / logging / whatever one sample behind real time.

 

For many applications that works out to be both easy to program / implement, and fine for the application.

There are some applications where processing the data as fast as you obtain it is beneficial.

 

If you are measuring temperature, fuel level, battery charge/discharge current, etc., those parameters do not change very quickly.  

Seeing a data value that is 10 mSec old isn't a problem.

 

Calculating when to fire a spark plug, on the other hand, requires better timing resolution.

 

If you sample at 100 Hz, then per the Shannon - Nyquist Theorem you can measure input frequencies up to 50 Hz, (1/2 of your sample rate).

 

What you intend to do with the data determines how many harmonics above the base frequency of the signal you need to pass through your filter, and then, therefore, what is double the highest frequency component that you wish to retain, and hence your sample rate.

 

There are many on line tutorials on the SN Theorem and digital sampling that can explain this nicely, with animated images.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
I also use a CAN tranciever mcp2551 datasheet that will be connected to vehicle CAN. But as I understood the transciever already got its inbuild protection. 

 

That's a very old part and not particularly robust (I've had them die and melt IC sockets, in much less demanding use-cases than automotive). I use the MCP2562 from the same family but that will require a board re-layout. Or maybe an isolated CAN transceiver. Some are rated to 5KV isolation (e.g. TI) but that will require a board redesign too.

 

You really do need a TVS across CANL and CANH as well. There are CAN-specific TVS available, usually in SOT-23.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes DocJC's #27

BetaCarotin wrote:
How will I know how many time my program needs to execute? 
Few, several, many (a bit in the ADC's output may be imprecise due to EOS [EMI/ESD/EFT/lightning])

Filters are common (analog, digital, software); one inaccurate ADC result shouldn't upset the process.

BetaCarotin wrote:
Flicker a port on every execution and look with a scope?
Yes though a logic analyzer may be quicker to operate (no need to move and set markers)

fyi, if there's a spare port then a logic analyzer is one way to obtain very low latency data from an MCU.

Reasons :

  • a debugger may not be available while operating in the truck
  • log data while operating the truck

 


ESD (Immunity Test) | AVR040: EMC Design Considerations

[last sentence]

This means that the designer of a microcontroller based system must either design hardware to make sure that ESD transient never reaches the I/O pins, or write software that detects and handles such incorrect readings.

ESD and Transients | AVR040: EMC Design Considerations

[middle]

If the system software cannot be made to handle this (and that is usually the case), the system requires some kind of hardware that will create a more controlled path to ground.

 

Troubleshooting real-time software issues using a logic analyzer - Embedded.com

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
So my maximum writing speed (the speed I can get the measurements out to the user) is 100Hz, that would be also my signals max frequency that I can measure.
Greater

An analogy - PAL's frame rate is 25 Hz yet a raster contains tens of thousands of pixels.

filter's input frequency >> filter's output frequency (one instance of such is oversample-and-decimate)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


re oops, a PPTC and a power TVS for greater than 15V working.

General Port Protection Solutions - Littelfuse | Mouser

[7/8 page]

DC INPUT CIRCUIT PROTECTION SOLUTIONS

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

 

 

re oops, a PPTC and a power TVS for greater than 15V working.

General Port Protection Solutions - Littelfuse | Mouser

[7/8 page]

DC INPUT CIRCUIT PROTECTION SOLUTIONS

 

 

NICE! Especially the CAN TVS Array! And way more protection tah. The MCP2561FD offers out of the box. (I looked into going away from the old MCP2515 and it can be drop-in-replaced- with no real re-design needed)

 

my copy of ”The art of electronics” will also arrive this week.

 

I still strugle a bit choosing a resistor that will be upfront the TVS to limit current when not ESD but wrong connecting event. I than take my max supply voltage and the max continious current through the TVS?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
I than take my max supply voltage
... up to 30Vdc for the truck at frigid temperatures.

BetaCarotin wrote:
... and the max continious current through the TVS?
That can be a lot of current; there are telecommunications PPTC.

10 Ways to Destroy an Arduino — Rugged CircuitsRugged Industrial Arduino Microcontrollers

PolySwitch Telecom Resettable PTCs High Voltage Power Protection - Littelfuse

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

BetaCarotin wrote:

I than take my max supply voltage

 

... up to 30Vdc for the truck at frigid temperatures.

 

BetaCarotin wrote:

... and the max continious current through the TVS?

 

That can be a lot of current; there are telecommunications PPTC.

10 Ways to Destroy an Arduino — Rugged CircuitsRugged Industrial Arduino Microcontrollers

PolySwitch Telecom Resettable PTCs High Voltage Power Protection - Littelfuse

 

are thete automotive polyswitches? I wonder due to the broad temp band (-40-+80C) if a polyfuse would work?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
are thete automotive polyswitches?
Yes

BetaCarotin wrote:
I wonder due to the broad temp band (-40-+80C) if a polyfuse would work?
Yes though close on margin; AVR Dx have an additional 10mA.

R-TVS-R will current split between the TVS and the AVR.

If still a concern then an active current limiter will be well within the maximum (post #13); similar method by TBU though these are usually in the context of transceivers (current limit is greater than most MCU)

 


Surface Mount PTCs - PolySwitch - Resettable PTCs - Littelfuse

 

Ruggeduino MINI SMALLS-ET "Extended Temperature" — Rugged CircuitsRugged Arduino

[3/4 page]

The microcontroller pins are rated to source an ABSOLUTE maximum of 40mA. The PTCs on the protected pins will trip in the ~30mA range and start limiting current.

Operating Temperature -40C to +85C

Absolute Maximum Ratings | AVR® DB Family

Bourns - TBU High-Speed Protectors (HSPs)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're welcome.

BetaCarotin wrote:
PPTC - I love those, but am a bit afraid putting them in a box, that goes in a car (temperature).
PPTC will dissipate one watt (plus or minus) when tripped.

An automotive cab can reach to 100C and there's some convection; otherwise, definitely a concern.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This idea about protecting an Analog in / ADC channel R-TVS-R somehow does not add up.. 

So I found some Littlefuse devices for Automotive, they have a very low leakage, but are not available for 30V. 

If I find TVS for 30V they are not automotive. 

Moving the TVS behind the voltage divider would than be an alternative, but the littlefuses do not clamp at 5,5V, more at 7,5V, which is way to high for the ADC input, or? 

 

So I am a bit lost with my 30V ADC input 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
If I find TVS for 30V they are not automotive.
indecision maybe such exists somewhere for AEC-Q.

BetaCarotin wrote:
... more at 7,5V, which is way to high for the ADC input, or?
current division between the TVS and the AVR's ESD suppressors (resistor); if a constant EOS then a rail-connected TVS with a zener diode to typically clamp the rail (in AoE are low voltage clamps)

AoE's bi-directional current limiter steers current into ground (iow not into a power rail, post #13)

 


SP723 Lead-Free/Green Series - General Purpose ESD Protection from TVS Diode Arrays - Littelfuse (30V SCR TVS though not AEC-Q101)

 

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

[page 120, bottom of left column]

9.13.1 Overvoltage crowbars

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


BetaCarotin wrote:

This idea about protecting an Analog in / ADC channel R-TVS-R somehow does not add up.. 

I imagined something like this: Any leakage in the 1K is largely irrelevant, but will limit the TVS from silly currents. The TVS in turn protects your AVR input..

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:

 

 

 

BetaCarotin wrote:

 

This idea about protecting an Analog in / ADC channel R-TVS-R somehow does not add up.. 

I imagined something like this: Any leakage in the 1K is largely irrelevant, but will limit the TVS from silly currents. The TVS in turn protects your AVR input..

 

 

 

Yes, that is how I understood it. (Also with a 32nF cap to filter for 50Hz,which is half of sampling rate). 

That would need a 30V diode, which I haven´t found so far with automotive grade. 

The nice littelfuses for automotive have super low leakage, but very limited voltages (24 is colsest, which is odd, because even 24V systems operate at 28V)

...so that would only work on 5V side, but with a very late clamp at 7,5- which is maybe no problem according to the post above. 

 

And the non automotive as quite higher magnitude (3 decimals) more leakage and - as it seems - lower ESD voltages. But littlefuse is also kind of a djungle to me, so many products... 

It does not have to be littlefuse btw. 

 

Why is the leakage irrelevant? 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am still confused. 

Protecting the analog IN with the circuit design pictured right above.

 

So I changed this circuit to an input impedance of 9,3k Ohm, with 1k ->60K->11k

 

That also leaves the voltage divider to 33V max input resulting in 5V output, that how I want to generate a bit of save margin when using it for 0-30V.

 

I low pass at 50Hz with a 342nF cap (or the next lower value). 

 

So far so good. Now the TVS. 

Just looking into littlefuse AN and part selector leaves me wondering if I do it right (probably not). 

 

The hassle begins when I look for a proper clamping voltage, since I dont want to get over 5,5V, or 6,5? Or is it 20mA? Or everything? 

Since the input of the AVR has 1M Ohm - there will be never 20mA or? 

 

So reading through all the selector guides I learned I nead to now the thread level to select a diode. Aha. 

But, what is my thread? I want to use the device in Automotive, so I thought "how hard can it be, whats the rating for automotive"...yeah...right. After a weekend under a huge pile of weird definitions, laws, ECE´s I am not any wiser. 

How does one know which EMC rating/testvoltage /Thread level is applicable? 

 

Isn´t it always the maximum that one could get that one would wish for? 

 

help! :-) 

Last Edited: Sun. Jun 13, 2021 - 06:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
The hassle begins when I look for a proper clamping voltage, since I dont want to get over 5,5V, or 6,5?
That depends on the injection current.

Injection current is current into the power rail or out of the die's substrate (GND); either is through an ESD suppressor.

Excessive injection current, or excessive di/dt, may cause latch-up or anomalous behavior (an oscillator is out-of-spec, non-volatile memory controller malfunction, incorrect program counter, instruction stream malfunction, data stream malfunction, ...)

BetaCarotin wrote:
Or is it 20mA?
20mA it is for AVR Dx; otherwise, 1mA for other AVRxt.

The remaining AVR - IIRC, 1mA for some automotive AVR.

BetaCarotin wrote:
Since the input of the AVR has 1M Ohm ...
(leakage max)

BetaCarotin wrote:
... - there will be never 20mA or?
Indeed can due to EOS (ESD/EFT/lightning and some EMI [cellular phone])

BetaCarotin wrote:
I want to use the device in Automotive, so I thought "how hard can it be, whats the rating for automotive"...yeah...right.
Indeed (an order of magnitude)

BetaCarotin wrote:
How does one know which EMC rating/testvoltage /Thread level is applicable?
The project's required safety standards.

BetaCarotin wrote:
Isn´t it always the maximum that one could get that one would wish for?
No (system reliability, price, cost, risk)

 


Absolute Maximum Ratings | AVR® DB Family

Absolute Maximum Ratings | ATmega4808/4809 Data Sheet

Absolute Maximum Ratings | AVR® Microcontroller with Core Independent Peripherals and PicoPower® Technology

ATmega328PB Automotive Complete (absolute maximums on page 406)

Instruction Set Summary | AVR® Instruction Set Manual

 

(Automotive) Microcontrollers and Microprocessors | Microchip Technology (8-bit MCUs tab, AVR begin on page 5)

 

THE STATE OF EMBEDDED SYSTEMS SAFETY (Barr Group)

References | AVR040: EMC Design Considerations

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

The project's required safety standards.

 

That sounds so easy. But indeed nobody can tell me what safety standard my product should follow. The standard answer from authorities is that it is my responsibillity to know that and certify accordingly. 

So I think it is no wonder that the market looks like Barr Group showed. It feels obscure and weird to navigate this world. 

I am really happy about this place here and all the great help and links that are posted here, thank zou all!

 

So- since I don´t know what to expect and since I set the budget for cost myself I now just decide to protect as good as possible- 

which is not possible with a TVS, since maximum ratings qoute 5,5V on inputs while there is no TVS shutting down that early. 

 

or? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're welcome!

BetaCarotin wrote:
But indeed nobody can tell me what safety standard my product should follow.
the systems engineer (ideally)

BetaCarotin wrote:
So I think it is no wonder that the market looks like Barr Group showed.
Some of that may be due to price and cost (price+); automated regression testing and static analysis are both "expensive", though risk reducers, whereas code reviews should be a given and are common.

BetaCarotin wrote:
So- since I don´t know what to expect ...
Lightning?

Mis-wire to battery +?

BetaCarotin wrote:
... which is not possible with a TVS, since maximum ratings qoute 5,5V on inputs ...
typically current-limited

Given the requirements, current can be limited.

BetaCarotin wrote:
... while there is no TVS shutting down that early.
AoE current-limiter (#13) will keep the signal off the rails.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should easily get automotive rated transorbs (take a look at 5KP series, like 5KP33A...we used those on outdoor machines).

Leakage ahead of the divider won't matter much (unless you have a very weak signal source).

 

Note the ADC divider should be less than 10K thev (so 18K/100K is not the greatest, how about 9K/50k)

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

the systems engineer (ideally)

Well, thats me. I am all alone here. 

 

gchapman wrote:
Lightning?

 

Mis-wire to battery +?

Mis wire wont do anything to the analog input since it is capable of 10% more than max Voltage, reverse protection is on power input lines and through the TVS shorted directly. So its lightning left. And that can be anything can´t it? 

 

avrcandies wrote:

You should easily get automotive rated transorbs (take a look at 5KP series, like 5KP33A...we used those on outdoor machines).

Leakage ahead of the divider won't matter much (unless you have a very weak signal source).

 

Note the ADC divider should be less than 10K thev (so 18K/100K is not the greatest, how about 9K/50k)

 

I changed it to 1k ->60K->11k, that gives me 9,3kOhm right? 

When thinking about a cap to lowpass I got it right that I need to calculate for the same 9,3kOhm impedance? Because the voltage divider is like a parallel resistor network to the cap? 

I want to achieve 50Hz LP and calculated 342nF, is that right? 

 

avrcandies wrote:
5KP33A

THC... I would like to go as much smd as possible.. I found the 5.0SMDJ 30 which seems ok in price and quite similar to the 5KP 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to achieve 50Hz LP and calculated 342nF, is that right?

 

  Yes, you got it!. prob use a 0.33uF cap 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BetaCarotin wrote:
Well, thats me. I am all alone here. 
Functional Safety | Microchip Technology due to

Defeat Defects with Safety Coding Techniques | Electronic Design

by Rafael Taubinger (Technical Marketing Specialist, IAR Systems)

[1/3 page]

Functional safety standards such as IEC 61508,2EN 50128,3and ISO 262624... 

 

2.https://www.iec.ch/functionalsafety/standards/page2.htm

3.https://standards.globalspec.com/std/14256883/EN%2050128
4.https://www.iso.org/standard/43464.html

 


Functional Safety Ready Microcontrollers - Quick Reference Guide (Nov'20)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another question related to this.. since I haven´t found a similar design..(meaning I got it probably wrong..) 

 

I use an optocoupler to read jus a digital signal from a manual switch on the outside world. 

The switch switches to ground if actuated. 

 

Other voltage supply for emitter and detector comes filtered and protected from the board. 

 

Since the FODM only withstands 6V reverse and I want to be sure to safeguard usefailure (connecting this line to Ubattery) I use a GS1M diode right after the OC. 

The GS1M protects up to 1000V reverse. To get a proper ESD- protection-level on all inputs I inserted another SMDJ30 which opens at 33V and has R19 as current limiter.

 

So handler error should not trigger anything, ESD events will propably extinguished by the SMDJ/R19 group. 

 

Thoughts? 

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


How about his arrangement, where the 1000V diode does much of the work:

 

Pages