Suggestions for 0-5V variable output

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After playing with AVRs a little previously, I'm looking to start prototyping my first real project. I'm wanting to take a given 0-5V signal, run ADC on it in order to find the voltage value, and output a modified 0-5V value based on my own programming.

Does anyone have any suggestions about how I would go about doing this? I'm weary of using PWM because it's outputting voltage to another microcontroller that uses its own ADC, so I need to have the output to be stable and fairly accurate.

Thanks!

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

Sorry, should say this is for a 28-PDIP Mega48.

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

OK, I'll bite
Is your 5v signal 0-5vdc?
What do you mean by 'modified' 5v signal?
Are you looking to take a 0-5vdc signal and 'modify' it to a PWM output?

Please be more specific

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

If you don't use PWM (and I don't know why you wouldn't) then the only other answer is an external DAC. What are your specs on this "modified" signal?

Go electric!
Happy electric car owner / builder

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

Yep - 5V incoming signal is 0-5VDC, output signal is 0-5VDC. Specifically, this is for an Engine Control Unit (ECU) that uses a sensor that returns a changing 0-5VDC value based on physical change.

I want to process the signal mathematically, and generate my own 0-5VDC signal based on my own set of variables. Most simply, the system would be designed to limit the maximum voltage output to the ECU at 4.3V, but I'd like to add other features to the system as well.

Is it possible to generate a steady 0-5VDC signal with PWM? I'm pretty new to electronic design and I'm no engineer, so any help is appreciated. If nothing else, an external DAC with VOUT that I can drive through the SPI might work.

EDIT: Can a stable voltage be produced by controlling a MOSFET via PWM?

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

As sgomes is a happy electric car owner, let me ask this question: Which parameter do you wish to change? Throttle, air-flow, turbo-pressure ?? Reason I ask is the response-time that will be one of the parameters for the design.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Let me guess, it's for reading the air-flow signal from a MAF sensor?

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

LOL @ Nard... gee thanks. But hey! My THROTTLE is a pwm signal!

Go electric!
Happy electric car owner / builder

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

Psychlow,

See attached schematic for an easy way to take an 8 bit output from an AVR and turn it into an analog voltage using an R2R resistor array.

If you would like part numbers, etc for anything, let me know and I will see what I can do.

Regards,
Paul

Edit: The inputs to the op-amp are reversed. But for your application, you may not even need one.

Attachment(s): 

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

Thank you all for your help so far. pkafig, I'll be looking at that circuit in-depth!

fleemy is very close - it's for reading and modifying the boost reference sensor ("MAP sensor"). The ECU in question likes to throw the car into a "limp mode" if it sees more boost pressure than it comes programmed for from the factory, and being performance-minded, we're not too keen on that idea.

The MAF sensor and a few other sensors control the amount of fuel that is injected, and (at least at this point) I don't intend to modify the values on those. I just want the ability to slope the MAP sensor values as I please to keep the ECU from realizing we're trying to exceed factory boost specifications.

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

You could clamp the signal with a zener diode... So your making some kind of a piggy-back system?

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

Exactly, fleemy. I've tried .5W 4.3V Zener diodes, but I haven't had much luck, unfortunately. They work great for a short time (a few miles), but that's it. The last attempt was two wired in parallel, thinking that the diodes just couldn't handle the amount of reverse current, but those have failed me as well.

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

I am not that great in electronics but, I think you should put a resistance in series on the output coming from the sensor, and then put the zener diode, to limit the current (and to save the sensor). Maybe Plons could help you more.

But that will only clamp the signal to the specific value of the zener diode. If you need different values through the dynamic range of the sensor(e.g. you changed the spring on the waste gate, but the ECU expects a preset value and doesn’t get it), you will need some microprocessor power.

Last Edited: Mon. Sep 17, 2007 - 10:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fleemy wrote:

Quote:
I think you should put a resistance in series on the output coming from the sensor, and then put the zener diode, to limit the current (and to save the sensor).
The nail on the head ! If the max. output of the sensor is 5V, you'd need a resistor of 100 ohm (4.3V zener, 400 mW ---> 90 mA max, (5 - 4.3V)/0.09, some safetymargin, 100 ohm will do) . In general, ECU's don't put a heavy load on sensor outputs.

I also agree with the rest of fleemy's post.

Cheers

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Here's the funny part - I removed the pigtail I made from my shunt circuit last night, and they haven't failed. When Zener diodes fail, they tend to short (or at least resistance goes to less than 100 ohms). They are still reading about 300K ohms when measured with a multimeter, which is what they read straight out of the package. Is it possible that without this inline resistor, the diodes just can't shunt enough current to prevent voltage from rising?

This is an image of my current circuit. These are two 4.3V zener diodes. Somehow, values above 4.3V are STILL making it to the ECU.... any ideas?

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

Quote:
When Zener diodes fail, they tend to short
Indeed that's what most likely will happen.
Quote:
They are still reading about 300K ohms when measured with a multimeter
Unfortunately you cannot measure a zener of 4.3V with a multimeter. Okay .... you can, but the results are meaningless.
Find a 9V battery,

plus battery ---- resistor 1k ----- (c) zener (a) ----- minus battery
                                ^                    ^
                                |                    |
                                 -------- MM --------

you should read 4.3V .... and 0.7V when the zener is reversed ;)

Nard

Attachment(s): 

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

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

Great coincidence I am making a piggy back fuel management unit too.

http://www.14point7.com/UAFC/UAF...

Just use PWM to a RC filter then use an op amp in the voltage follower config to buffer the signal. That is the most practical way. No point spending lots of time to worry about small things like this when the noise from all the electronics in the car will throw a monkey wrench into your effort.

There really is not problem with using pwm to RC filter, that is how 99% of people get 0-5v output from the atmega88.

I do not think clamping the signal will do you much good, once the signal is clamped your ecu has no way to add extra fuel. Unless you are doing something else to give more fuel (extra injector, FMU, methanol injection, etc...) you will likely blow up your engine. For modest boost increase I think using a Rising rate fuel pressure regulator along with a piggyback would work pretty well, the fuel pressure regulator should add more fuel and you would use the piggyback to add and subtract a small amount to tighten up your AFRs. Or you can run larger injectors and use a piggyback to scale down your MAP voltage to account for the larger injectors, but the larger your injectors the more you will have to scale you map voltage down and the more the ecu will advance your timings, this makes detonation much more likely and makes your car buck like a bronco.

Oh yeah, buy a wideband reader to find out your AFRs before you start tyring to put a limiter on your map voltage, if you car is already running close to lean then limiting the map voltage will detonate your engine.

Regards,

Alan To

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

Alan, you're obviously a lot further ahead than I am. Looks like you're already to market with yours!

With these particular vehicles, the MAP sensor really isn't a "MAP sensor" at all - it's just a boost reference sensor that tells the ECU how much pressure is in the charge piping. It's not used for fuel mapping - the ECU uses wideband O2, mass-air and load to determine injector pulse. Clamping of the MAP sensor does work - it's just a matter of making it work reliably, as well as possibly adding my own tweaks.

Plons, thank you for those diagrams. I'll give those a try.