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.

Switching Led

Status
Not open for further replies.
The PDF says in BIG letters "Ratiometric to supply voltage"

Here https://www.ni.com/white-paper/11368/en/ is an article about measuring ratiometric sensors.

So, in an automobile environment where the voltage is all over the map and there are large temperature extremes we don't need a precise reference the works for all voltages and temperatures encountered. We just feed the instantaneous value of the power supply as the reference to the A/D converter.

So, anyway you have a measured value and a setpoint that
s being fed to the PID controller. So, let's say that reference is "rock solid". No temperature effects.

So, now you have this pressure sensor. It only outputs 25 mV, hence the need for the amplifier. There might be some errors there.

The key is, the value of the 12 V supply will change the absolute output. Since that 12 V supply is just that, a nominal supply, it's output may change depending on how cold or hot it is in the garage.

Using a real reference or buffered reference, the odds get better. Better accuracy and better temperature performance.

Now, if the setpoints were ratiometric with the 12 V supply then PID could potentially be more stable, HOWEVER, the actual engineering units would be off. so, your dial would dial the setponts and they could read different, but could be the same even if the 12 V supply moved.
Now if the selected setpoints were from the 5V supply, that's another ballgame. Two things are varying.

So, yea, the "right way" would be to make the A/D reference, a divided 12 V power supply.
That gives you real engineering units. The setpoints because they are not digital would be in engineering units by using a real reference IC.

I'm not going to beat a dead horse and what you have may be perfectly good enough. If your looking for error sources, I'm showing you where to find them.

The engineers tend to look at the "error budget" and quantify what they have designed. so, the IC maker takes some parts and measures them. You use this info to infer a particular performance. Then you measure the actual performance with traceable instruments to some standards bureau that say measure temperature, pressure and voltage.

You might be happy with repeatable to within 5% and this design is better than that one when it's better than 5%.
 
Kiss,
Yeah, I see what your getting at, I have a look at the link you posted.
Thanks for the info in your last post, it certainly will help me find or rule out any errors that I will certainly have.

I noticed you mention that if the "selected set points were from a 5V supply, that's another ballgame".

The set points I have are from a 5V supply, right or wrong, I chose 5V instead of a higher voltage supply thinking that the resistors may be more stable if they were operating cooler?
Maybe it makes no sense but the way I thought about it, I didn't want to have drift issues & used a lower supply voltage & high value resistors to keep the current to a minimum.

Interested to hear what the issues if any arise from a 5V supply?

I mislead you all before, my resistors are 1% metal film resistors, I was thinking about some other carbon film resistors I have that are 5%, sorry about that.

Cheers

********************************************************************************
EDIT: Forgot to mention that repeatable to within 5% would be hard to live with as far as configuring airflow is concerned, 5% could make or break things.

When you get to the stage when you are trying to squeeze the last bit of power out of an engine 5% here or there can kill everything.
Finding big increases in performance is easy straight up but then things become more difficult & the more power you achieve the harder it is to produce more & more.

I will have to test this out properly & correct what needs correcting.

Thanks Again!
 
Last edited:
So, just took a peak at a LM series regulator (who knows what your using) here: https://www.google.com/url?sa=t&rct...uHDK-7j9MtCjWpQ&bvm=bv.74649129,d.aWw&cad=rja

You have the initial voltage or probably what you calibrated with, 4.8 to 5.2 or whatever. Drift is 1 mV/C, ripple is all over the map depending on load up to 100 mV and junction temperature effects.

Those can also be applied to your 12 V? supply.

Now take a look at a reference IC (REF-02): https://www.google.com/url?sa=t&rct...-9M0KfIT3UWPzaCeDX_w69A&bvm=bv.74649129,d.aWw

There is a BIG difference.

It may not be enough to matter, e.g. If the 12 V regulator is basically only powering the sensor. Then your only real effect is regulator temperature. The sensor supposedly is temperature compensated,

All I'm trying to do is make you aware as to where the error sources are.

In some respect, a way to know is to get another sensor and make the output/display ratiometric. Maybe a panel meter with an external reference? In this way, you would have something to compare.

e.g. https://www.google.com/url?sa=t&rct...u9WqPrF8avaX6jQ&bvm=bv.74649129,d.cWc&cad=rja

These meters used to be made by DATEL and now Murata. When i used DATEL meters they were very easy to use. They say to App not 3, for ratiometric applications.

I used them for a 6 channel mass flow meter, We had to calibrate full scale, so there was a switch that either selected the input from the MFC or 5V and a calibrate pot/attenuator and decimal point adjust,

