Jump to content
  • 0

PmodAD5 evaluation


Yacov Cohen

Question

I ordered 2 PmodAD5 units order date 10/30/2017 #20049599 customer ID 39763

tested the voltage mode on 2 software's. The one  Ad7193_VoltageMeasure_Example and the second one  Code from Hackester.io for voltage measuring  and got similar results

Pmod  AD5 Test

 

Power supply measured voltage        Measured by PmodeAD5          Ratio

0.6                                                                0.288                                          0.48

0.7                                                                 0.38                                            0.542

0.9                                                                0.584                                             0.650

1.0                                                                 0.675                                            0.675

What I need is linear voltage measurement.

Can you help on this please?

Yacov

Mailyacovcohen@gmail.com

 

Question 2

On Hackester.io Martha is suggesting a direct connection of PmodAD5 to Arduino Uno using 5 Volt.

I need a measurement from 0 to 3.5 Volt.

How bad is to use 5 volt (on heavy duty  instrument)?

Link to comment
Share on other sites

Recommended Posts

This is the example I am running:

  

Spoiler

 

/*

 

AD7193_VoltageMeasure_Example

 

Configures and calibrates the AD7193 to measure differental voltage on AIN1 and AIN2

 

Tutorial can be found at <TBD>, and uses the PmodAD5 from Digilent.

 

Signal Connections:

-----------------------------------------------------

 Signal Name |  PmodAD Pin  |  Arduino Pin

-----------------------------------------------------

  ~CS        |  J1, Pin 1   |  10

  MOSI       |  J1, Pin 2   |  MOSI or 11 or ICSP-4

  MISO       |  J1, Pin 3   |  MISO or 12 or ICSP-1

  SCLK       |  J1, Pin 4   |  SCLK or 13 or ICSP-3

  GND        |  J1, Pin 5   |  GND

  VCC (3.3V) |  J1, Pin 6   |  3.3V

-----------------------------------------------------

 

-----------------------------------

 Signal Name       |  PmodAD5 Pin   

-----------------------------------

 Channel 1 Pos     |  J2, Pin 3

 Channel 1 Neg     |  J2, Pin 4

-----------------------------------

See Table 24 of AD7193 datasheet for more information

 

Reference:

https://reference.digilentinc.com/reference/pmod/pmodad5/start

https://www.arduino.cc/en/Reference/SPI

 

Created 4 Oct 2016

by Anne Mahaffey

 

This example code is in the public domain

*/

 

 

 

 

 

 

#include <SPI.h>

#include <AD7193.h>

 

 

AD7193 AD7193;

 

void setup() {

 

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

  // setup Serial and SPI

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

 

  Serial.begin(9600);

  delay(1000);

 

  while (!Serial) {

    ; // wait for serial port to connect. Needed for native USB port only

  }

 

  AD7193.begin();

 

 

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

  // Device setup

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

 

  //This will append status bits onto end of data - is required for library to work properly

  AD7193.AppendStatusValuetoData(); 

 

  // Set the gain of the PGA

  AD7193.SetPGAGain(1);

 

  // Set the Averaging

  AD7193.SetAveraging(100);

 

 

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

  // Calibrate with given PGA settings - need to recalibrate if PGA setting is changed

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

 

  AD7193.Calibrate();

 

  // Debug - Check register map values

  AD7193.ReadRegisterMap();

 

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

 

  Serial.println("\nBegin AD7193 conversion - single conversion (pg 35 of datasheet, figure 25)");

}

 

 

void loop() {

 

  unsigned long ch1Data;

  float ch1Voltage;

 

  // Read channel measurement data

  ch1Data = (AD7193.ReadADCChannel(1) >> 8);

 

  Serial.print("  CH1 data: ");

  Serial.print(ch1Data, HEX);

 

  // Convert to voltage

  ch1Voltage = AD7193.DataToVoltage(ch1Data);

 

  Serial.print("\n\t\tChannel 1 Voltage Measurement: ");

  Serial.println(ch1Voltage, 8); 

  

  delay(2000);

}

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Hi @Yacov Cohen,

