Wideband O2 to narrowband signal converter electrical hazard protection and overall considerations

Hello!

I want to try to convert the 0-5V output of my AEM 30-0300 AFR gauge to a 0-1V signal my car's ECU can read, since it doesn't have narrowband emulation. I've built a prototype, but not tested it on the car yet. I am a complete novice and I have a few questions in mind that I need help with in order to perfect my device.

Here's the masterfully crafted schematic I created.

Let us start with the powering up the devices side of things. The first voltage regulator is a switching one, at least I assume so, because of the lack of a heatsink. My thinking was that it will lower most of the voltage (from 15-12v to about 10V) coming in and not heat up much, since it should be more efficient than a linear regulator. It also should have protections, but just in case I've included a schottky diode to prevent reverse voltage.

Here is the listing for the first regulator on aliexpress (the 3-32 adjustable rectangular one I have has been delisted): https://www.aliexpress.com/item/1005006083560198.html?spm=a2g0o.order_list.order_list_main.248.46c71802b60UkO

This brings me to my first questions. Is this a switching regulator? Is it possible to tell by the pictures if there actually is any of the advertised protections built in? Can and should I test any of them with simple tools? All I really have is a multimeter, batteries and some usb chargers.

After the switching regulator there is a linear regulator. I looked around the internet and apparently a switching regulator outputs a "noisy signal" and in order to combat that I added a LM317 to clean it up. I don't understand how and why this would work, but I added it just in case the aliexpress switching regulator doesn't output the promised low noise signal. It also takes some load off of the switching regulator and the arduino's linear regulator so they don't heat up as much. I measured that I've set the voltage drop to 7.35 at the LM317 output and the voltage down is to about 7.13v after the second schottky. Not sure of multimeter accuracy, it was within 0.1V compared to my other one.

Is there too much or too little redundancy on my power in side of things? Should I simplify or add something?

Now that the nano and mcp4725 have power, let me explain a bit how my code works. It takes the 0-5V input and converts it to a lambda value according to AEM's provided formula. From there it converts it to a 0-1V signal if the mixture is withing the usual lambda range of a narrowband sensor. Outside of the range the output is 0 or 1V depending if the mixture is lean or rich. I use a linear approximation for the narrowband voltage/mixture curve, since a narrowband apparently acts as a Lean-Rich switch anyway. My stoich mixture setpoint is 0.45V, since that is about where it really would be. The MCP4725 will output the signal to the ECU's oxygen sensor ADC. Since the AEM wideband and narrowband work in reverse to each other (Narrowband 1V is rich but Wideband 5V is lean) and I found it easiest to convert to and from a lambda value. The meaningful voltage output range of the AEM is 0.5 to 4.5 and a real narrowband outputs a voltage between a little over 0V and a little under 1V. As such anything over 4.55V input does nothing and stores an error code. Also the narrowband lean setpoint is 0.1V since 0 would probably cause an engine light. The rich setpoint is 0.8V in order to have 0.45V as stoich.

Now to my final questions. Is there a possible failure mode where all the voltage from the car's power circuit goes through the arduino nano and also the mcp4725 to my car's ECU? Also if there is a huge overvoltage, say 100V coming from the car, could all of it pass through to the ECU's analog to digital converter? Should I use a voltage divider to shrink the output of 0-5V from the MCP4725 to the 0-1V range? A voltage divider would limit the amount of overvoltage to the ECU pins, right?

Does anyone have any idea if I need a voltage buffer, will the ADC draw enough amperage to cause MCP4725 to drop voltage? If I use a voltage divider, should I use a voltage buffer before or maybe after it?

Should I add both, either or neither? Any thoughts or maybe oversights I've had? All help is greatly appreciated, I am but a amateur when it comes to electronics. Automotive or otherwise.

Sadly I cannot upload the code yet as I am a new user. Maybe later.

If any one decides to recreate this contraption, do so at your own risk.

TLDR;

Is the first voltage regulator a switching one and does it actually have any protections? Can I test it?

Is my arduino and MCP4725 power system adequate, too simple or too much?

