Reading pressures off a Edwards Lifescience Pressure Transducer

Threads merged. Twice.

This is a perfect example of getting in over your head.
You say that nothing you have tried has worked, yet anyone who can read a schematic can see that the cd_en signal (probably stands for Chip Disable/Enable, controls the mosfet used to sink the MCP3424 current, effectively functioning as an ON/OFF switch for the MCP3424 as it could have no power if cd_en
is LOW because the mosfet would be OFF , and therefore the MCP3424 would have no circuit path from the
GND pin (called Vss) to GND because the mosfet is in the way and it is OFF (OPEN). This would explain
why you have had no success. I might add, anyone who had addressed the hardware first instead of the
software (still no evidence that ever occurred either; no code posted, no mention of the library etc) would]
have noticed that the Vss pin is not at 0V because it is not connected to ground. (unless of course you can
tell WHERE cd_en is coming from since it is not given in the schematic.
Until you post a list of all the voltages on every pin of the MCP3424, this post is dead in the water...

Sorry, let me be more specific with what I've tried.

  1. I've run a few I2C scanners. I've tried the following:
    Arduino Playground - I2cScanner
    A I2C Scanner for Arduino · GitHub
    GitHub - todbot/arduino-i2c-scanner: Simple Arduino I2C scanner as described at http://todbot.com/blog/2009/11/29/i2cscanner-pde-arduino-as-i2c-bus-scanner/

All of these are consistent in returning unknown errors at every address. I am led to believe this indicates that they have been hooked up to the MCU incorrectly.

  1. The code is as shown below
#include <ESP8266WiFi.h>

#include <SD.h>
#include <SPI.h>
#include <Wire.h>
#include "MCP3424.h"

//Setup for MCP
MCP3424 adc(PIN_FLOAT, PIN_FLOAT);


//Setup for filetransfer
File myFile;
int pinCS = 2; // Pin D4 on Nodemcu

//Setup for wifi
const char* ssid     = "";   //replace with your own SSID
const char* password = "";    //replace with your own password
const char* host = "api.pushingbox.com";  

 
void setup() {
  Serial.begin(115200);



  //SETUP FOR MCP3424
    Wire.begin();

    adc.generalCall(GC_RESET);

    adc.creg[CH1].bits = { GAINx1, SR18B, CONTINUOUS, CH1, 1 };
    
   //SETUP FOR WIFI
  
  // We start by connecting to a WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  
  /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
     would try to act as both a client and an access-point and could cause
     network-issues with your other WiFi-devices on your WiFi-network. */
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
 
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  //SETUP FOR SENDING TO SD

   pinMode(pinCS, OUTPUT);
}

double value;
String data;

static char * errmsg[] = {"", "underflow", "overflow", "i2c", "in progress", "timeout"};

void loop() {
//MCP LOOP
    ConvStatus err = adc.read(CH1, value);
    if (err == R_OK) 
      Serial.println(value, DEC); 
    else {
      Serial.print("conversion error: ");
      data=errmsg[err];
      Serial.println(errmsg[err]);
    }
    asm volatile ("nop");
   
   delay (1000);
//SD LOOP
 // SD Card Initialization
  if (SD.begin())
  {
    Serial.println("SD card is ready to use.");
  } else
  {
    Serial.println("SD card initialization failed");
  }
  
  // Create/Open file 
  myFile = SD.open("test.txt", FILE_WRITE);
  
  // if the file opened okay, write to it:
  if (myFile) {
    Serial.println("Writing to file...");
    // Write to file
    myFile.println(data);
    myFile.close(); // close the file
    Serial.println("Done.");
  }
  // if the file didn't open, print an error:
  else {
    Serial.println("error opening test.txt");
  }
  // Reading the file
  myFile = SD.open("test.txt");
  if (myFile) {
    Serial.println("Read:");
    // Reading the whole file
    while (myFile.available()) {
      Serial.write(myFile.read());
   }
    myFile.close();
  }
  else {
    Serial.println("error opening test.txt");
  }




  
    delay(1000);
   //Pin to read data from
    Serial.print("connecting to ");;
    Serial.println(host);
  
    // Use WiFiClient class to create TCP connections
    WiFiClient client;
    const int httpPort = 80;
    if (!client.connect(host, httpPort)) {
      Serial.println("connection failed");
      return;
    }
    // We now create a URI for the request
    String url = "/pushingbox?";
    url += "devid=";
    url += "vA4858D0A68D15BA";
    url += "&data="+String(data);
  
    Serial.print("Requesting URL: ");
    Serial.println(url);
  
    // This will send the request to the server
    client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" + 
               "Connection: close\r\n\r\n");
    unsigned long timeout = millis();
    while (client.available() == 0) {
      if (millis() - timeout > 5000) {
      Serial.println(">>> Client Timeout !");
      client.stop();
      return;
    }
  }
  
  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
    Serial.print("Data Sent!");
  }
  
  Serial.println();
  Serial.println("closing connection");
  
}

I've tried a few different MCP3424 libraries. All of the following:

My code contains the top link's One Shot example. I've tried examples from each link and they all return 0s The other code in my posted code writes to the SD and uploads to a data without any issues.

Attached are photos of the circuits. It's difficult to get clean photos due to the device being heavily glued down.

I have tested for continuity in the circuit. I do not have access to a multimeter at this time, but I will get one as soon as I can. At that time I will update with voltage readings.

Also, there is no cd_en. I believe it is lcd_en, thus goes to the lcd screen on the device.

The schematic you posted shows lcd_en controlling
the mosfet that sinks the current ( enables) the MCP3424 so if lcd_en is not High the MCP3424 will
be off ( no power)

Follow the Vss pin (5)

If you have a multimeter, put it across Vdd and Vss of the MCP3424 to see if it is actually powered.

raschemmel:
Follow the Vss pin (5)

If you have a multimeter, put it across Vdd and Vss of the MCP3424 to see if it is actually powered.

I'll be replying with this account. Was having trouble with the other one.

Checking for voltage across Vdd and Vss gave a reading of 3.25V, so it is receiving power.
I got 0v across CH1, CH2, CH3, CH4, and ADR0-ADR1. The SCL-SDA line gave about 100v.

Should CH1 be outputting zero voltage? Could that be my problem?

There's no voltageson the schematic. Is it a 1S Lipo ?

You haven't said one word about the serial prints.
What's the Data value printed?

I was given no specs on the battery. I'll contact the device constructor and find out.

I mentioned previously that the value I get from the serial print is 0v consistently across the libraries I used. The error message I get from the MCP reads "i2c".

Attached is the best photo I could get of the battery.

It sounds like you have an I2C issue and not an MCP3424 issue.
You need to find a way to verify I2C is working. Does the OLED display work with the I2c ?
Does anything on the I2c bus work properly ?
Do you have pullup resistors on SDA and SCL as shown in the schematic ?

I don't want sound like a dick but if it's a single cell or multiple cells in parallel then it's 3.7V at full charge.
The voltage per cell is the same for all lipos. The only difference is how many and how they are wired.
3.25V is fine for a single cell.
You need to work on the I2c issue. I don't remember exactly how I2C works but I thought it was addresses. What happened when you tried the scanners ? You said you tried them but didn't say whwt the result was.

tylarthefarmer is an open account.

Why create a new account?

Isn't this still his post ?

raschemmel:
Isn't this still his post ?

TyB != tylarthefarmer

Cross-Posting Counter-Measures:
(use an alias)
Doesn't change the IP address though...