Each MFC required a +- supply and 5V and the cables/connector had all of the required signals. because of the differnential inputs and the way the setpoint was implemented everything worked fin for manual control. When it came to computer control, there were ground loops I failed to anticipate. I was going to fix it with a circuit, but was voted down becaus eof time, so we went with a 4 channel commercial solution,

The box was developed in the first place because, the OEM's box was cumbersome to use. They suppled MFC's calibrated to specific gasses and had displays such as 20, 10, 100 etc set by plug in resistors. We did our own calibrations because we had mixes of gasses. So, my mods attempted to add easy calibration and computer control to an existing in "in house" box.

In another case, I adopted another manufacturer's MFC to our "standard" readout by putting an IC in the connector.

It now looks as if all of the MFC's are obsolete, but that MFC was "SO EASY" to fix and maintain. The parts that dies were the thermal valve and the thermal sensor for the most part. The only controller that had component changes was for Hydrogen.

So, you have a ratiometric sensor with a non-ratiometric output, so any regulator tempeerature effects and ripple will contribute.

You have a reference that uses a different 'regulator", so temperature effects and ripple matter.

You could make a meter with another sensor to track those effects (i.e. read the pressure meter properly) and you would not have to redesign anything. Just maybe add a "tweek control".
 
Kiss,

Thanks again, I really appreciate you pointing out sources of errors & your explanations given.
Obviously I have to study up on just about everything you mention but i'll get there.

I did in fact look at the LM317 & thought I had some here but not so unfortunately, I have some other regulators here as well that may be suitable.

The 12V supply will operate the Pressure sensor, the INA126 with -12v supply as well, the Arduino board etc.

I will have a look at a few things & see what I can do, I don't mind changing things for the better & will look into it now before going any further.

I think I have some digital displays here I may be able to use as well, I' ll have a look.

The plot thickens but it's very interesting & gives me something very worth while to do & learn about.

I'll try to post a circuit when done before building things.

Cheers

EDIT:
I was thinking about this last night & I can use either a rechargeable 1Amp/Hr 12V battery or a car battery for a stable power supply, would this be better?
I'm not really sure if the INA126P can operate on a single supply though?
 
Last edited:
I built a small Adjustable DC Circuit a while back to calibrate some things on my engine dyno, is something like this suitable?
Circuit attached!


Cheers
 

Attachments

  • Adjustable DC.jpg
    Adjustable DC.jpg
    94.7 KB · Views: 187
That supply is better than a car battery. I have an idea, but it's not a perfect solution:

Divide that supply so that 12V (or whatever) is 5V, then buffer it with a x1 Op amp. Use that buffered reference for your setpoint divider.

Just check the 12 V voltage before each test and keep an eye on it. The 5V should be fine, but check that too.

You will at least have a ratiometric setpoint and a ratio metric output. If the voltage is "whatever", then the output in volts will be consistent and correct. The actual pressure setpoints would be as correct as the divider at all voltages.

Reality suggests, that you should build a ratiometric meter to look at the setpoints and output. You may be able to use the same display. Controllers usually allow setpoint, process or deviation to be displayed.

It's probably better if the setpoints read in engineering units anyway.

If you want the Arduino to know the pressure, then:

a) make the 12 V / 5V exact

b) Make the arduino measure ratiometrically. Possible: not sure. If an external reference is possible, then yes and you don;t have to operate the Arduino on the same 5V supply. You just might have to divide and buffer another output like 2.5 V ratiometric reference for the Arduino A/D.

Aside:
The desin has some faults for a "stable" power supply. A Zener diode is not a reference. A 5.1 V zener diode comes close because avalanche and Zener mechanisms occur at the same time. The 5.1 Zener was popular until band gap references came along.

Never drive an OP amp from a High Z source unless it's a buffer or comparator. So, to make that design better, the refermce should be buffered. So, why not use a "buffered reference?
 
Aside:

While we are on the subject of "ratiometric", there is a type of power supply called a tracking power supply. In general, they don't apply the same setpoint to each rail (+ and -), bit rather things like the negative rail tracks tracks the positive rail.

"tracking" is also used in series-parallel supplies as well, where a single control

Advantages are that the output is symmetric around zero and you don't get lop-sided power-up conditions. I believe the Common mode rejection of an OP amp improves too.

I don;t think it has any bearing here. It's just a tid-bit.
 
Thanks Kiss,
I'll give it a go after reading a bit more & post what I have.
Lots to learn & do, no doubt I will have questions!