Is there a situtation where all the voltage or overvoltage powering my arduino and MCP4725 passes though to the ECU?

Should I add a voltage divider or a voltage buffer? Maybe both or neither? In which order?

Help is greatly appreciated.

Please provide links to the datasheets of the special devices.

Hello!

As far as I know the aliexpress automotive voltage regulator doesn't have a datasheet, all available info is in the item description available through the link.

LM317 datasheet:

Here's the manual for the AEM gauge containing some details at the end

MCP4725 datasheet:

Not necessarily special in this context, but for completness sake, Arduino Nano datasheet:

I forgot to mention that the ECU is an Mitsubishi Airtrek Turbo R ECU, I assume it uses the same ADC as Mitsubishi Lancer Evolution's. No Idea which one it is, so can't provide a datasheet. I don't think the wiring diagrams I have specify the ADC either, sadly. I only know Evo people have used them for 0-5V devices, so it can handle at least 5v even though usually it only sees a maximum of about 1V. I was hoping that maybe someone would know if a voltage buffer would be necessary in most cases or not.

Check this, it may help, there is a lot more then just 12V and a diode for protection.

Valuable Resources for Automotive Electronics:

  1. STMicroelectronics Application Note AN2689:
    This application note provides guidelines on protecting automotive electronics from electrical hazards, focusing on design and component selection. Reading this will greatly enhance your understanding of automotive circuit protection.
    Read AN2689
  2. Analog Devices: Automotive Electronics Design:
    This article distills key insights into designing automotive electronics, offering practical advice for engineers.
    Read the article
  3. Diodes Incorporated: Transient Voltage Suppression in Automotive:
    Learn about techniques to protect automotive circuits from transient voltage, which is critical for ensuring reliable operation in harsh conditions.
    Read the article
  4. AEC-100 Standards Webinar:
    This webinar from Monolithic Power Systems provides a detailed overview of AEC standards, essential for understanding automotive electronics requirements.
    Watch the webinar
  5. Understanding Automotive Electronics, An Engineering Perspective by William B. Ribbens:
    This comprehensive book offers an in-depth look into automotive electronics from an engineering perspective, making it an invaluable resource.
    Access the book
  6. Check this for OBD ISO9141 Code Meaning & How To Fix

Your first question, yes it's switching step down converter. The chip is not nominated, so for the protection question you need to find out what it is. Visually similar converters with different chips can be found. Does it have any markings?
I don't see much of sense to have LM317 in the middle. Buck regulated to 7V to arduino VIN should be sufficient. MCP can be powered from arduino's regulated 5V.

Thank you very much gilshultz, these were a great read. Especially the first link. There was a lot of things that I couldn't wrap my head around because of my lack of knowledge. I'd have to sink tens of hours to really understand all the calculations that go into engineering a perfect solution. By the way the fourth and fifth links don't work and I don't think the last one really helps with my problems, unless I'm missing something.

What I did gather though is that I should add a TVS before the voltage regulator(s) and at the MCP4725 output. I also stumbled upon this:" TVS Diode Layout Considerations for automotive application - Page 1

So adding a PTC before the TVS in front of the voltage regulator(s) would lower the currents going through it in a overvoltage situation. Would there be any kind of issues with this? What kind of electrical characteristics should the PTC and TVS have? The voltage regulator TVS should at least have nominal breakdown voltage of 27 V minimum and probably as high as possible maximum power dissipation rating, right? The MCP4725 output TVS should probably be some 3.3V TVS (due to abundance) with as close as possible to a 5V clamping voltage. Would some kind of a PTC be useful at the output of the MCP4725 in order to further protect the ECU?

Thank you for your input kmin, the chip doesn't have any markings just like the pictures. Quite strange. Good to have confirmation on it being a switching regulator. I am not going to rely on it having any protections or a clean output, just in case. The LM317 should help with cleaning the signal and also limit the per device power dissipation for longer life of components. It does add a perhaps unnecessary point of failure and I will remove it in case it proves to be a problem. The MCP is powered from arduino's regulated 5V as per my schematic.

