Shop OBEX P1 Docs P2 Docs Learn Events
Voltage correction circuit — Parallax Forums

Voltage correction circuit

racecarguyracecarguy Posts: 2
edited 2007-03-07 16:46 in BASIC Stamp
I need to do the following:
Take input voltage (0 to 5v) and make a voltage adjustment to it.· i need to have a look up table, because there is no trend in the voltage compensation.

Logic,ie

take input voltage(var A). compare input voltage to column 1, find adjustment value in column·1 ( var B)·(interpolate if necessary) add set C = A+B, and output C.· This table might take alot of work to get right (trial and error) so it needs to be relatively easy/fast to make changes.

I have a basic 1 that I have had for like 10 years now. I dont mind buying different hardware. I am an ME with little electrical experience, and some programming experience.·
Current is low, this is the signal wire on an airflow meter on a car.· I am hoping that parallax offers an easy solution for measuring and then outputing accurate voltages (thinking +-.01 approx). The logic/programming is pretty easy. I've done similar things 100s of times in Matlab.
Thoughts/reccomended hardware?

Thanks!

ALTERNATE:
I would like to read RPM (sine wave I would guess, maybe a square wave from the cam sensor) and add the voltage to the airflow sensor in relation to RPM.· This is the final result I want, but I can correlate airflow with RPM (roughly) so the first solution allows me to tap into less parts of the car.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-05 23:09
    Hello,

    ·· It sounds relatively straightforward and shouldn’t be too much of a problem. You will need a DAC to output the new analog voltage. I can refer you to two examples which are written for the BS2, but may offer help on two aspects of what you need to do. One is a lookup table for ranges of voltages. Our thermocouple code examples (first link) can somewhat illustrate that idea for you. The second is interpolation. One example we have was for the Sharp GP2D12 Sensor which can be found at the second link. I hope this helps. Take care.

    http://www.parallax.com/detail.asp?product_id=28022

    http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv114.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-03-06 16:56
    Here is another link on table lookup and interpolation:

    www.emesys.com/BS2math3.htm#interpolation

    For the input you need an Analog to Digital converter, and for the output you have a a DAC. There are quite a few examples avaialble for different types.

    0.01 volt / 5 volt is one part in 500, so that calls for something like a 10 bit (or better) conversion.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • racecarguyracecarguy Posts: 2
    edited 2007-03-07 13:56
    the programming logic doesnt scare me, its the hardware. Fortunatly I have some PHD level EEs here at work i can tap if they can find a minute ( idea.gif )

    Thanks for the information. Makes sense, ADC,stamp,DAC.· Wish I paid more attention in Digital Circuits back in college!

    I am assuming when I order my stamp, Parallax can point me in the right direction for a 10bit DAC that can do what I need it to?· Looked at some DAC·white papers·and it seems pretty straight forward. Looking forward to learning some new things! burger.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-07 14:52
    Hello,

    DACs are one thing we don’t carry (We do have a few ADCs) and something that is usually chosen specifically for the application. I’m not sure anyone here has a running knowledge of enough DACs to point one out for your application, but if you post the specifics here I’m sure you’ll get enough input to help you choose one or at least a place to pour through the datasheets. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-03-07 16:46
    You might as well go for a 12 bit DAC and 12 bit ADC. Then you will have bits to spare. The DACs I've used and have code for are the TLV5618, the MAX5722. TI and Maxim will send you a free sample of their parts to get you started.

    Parallax carries the LT1298 ADC, a 2 channel 12 bit device.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.