Newby ? - mega2560 and Ethernet shield to read (3) 1-5v inputs into desktop app

I have 3 pressure sensors (outputting 1-5v) on 2 filter units (for dp readings), and I am thinking of using the mega 2560 and an Ethernet shield to display real-time data on my PC through my network on a desktop app. Have programmed with basic, but that's about it... I am familiar with setting up network devices. Doable? If so, which existing code for vb would be most helpful for me?

Thanks very much,
Arlian

You need to post the datasheets for the sensors and links to vendors that sell them before anyone here can help you.

The sensor specs are not where my deficiencies are. The pressure sensors are linear output 4-20ma and I'm using a 0.01% 250 Ohm resistor to convert to a 1-5V input to the board. 1V correlates to 4ma, which is 0 psig and 5v correlates to 20ma, which is 100 psig.

Since my programming is a bit lack-luster to put it kindly, I am wondering which modules, etc. I will need to use VB to communicate via the ethernet shield and get data samples on the inputs to the board. My goal would be a simple window I can pull up and view dp1 and dp2 where dp1=p2-p1 and dp2=p3-p2.

Thanks for your help.

Regards,
Arlian

I have 3 pressure sensors (outputting 1-5v) on 2 filter units (for dp readings)

And "dp" means what ?

5v correlates to 20ma, which is 100 psig.

That's 10.23 analog counts per psig.
What is the nominal operating pressure for the "dp" (whatever that is) ?

My goal would be a simple window I can pull up and view dp1 and dp2 where dp1=p2-p1 and dp2=p3-p2.

I don't see any mention of a windows application to do this. How does this relate to arduinos ? Are you asking us to recommend a windows application to view or is the "simple window" you refer to the Serial Monitor ?(that is a "simple window, if that is the
criteria you are specifying)

I have Visual Studio Pro, but do not know much about it. So, assuming I can use this to do all of my programming, that is what I would use.

dp is delta pressure or pressure drop across each of the filters. This will tell me when the filters are starting to get clogged, as the drop goes too high. ex: 2psi may be normal when the filter is new at a certain flow rate, but 10psi would indicate it is clogging up at the same flow rate.

I would have 3 pressure readings. p1 (incoming pressure to first filter), p2 (between filter 1 and filter 2) and p3 (downstream of filter 2). The difference between p1 and p2 would be dp1 (pressure drop for filter 1) and the difference between p2 and p3 would be dp2 (pressure drop for filter 2).

In instrumentation, a common practice is to convert loop power 4-20ma signals to voltage by placing a high-tolerance 250 ohm resistor in line withe the return (-) wire of the loop from the sensor. Sense the signal is in current, you can use V=IR to convert to a voltage signal. This is what I am doing here.

So 100psi/1024 = 0.098psi/count which is OK for my purposes given that I am only concerned drops in the whole number magnitude.

So my app would need to read the counts, do a little subtracting, and then convert to psi as I (the non-programmer) see it.

I apologize for not being more clear about what I need. I think my main deficiency is the absolute lack of knowledge on how the arduino and the shields work, especially over ethernet. I am assuming I will assign a fixed IP for the ethernet shield and my read commands will address the ip each time I call it. That's about where I stop with regard to how to make this thing happen.

I was hoping there may be some bits of code that I could piece together and with a little learning curve, I could get it to work and learn something at the same time.

Thanks for any help you can offer.

Arlian

I could use some guidance using Visual Studio to connect with the Mega 2560 with ethernet shield. The rest of what I am doing is pretty simple, just reading in (3) 1-5v signals and doing some math to get pressures.

Any help is appreciated.

Arlian

Arduino server code that displays the arduino analog pin values in a web page.

// zoomkat's meta refresh data frame test page 8/17/13
// use http://192.168.1.102:84 in your brouser for main page
// http://192.168.1.102:84/data static data page
// http://192.168.1.102:84/datastart meta refresh data page
// for use with W5100 based ethernet shields
// set the refresh rate to 0 for fastest update
// use STOP for single data updates

#include <SPI.h>
#include <Ethernet.h>

const int analogInPin0 = A0;
const int analogInPin1 = A1;
const int analogInPin2 = A2;
const int analogInPin3 = A3;
const int analogInPin4 = A4;
const int analogInPin5 = A5;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // arduino ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port
unsigned long int x=0; //set refresh counter to 0
String readString; 

//////////////////////

void setup(){
  Serial.begin(9600);
    // disable SD SPI if memory card in the uSD slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  server.begin();
  Serial.println("meta refresh data frame test 8/17/13"); // so I can keep track of what is loaded
}

void loop(){
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
         if (readString.length() < 100) {
          readString += c; 
         } 
        //check if HTTP request has ended
        if (c == '\n') {

          //check get atring received
          Serial.println(readString);

          //output HTML data header
          //client.println("HTTP/1.1 200 OK");
          //client.println("Content-Type: text/html");
          //client.println();
          
          client.print(F("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"));

          //generate data page
          if(readString.indexOf("data") >0) {  //checks for "data" page
            x=x+1; //page upload counter
            client.print(F("<HTML><HEAD>"));
            //meta-refresh page every 1 seconds if "datastart" page
            if(readString.indexOf("datastart") >0) client.print(F("<meta http-equiv='refresh' content='1'>")); 
            //meta-refresh 0 for fast data
            if(readString.indexOf("datafast") >0) client.print(F("<meta http-equiv='refresh' content='0'>")); 
            client.print(F("<title>Zoomkat's meta-refresh test</title></head><BODY>
"));
            client.print(F("page refresh number: "));
            client.print(x); //current refresh count
            client.print(F("

"));
            
              //output the value of each analog input pin
            client.print(F("analog input0 is: "));
            client.print(analogRead(analogInPin0));
            
            client.print(F("
analog input1 is: "));
            client.print(analogRead(analogInPin1));
                        
            client.print(F("
analog input2 is: "));
            client.print(analogRead(analogInPin2));
            
            client.print(F("
analog input3 is: "));
            client.print(analogRead(analogInPin3));
                                    
            client.print(F("
analog input4 is: "));
            client.print(analogRead(analogInPin4));
            
            client.print(F("
analog input5 is: "));
            client.print(analogRead(analogInPin5));
            client.print(F("
</BODY></HTML>"));
           }
          //generate main page with iframe
          else
          {
            client.print(F("<HTML><HEAD><TITLE>Zoomkat's frame refresh test</TITLE></HEAD>"
            "Zoomkat's Arduino frame meta refresh test 8/17/13"
            "

Arduino analog input data frame:
"
            "&nbsp;&nbsp;<a href='/datastart' target='DataBox' title=''yy''>META-REFRESH</a>"
            "&nbsp;&nbsp;&nbsp;&nbsp;<a href='/data' target='DataBox' title=''xx''>SINGLE-STOP</a>"
            "&nbsp;&nbsp;&nbsp;&nbsp;<a href='/datafast' target='DataBox' title=''zz''>FAST-DATA</a>
"
            "<iframe src='/data' width='350' height='250' name='DataBox'>"
            "</iframe>
</HTML>"));
          }
          delay(1);
          //stopping client
          client.stop();
          //clearing string for next read
          readString="";
        }
      }
    }
  }
}

Thanks Zoomkat