I don't remember why I got worried about the supplied power's cleanness, I think it had something to do with reading or outputting correct voltages with my contraption. I think this is what gave me the idea to add a linear voltage regulator after the buck regulator Cleaning a 12v Supply

I would still like to know if it is possible to say for certain if there is a situation where all the voltage or overvoltage powering my arduino and MCP4725 passes though to the MCP output? It should be made impossible by adding the TVS and perhaps a PTC, but out of interest, would something burn up (without any protections on voltage input) before the DAC output would see any overvoltage? Maybe the arduino's voltage regulator?

I am going to try the DAC without a voltage buffer first, but just in case I think I am going to order an op-amp. What kind would I need? The Wikipedia article on voltage buffers didn't go into much detail. The voltage range it would amplify would be between 0-1V.

Yes there is, it's called load dump

Isn't the narrowband lambda between 0.99 and 1.01?

When using this part in a vehicle use the one with the "HV" suffix, it will tolerate a 60V input per T1. I just added this to my list, it is very good" Load Dump and Cranking Protection for Automotive Backlight LED Power Supply.

Ah, okay. Thanks. I wasn't sure if something would burn up before the voltage reaches the DAC. Good Idea to have a TVS at the DAC output lines anyway. Perhaps a PTC.

I think narrowband lambda range is more like 0.98 to 1.02. The voltage range is said to be 0-1V, but really it's something like 0.05V-0.15V to 0.85V-0.95V. I hope I didn't miss speak in my original post.

In my code the lambda range is adjustable. I am planning to try 0.99-1.01 and see if the ECU will keep up. Some wideband Hondas switch between 0.99-1.01 when cruising or at idle in order to have the catalysators work properly. I think it has something to so with one set of catalytic reactions needing excess oxygen and the other set needing excess hydrocarbons.

I am glad you asked, maybe someone will benefit from this knowledge. This is some of the research I had to do in order to create the narrowband converter.

Okay, good to know. I don't think it matters in my case. I am hoping for the TVS (and PTC?) to catch the brunt of the energy. The switching regulator should regulate it down to 10V and they've rated it also for 60V in. Who knows if it actually can take 60V, best case scenario it even has a protection in case input goes over 60V. If the LM317 still burns up, I will just change it. Though at that point I will get the HV one. And I would have gotten that one originally had I stumbled upon it. Thanks for your input

If it handle a load dump

It does. The nano ADC doesn't have enough resolution to distinguish lambda increments as small as 0.01

You must have misquoted. I was saying in my case it doesn't matter if the lm317 is the HV variant or not.

Anyway, the nano ADC is supposed to be 10bit 0-5V, my AEM gauge outputs a 10bit 0-5V signal. That is a resolution of 4.88mV, which corresponds to steps of about 0.0008 lamda. So it should be able to interpret the voltage correctly and via the AEM scaling formula I get the widebands lambda readout accurately. The nano does some calculations and tells the DAC to output a voltage. The MCP4725 has a 12-bit output resolution between 0-5V. That is a resolution of 1.22mV. But since my input is only 10bit, my output can be only 10bit as well, since some of the output values will go unused as the corresponding inputs don't exist. That's my thinking anyway, might be wrong. At 10 bits with voltages between 0.8 and 0.1 (in my case unless I need to extend later)and corresponding lambdas being 0.99 and 1.01, the voltage resolution is 4.88mV which corresponds to lambda value resolution of 0.00014. This should be more than enough since a narrowband acts as a Lean-Rich switch anyway (or so I've read). That being said I am less worried with the resolution and more worried for example what the MCP output voltage settling time might affect

You right. I calculated wrong.

Yeah, this is what has me worried right now. I don't know if I can find a TVS that clamps to about 5V (most probably not 1V) AND can handle the specified electrical hazards. I don't even yet know how to calculate how a PTC might help with taking off stress from a TVS. I am at a loss for now.

The RBO40-40G mentioned in the AN2689 should work for me as a supply rail protection device and for anything where the device can handle 40V inputs, right?

When designing your protection remember the power input wires are inductive but also resistive which will allow you dissipate some energy in them.