Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

analog to digital circuit assistance

Status
Not open for further replies.

qsiguy

Member
I'm experimenting with the O2 sensor in my vehicle and need a little advice on a circuit.

I need a simple circuit to take a 0-1vdc analog signal and convert it to a digital output. I need to be able to adjust the switching point anywhere in the 0-1vdc range and I may need to be able to set the output voltage to be anywhere in the 0-1vdc range. So basically as my input voltage changes if it goes above .4 volts (for example) I want the output to switch from 0 to say .6v and stay there even if the input voltage goes up to 1 volt. I'm not sure I need to be able to adjust the output voltage or not at this point but I know I just need an on/off output of around .5v and I want to be able to offset the O2 signal a bit so the output turns on at varying input voltages.

I believe this is a simple op amp circuit. I would appreciate it if someone already has a diagram for this and would post it. I know of several circuits that accomplish the O2 sensor offset but I want to go about it a little differently.

Thanks for your help.
 
Are you trying to produce a digital signal? Or "clamp" the analog output?

If it's digital...
A comparator with the - terminal connected to a DAC (or potemtiometer as a resistive divider to provide an adjustable voltage reference) should do the trick. This will produce a digital output based on a threshold set by the DAC.

But you also say you want to be able to adjust the voltage level the output? So that you can vary the HI voltage? YOu want the threshold between HI and LO to be 0.5V though? THat's really low...and is well within what is considered a LO for most logic level schemes. You may need to use a resistive divider to step down the digital output voltage of the comparator with a resistive divider (which then might need to be buffered by a voltage follower op-amp).

Is there an actual reason you want to go about things a bit differently? Are the other methods defficient in some way for your application?
 
Last edited:
The output will be digital so your comparator option looks right. If I don't control the output what will it be? Lets say I set it to switch at .6 volt input, what would the output be? Would the output be the same as the set point?

The reason I'm doing it differently is that the typical circuits offset the voltage a bit so the ECU sees .6 volts or so when the O2 sensor is reading .5 volts so the ECU will lean out the fuel a bit as it thinks the exhaust is richer than it is. When you add fuel supplements like propane, water injection, hydrogen, etc the exhaust normally appears leaner to the ECU so it adds fuel killing your economy. The circuit I'm considering should work as well or better than the others because the ECU is only looking for a digital on/off signal anyway and it should be easier to alter the trigger point for the output with the comparator circuit. The other circuits seem to have stability issues as well and a difference of .1 volt can make a difference.
 
It depends on the type of technology and the voltage you are running it at:
http://www.interfacebus.com/voltage_threshold.html

If it's digital, then why do you need the output to be 0.6V? What are you feeding it into? Some more circuitry? Or some device? If it's circuitry it shouldn't matter...just choose a comparator that's the compatible with the technology of the circuit you are feeding it into. Why do you need to vary the output HI voltage?
 
Last edited:
I'm not sure yet if I need to be able to adjust the output voltage. The signal will go to the vehicles ECU which see's a voltage from 0-1v based on the level of oxygen in the exhaust. It will probably need to be about .5 volts but I need to test it to be sure. The input is primarily what I want to be adjustable. Lets say I want the vehicle to run a little lean. I will want the comparator to switch on the output at around .4-.45v. Normally the ECU want's to see about .5v from the O2 sensor to indicate "stoich" which is about 14.7-1 air fuel ratio and where the ECU tries to keep the mixture at. The richer the mixture the higher the voltage will be on the output of the O2 sensor. If I switch the output at a lower voltage the ECU will be fooled to think it's actually at stoich and won't try to add fuel.

What Op Amp chip would I want to try for this? It's in a car so I have a ~12VDC system but I can build in a voltage regulator and provide any voltage to the circuit I need. The input signal will be 0-1V analog tho.
 
Last edited:
From what you have described, this should work.

EDIT: changed schematic 12/12/07.
 

Attachments

  • O2 sensor threshold and level shift.PNG
    O2 sensor threshold and level shift.PNG
    21.5 KB · Views: 225