Time to get busy.

Cheers
 
Would this be a better way to start, I could adjust it for +-10V output which would power the Pressure sensor, INA126 & the Arduino , then go from there for the reference voltages.
See Attached!
To my surprise an outlet in town has the LM317 in stock, I have the other components here if it's ok, can it be improved?

Cheers
 

Attachments

  • Variable Dual Tracking Supply.jpg
    Variable Dual Tracking Supply.jpg
    68.5 KB · Views: 165
The Arduino regulates on the board to 5V, I think, so the +10 or 12 doesn't matter. 10V may be a more convenient number.

I think the way your using the IA, tracking supplies don't matter or matter very little. It depends on what you have, but it takes only a few extra parts to turn it into tracking.

Remember, the bypass caps on the OP amp.
 
Yes, the Arduino Mega 2560 spec sheet says that the recommended input voltage is 6V to 12V or 20V max, I looked at that before doing anything else.

Yes I did forget the Bypass caps?

I think I'll go with the tracking supply as I might need it for something else?

Cheers
 
Yes, I got it, I have never used the Aref pin, basically because I didn't know what it was for.
I normally use the USB Jack but will be using the Power Jack this time when the board is not connected to the computer.

I'll get started.

Cheers
 
So, you get the idea. You scale the power to the sensor and probably buffer and apply it to the Aref pin (within the range expected), then you can read the sensor correctly.

One neat way of doing current limited buffering is to put a series resistor to the output, but take the negative FB from the other side of the resistor. The resistor limits the current, but the voltage is correct. Otherwise, the OP amp is charged with that job and might require short circuit protection.
 
I have the idea, putting into reality might take a while though.

I should have asked about this before but about 3 weeks ago I thought I would order some LM723 IC's for my voltage references & they have finally arrived just now.
On the datasheet (attached) it says the low voltage output is from 2V to 7V, I can live with 2V being the lowest set point being 20" of water & maybe have 5 set points to 40" of water in 5" increments.

What my idea was that if I mount five different value resistors to set the reference outputs to 2.0V, 2.5V, 3.0V, 3.5V & 4.0V by switching a multi position switch it should give me some sort of precision with the set point references.

I only have 1% resistors so my guess is I will need to have five trim pots as well which should make MrAl happier:cool:, just kidding of course, I will still mount them the wrong way though haha!.

Does this idea make any sense, it would have to be better than voltage dividers using resistors.

Is it worth a go & am I on the right track before I go ahead with things?

Cheers
 

Attachments

  • lm723.pdf
    1.5 MB · Views: 351
