hi sir i need one help now iam doing project on 89c51 using C51 Evaluation Software i converted 0-5 analog volatge to 0-5 digital voltage . now i want convert digital data to pressure my output should be like this 0v 1.1E-1 3v 4.1E-4 0.1 1.2E-1 4v 5.1E-5 1v 2.1E-2 5v 6.1E-6 2v 3.1E-3 i want 500 values in between 0 to 5 volts how to calibrate the voltage interms of preesure what logic i want use to convert Voltage to pressure my C51 not taking floting oparations please help regards chandra sri
"i converted 0-5 analog volatge to 0-5 digital voltage" What do you mean by that? What is a "digital voltage"? "now i want convert digital data to pressure" Then you need to know the relationship between your sensor's output and the measured pressure: If it's linear, this is simply a matter of scaling (plus, perhaps, an offset); If it's non-linear, a lookup table is probably easiest. "my output should be like this 0v 1.1E-1 3v 4.1E-4 0.1 1.2E-1 4v 5.1E-5 1v 2.1E-2 5v 6.1E-6 2v 3.1E-3" I have no idea what that's supposed to mean - please explain! "i want 500 values in between 0 to 5 volts" So, you have a range of 5V in 500 steps; therefore the step size is simply one-fivehundredth of 5V; ie, step size = 5V/500 = 0.01V "how to calibrate the voltage interms of preesure" Apply known pressures across the range of interest, and measure the corresponding voltages! "my C51 not taking floting oparations" Of course not - it's the evaluation version! Instead of using 0.01V, just think of it as 10mV (or whatever) - then there's no decimals required!
Hello, this is Swananda from India. Couls you please help me by sending on how to program the 89C51 in C/C++ to interface the At24C04(External Memory).
if you do not like the replies, do you really think you are going to get something more to your liking by posting in unrelated threads?
Erik
thank you sir sir here my preesure sensor output is 0-5v caresponding pressure is 0.00v=1.1E-1 5.00v=6.1E-6 now i want scale the intermediate values example voltage pressure 0.00v =1.1E-1 0.01v =1.2E-1 0.02v =1.3E-1 . . 1.00 =2.1E-2 . . 2.00 =3.1E-3 . . 3.00 =4.1E-4 4.00 =5.1E-4 5.00 =6.1E-5 This is the data the relation between pressure and voltage is non-linear I did't have any relation. I have only above data. thanks
What are the units of pressure here? The data shows that your sensor gives a higher voltage output for a lower pressure - is that right? "I did't have any relation. I have only above data." Surely, that data is the relationship! Just use it as a lookup table!
hi sir "The data shows that your sensor gives a higher voltage output for a lower pressure - is that right?" yes sir it well gives a higher voltage output for a lower pressure. thes values iam taken from standard chart. now i want convert this chart to application. if you do't mind how to use the look up table for 500 values. Here iam using c51 evalutionn vertion pleace give one example. pleace sir
You still haven't said what unit of pressure you're using - bar? atmosphere? mm of water? mm of mercury? Pascal?
"You still haven't said what unit of pressure you're using - bar? atmosphere? mm of water? mm of mercury? Pascal?" sir iam using Bar
If you work in units of mV and uBar, there is no need for fractions:
Voltage Pressure 0mV =110 000 uBar 10mV =120 000 uBar 20mV =130 000 uBar : 1000mV = 21 000 uBar : 2000mV = 3 100 uBar : 3000mV = 410 uBar : 4000mV = 51 uBar : 5000mV = 6 uBar
"how to use the look up table for 500 values." The number of values merely dictates the size of the table. Here's a brief overview of how to use a lookup table to implement a mathematical function: http://www.8052.com/forum/read.phtml?id=22213
hellow sir sir iam very very happy with your replys sir here this data iam taken from a standard table here my job is simply display the preesure for caresponing input voltage here units are not impartent. just i want display the pressure on display like 0.00v =1.1E-1 0.01v =1.2E-1 0.02v =1.3E-1 . . 1.00 =2.1E-2 . . 2.00 =3.1E-3 . . 3.00 =4.1E-4 4.00 =5.1E-4 5.00 =6.1E-5 thank you regards chandu
"my job is simply display the preesure for caresponing input voltage" If it's purely for display purposes. maybe strings would be best:
unsigned int voltage; // In units of 10mV char pressure_string[] = { "1.1E-1", // Index 0 corresponds to 0mv "1.2E-1", // Index 1 corresponds to 10mv "1.3E-1", // Index 2 corresponds to 20mv : : } printf( "Voltage %u mV = Pressuse %s", voltage*10, pressure_string[voltage] );
thank you sir i tried this program but iam getting one error #include<stdio.h> #include<reg51.h> #include <string.h> void main() { unsigned int voltage; char pressure_string[2] ={"1.1E-1","1.2E-1","1.3E-1"}; voltage=0x0A; /*10mv*/ SCON = 0x50; TMOD |= 0x20; TH1 = 221; TR1 = 1; TI = 1; printf( "Voltage %u mV = Pressuse %s", voltage*10, pressure_string[voltage] ); } iam getting this error compiling forum.c... MAIN\FORUM.C(8): error C243: 'array[]': string out of bounds main\forum.c - 1 Error(s), 0 Warning(s). sir how much memory well take for 500 values of the look up table regards chandu
sir char pressure_string[] ={"1.1E-1","1.2E-1","1.3E-1"};