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.