My head hurts! (for real too - I have the migraine problem (weather and food)

But at the same time I'll call the "thinking out loud" or "brainstorming". Which MEANS take everything with a grain of salt INITIALLY or let's put all of the toys in the toy box. I'm purposely ignoring the 723 question.

I kinda need to figure out what the deal is. Let's switch gears 180 degrees for a moment.

So, let's say the Arduino can measure the value of the sensor ratiometricly which I believe is the "RIGHT" way. It MAY not be the same as a "process controller" with a setpoint and measured value inputs depending on implementation.

maybe the POT thing is totally old school. So, the goal is 5 setpoints. These can be "exact" and don;t need to be ratiometric. Only the sensor does.

WHY Bother?

Is it important to be able to vary them "on the fly"? If it's not, why not use a BCD switch to select up to 0-16 setpoints that are defined digitally in your program? i.e. IF (bits 0-3) = 1 then x in of water etc.

No references, No drift, Nothing. You just don;t have that "knob".

At the same time, it could be possible to use one position as "manual" (not saying I know how yet).

I'm just bouncing ideas.

So far, I think there is a good handle on:
Power supply for IA, sensor, processor.
Reading the sensor ratiometricly using the Reference pin. (just buffer the divided sensor power)

Can you live with 10-16 setpoints that you have to reprogram the controller to change them? Use an external meter with an external reference to read the actual value like we talked about before or even spit it out on a cheap "display" (undefined for now)

Basically this **broken link removed** (10 pos), but usually available for 16. Rotary switches work too.

or some version of this: **broken link removed**

There is the push button version, the fingernail version and the lever version. Dunno which are available. Where I worked, we had a lever version which made it easy and fast to change the values.

Some may go to 16. 0-9, A-F. There are complement versions.

Tried to stay focused on a concept.

ASIDE (723): Note the buffered reference and the temperature compensated Zener or what the supply you built is lacking.
 
Is it important to be able to vary them "on the fly"? If it's not, why not use a BCD switch to select up to 0-16 setpoints that are defined digitally in your program? .

Ok, I'm all for taking a backward step & looking at the situation.

No, there is no need to vary the set points on the fly, I have some BCD Thumbwheel switches that are easy for me to operate, I have the same switches on my dyno controller.
https://www.altronics.com.au/p/s3300-0-9-bcd-mini-thumbwheel-switch/

I don't know how to use them yet, I bought them to try to select rpm levels for the eddy current brake PID I attempted before.
I think your ideas are great, but my lack of programming & electronics knowledge is a hindrance to me, I am prepared to give it a go though.

Can you live with 10-16 setpoints that you have to reprogram the controller to change them?

All I actually need is 5 setpoints as I never use any more than 5 different pressures for testing, but could use more if available say to use up the full range of the BCD switch.
I'm not sure if this is possible but say we were to use No:1 on the BCD switch as just a low pressure setting or low motor rpm setting to get things motivated or a low pressure test mode to check calibration maybe, then use numbers 2 to 9 as pressure set points & 0 for the manual setting. That is ample & more than I would ever require.

Reprogramming the controller is no issue either & I have given some thought to that already, for instance say I was to program in X number from the power Byte map in the sketch = 20" water etc. Just like having single static settings, once calibration is done knowing what setting equals how many inches of water it wouldn't be a problem.

Reading the sensor ratiometricly using the Reference pin.

Still getting a handle on this one but give me time, lots to read & understand yet.

The only reason I was going to use set point voltages is because I know how to get the Arduino to read them already.

Cheers
 
1 & 3: I'll come back to 2.

BCD switches

You should have 5 pins, 1 common and 4 other pins. The positions of interest initially are the settings for 1, 2, 4 and 8. You will then find one of the pins connected to common or "all but one pin" connected to common. The first is BCD and the second is BCD complement. Sometimes both outputs are available. So, get your ohmmeter out.

Generally, you would "pull up" the the (1,2,4,8) weightings to the logic supply of the processor and connect the common to ground. In the complement set up for a 1, you would see, 0,0,0,+V for the ports or 0001. For the non-complement, 1110, just the reverse of the switch. 6 bits can count from 0-15. 0000 through 1111 with weights of 8, 4, 2, and 1.

==

Analog IN.

Reading an input ratiometricly means just changing the reference and your effectively reading the fraction of full scale which can be in Engineering Units. e.g. 1/1024 * FS

#2 (Manual)
I was thinking about using say another 2 or 3 BCD switches for the manual setpoint. How many digits would you need for engineering units? 2 would give you 0-99% which isn't an engineering unit. The reads should be able to be multiplexed. 4 inputs and say 1 output per digit or less. 2 bits could do 4 digits with some logic.

I think you only need xx.x maximum.

Analog would probably require some sort of display, but not necessarily.

Another ides would be to use a rotary encoder. You get about 12-24 clicks per revolution. Can be lighted with two colors and also contains a push button.

So, you could call it, "digital setpoint" +- Tweek, no matter what the setpoint is.

Full setpoint from a rotary encoder might be difficult to do from a software point of view. I can explain if necessary. It depends on the range of the setpoint and the # clicks per turn. If the max was 1000, then 1000/16 is a lot of turns, so there are other ways.

Aside: Rotary encoder breakout: https://www.sparkfun.com/products/11722 From there see the clear knob and the encoder itself.
 
Last edited:
Assuming the logic family selected is correct, and the supply is correct, then a tri-state buffer can be used. https://www.ti.com/lit/gpn/cd74hct125
The enable would float high so, they would be in the high Z state until the I/O pins got configured.
You would basically use a 4x SIP (probably 10K or so) pull up on each BCD switch. (8,4,2,1) and then another bit per digit to select which digit to read.

You can also use a multiplexer "such as" https://www.ti.com/lit/ds/symlink/sn74lvc138a.pdf to convert 3 bits into 8 or sometimes 4 bits to 16, so 8 bits of the uC could read 16 BCD switches.
 
Last edited:
Just got back, went to the big smoke to buy some components.

Ok, obviously I'll have to read & chew on your last two posts before I can even think about commenting on them, it's like everything, it's easier if you know about things but when you don't it's not so easy.
I'll have a good read & study some things, it all sounds good though.

Give me a little time & i'll see how I go.
There are a few things I need to get a handle on, or I should say a lot of things.

I'll be back!

Cheers
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top