Last edited:
Is this a circuit you put together based on what we've been talking about or one you already had? Looks like you just made this per my spec's. Very good either way. I will give it a try. Thank you very much.
 
qsiguy said:
Is this a circuit you put together based on what we've been talking about or one you already had? Looks like you just made this per my spec's. Very good either way. I will give it a try. Thank you very much.
I just drew it up based on what my understanding is of your needs.
 
What purpose does the 12V sener serve?

Over-voltage protection?

I would increase it to 15V so it doesn't conduct continiously and consider reducing that 220R to 47R.
 
Hero999 said:
What purpose does the 12V sener serve?

Over-voltage protection?

I would increase it to 15V so it doesn't conduct continiously and consider reducing that 220R to 47R.
Yeah, the zener is there because automotive supplies are notoriously noisy. You're right - 15V would be better.
The circuit only draws about 6mA max, 4mA typical (unless the ECU input resistance is really low, which I doubt), so the 220 ohms will drop 1.3V or less. Changing to 47 ohms will allow the circuit to work when the battery voltage is a low as ~8V, vs around 9V with 220 ohms. I considered this, but used 220 so the input cap would filter more effectively. It would be simple to use 47 ohms, and a higher value cap if needed.
Battery voltage is generally only low when starting, and I suspect the ECU overrides the O2 sensor during starting anyway, so if the circuit only works when the engne is running, it's probably not a problem.
 
Thank you for the input Hero. I appreciate any input you guys have. I have a little new information to run by you guys. I looks like what I want on the output is a high and low "binary" on/off signal. High around .7 volts and low around .25 volts or less. With this circuit what will the low state of the output be? I know I can adjust the high level but may need to keep the low state over 0 volts.

Regards to the zener...so you guys are in agreement that it should be changed to 15V?
 
qsiguy said:
Thank you for the input Hero. I appreciate any input you guys have. I have a little new information to run by you guys. I looks like what I want on the output is a high and low "binary" on/off signal. High around .7 volts and low around .25 volts or less. With this circuit what will the low state of the output be? I know I can adjust the high level but may need to keep the low state over 0 volts.

Regards to the zener...so you guys are in agreement that it should be changed to 15V?
The output won't be below zero, but it will be damned close. Why do you think that's a problem?
Change the zener to 15V.

If you want the adjustments to be noninteracting, it'll cost you big bucks. :D
Either that, or one of the other guys will do it for free.:eek:
 

Attachments

  • O2 sensor threshold and level shift1.PNG
    O2 sensor threshold and level shift1.PNG
    25.9 KB · Views: 143
Last edited:
Apparently the ECU recognizes OFF at ~.25v and ON at ~.7v and the voltage level in the middle is irrelevant. Your circuit should allow me to do some experimenting now. It looks like pretty much exactly what I will need. Now I just need to try it and see if the ECU will react as expected. I can read the exhaust with my wideband O2 sensor as I tweak the OEM narrowband O2 sensor/ECU and see how the A/F ratios change. Hopefully it will allow me to lean it out a bit as that the ultimate goal of this. I guess if it works it would also make it possible to enrich the mixture as well.
 
Maybe you've seen this, but in any case, you should read the section "How does an O2 sensor work?". Unless your car is different, it appears that the 0.45V midpoint voltage is important until the sensor warms up. I can't imagine this would take long, but it might make for hard starting (or no starting) if you don't have it.
I don't think you need a low voltage set point, but I could be wrong. I was once before. :D
 
The ECU ignores the O2 sensor until it's warmed up. Thank you for the link. I do understand how the O2 sensor works. My experimentation is based on how the ECU reads and evaluates what it's getting from the O2 sensor. I'm sure it most likely varies from car to car slightly. The sensor never sits at a set voltage for long when it's operating properly. The ECU looks for this high/low state and averages it, I believe, to determine lean/rich state. I just want to offset the switch point a bit. If it gets offset too much it will go into open loop and run rich but if I can offset it by just a bit i should be able to get the vehicle to lean out and stay in closed loop. Once this is achieved I can attempt to tweak the other sensors the ECU reads from like the intake air temp sensor and the mass air flow meter.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top