I took a look through the libraries more thoroughly and it all seems to be performing correctly in terms of register manipulation; we're working on testing the hardware ourselves but a combination of software not working on one computer with the other engineer out of office without the hardware is plaguing us; we hope to test this ourselves early next week.

One question I do have though is which analog inputs are you using on the Pmod AD5? From what I am able to tell in the example code for both the voltage measure example and the thermocouple example tutorial you linked to, the code is using Channel 1, which corresponds to the differential pair A3 and A4 on the Pmod AD5, as opposed to A1 and A2 (Channel 0) which the tutorial shows in their picture.

I'm sorry for the delay in this.

Thank you,
JColvin

Link to comment
Share on other sites

JColvin,

Thank you for your detailed answer,

Lets omit the issue that I intend to measure 3.5 Volts.

I am running the AD7193_VoltageMeasure_Example using the library as explained on EnginnerZone: https://ez.analog.com/blogs/annem/2017/03/20/ad7193-arduino-tutorial 

As I Mentioned previously I am getting non linear Voltage measurement

Power supply measured voltage        Measured by PmodeAD5                            Ratio

0.6                                                                0.288                                          0.48

0.7                                                                 0.38                                            0.542

0.9                                                                0.584                                             0.650

1.0                                                                 0.675                                            0.675
 

Can you please help on this specific issue?
Thanks again

Y.

Link to comment
Share on other sites

Hello @Yacov Cohen,

I don't know what library files are being used on the "Ad7193_VoltageMeasure_Example", but if it's based on the same set of libraries used in the hackster.io project that you also linked to, what you are encountering is that a number of the settings done by the libraries (mostly the default settings of the AD7193 chip) are not suitable to your application.

With the PGA gain set to 1, you will also want to change the reference select bit (bit 20) in the Configuration Register (pg 27 of the datasheet) so that the Pmod AD5 uses an externally supplied reference voltage (5 V will work in your case) rather than the default internal 2.5 V reference. Note that you will need to remove jumper JP1 if the digital logic levels you are using are not based with 5V as the logic high.

Since you are looking to measure values between 0 and 3.5 V, either unipolar or bipolar mode will work for your application, but I would recommend unipoloar mode to make the conversion of resulting 24-bit data code back to the detected voltage value a bit easier, based on the equations provided on page 33 of the datasheet. To use unipolar mode, bit 3 in the configuration register will need to be set.

If the registers are set correctly, I do not anticipate on any damage being done to the Pmod.

Let me know if you have any further questions.

Thank you,
JColvin

Link to comment
Share on other sites

8 hours ago, jpeyron said:

Hi @Yacov Cohen,

Could you please elaborate on "What I need is linear voltage measurement?" and "How bad is to use 5 volt (on heavy duty  instrument)?".

thank you,

Jon

Hi Jon,

Thank you for your quick response.  

When running the AD7193_VoltageMeasure_Example on Arduino Uno I am getting the following results:
Instead of measuring 0.6 Volt I am getting a reading on serial monitor of 0.288 Volt.
Instead of reading 1 Volt I am getting 0.675 Volt on serial monitor.

What I need is a display of the correct voltage. At the beginning I thought that I have only to multiply the results by a factor but it is not true.

Can you please Help. 

 I prefer to work using 5 Volt as I have to measure 0 to 3.5 Volts and I can not use a simple resistive divider as the source may change internal impedance. So am I taking any risk to burn the device?

Thank u

Link to comment
Share on other sites

Hi Jon,

Thank you for your quick response.  

When running the AD7193_VoltageMeasure_Example on Arduino Uno I am getting the following results:
Instead of measuring 0.6 Volt I am getting a reading on serial monitor of 0.288 Volt.
Instead of reading 1 Volt I am getting 0.675 Volt on serial monitor.

What I need is a display of the correct voltage. At the beginning I thought that I have only to multiply the results by a factor but it is not true.

Can you please Help. 

 I prefer to work using 5 Volt as I have to measure 0 to 3.5 Volts and I can not use a simple resistive divider as the source may change internal impedance. So am I taking any risk to burn the device?

Thank u

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...