mjmeli / arduino-ad5933

A simple library for controlling the AD5933 impedance converter system with an Arduino compatible device.
MIT License
48 stars 32 forks source link

Excitation Voltage Output #20

Open Anupriya12-07 opened 3 years ago

Anupriya12-07 commented 3 years ago

How to define macros for excitation voltage output. I am using AD5933 for impedance measurement .But i did not known how to set the excitation voltage value . arduino-ad5933-master.zip This is code i upload.Please tell me the correct place to include excitation voltage macro and its functions.

ChabaneAmaury commented 3 years ago

Check in the header file. You willl find the "setRange" function, allowing you to define the range based on one of the macro also defined in the header file (ex: "CTRL_OUTPUT_RANGE_1"). Check the datasheet corresponding to the AD5933 to know which one to use. You will want to call this function in the setup.

Anupriya12-07 commented 3 years ago

Sir, I am using setRange(CTRL_OUTPUT_RANGE_1) in the setup function but it is error . How to use the function Please tell me sir

On Tue, Oct 26, 2021 at 2:23 PM Amaury Chabane @.***> wrote:

Check in the header file. You willl find the "setRange" function, allowing you to define the range based on one of the macro also defined in the header file (ex: "CTRL_OUTPUT_RANGE_1"). Check the datasheet corresponding to the AD5933 to know which one to use. You will want to call this function in the setup.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mjmeli/arduino-ad5933/issues/20#issuecomment-951725237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVXJBIFKB6EDTAUO2BNSCWLUIZ3CBANCNFSM5FIYNS6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChabaneAmaury commented 3 years ago

Could you send your code, with the error please?

Anupriya12-07 commented 3 years ago

Arduino: 1.8.16 (Windows 7), Board: "Arduino Uno"

I have attached the code in the word document

This is error message

AD5933_Arduino_github:37:45: error: cannot call member function 'bool AD5933::setRange(byte)' without object

     AD5933::setRange(CTRL_OUTPUT_RANGE_2)))

                                         ^

exit status 1

cannot call member function 'bool AD5933::setRange(byte)' without object

On Wed, Oct 27, 2021 at 2:21 PM Amaury Chabane @.***> wrote:

Could you send your code, with the error please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mjmeli/arduino-ad5933/issues/20#issuecomment-952687747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVXJBIBVW5COSV5SDQXV7BLUI7DTNANCNFSM5FIYNS6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChabaneAmaury commented 3 years ago

Ah yes I see. Go in the header file and the "static" keyword before the function name. You should have this: "static bool setRange(byte);" `/**

Anupriya12-07 commented 3 years ago

Thanks a lots Sir. I will change and let you know sir

On Wed, Oct 27, 2021 at 2:51 PM Amaury Chabane @.***> wrote:

Ah yes I see. Go in the header file and the "static" keyword before the function name. You should have this: "static bool setRange(byte);" `/**

-

AD5933 Library class

Contains mainly functions for interfacing with the AD5933. */ class AD5933 { public: // Reset the board static bool reset(void);

// Temperature measuring static bool enableTemperature(byte); static double getTemperature(void);

// Clock static bool setClockSource(byte); static bool setInternalClock(bool); static bool setSettlingCycles(int);

// Frequency sweep configuration static bool setStartFrequency(unsigned long); static bool setIncrementFrequency(unsigned long); static bool setNumberIncrements(unsigned int);

// Gain configuration static bool setPGAGain(byte);

// Excitation range configuration static bool setRange(byte);

// Read registers static byte readRegister(byte); static byte readStatusRegister(void); static int readControlRegister(void);

// Impedance data static bool getComplexData(int, int);

// Set control mode register (CTRL_REG1) static bool setControlMode(byte);

// Power mode static bool setPowerMode(byte);

// Perform frequency sweeps static bool frequencySweep(int real[], int imag[], int); static bool calibrate(double gain[], int phase[], int ref, int n); static bool calibrate(double gain[], int phase[], int real[], int imag[], int ref, int n);

private: // Private data static const unsigned long clockSpeed = 16776000;

// Sending/Receiving byte method, for easy re-use static int getByte(byte, byte*); static bool sendByte(byte, byte);

};`

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mjmeli/arduino-ad5933/issues/20#issuecomment-952716352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVXJBIF4MYXVN7JXVHK5SHDUI7HCHANCNFSM5FIYNS6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Anupriya12-07 commented 3 years ago

Sir, I have another doubt. How to calibrate with code I send and hardware I using arduino,AD5933,amplifiers

On Wed, Oct 27, 2021 at 2:51 PM Amaury Chabane @.***> wrote:

Ah yes I see. Go in the header file and the "static" keyword before the function name. You should have this: "static bool setRange(byte);" `/**

-

AD5933 Library class

Contains mainly functions for interfacing with the AD5933. */ class AD5933 { public: // Reset the board static bool reset(void);

// Temperature measuring static bool enableTemperature(byte); static double getTemperature(void);

// Clock static bool setClockSource(byte); static bool setInternalClock(bool); static bool setSettlingCycles(int);

// Frequency sweep configuration static bool setStartFrequency(unsigned long); static bool setIncrementFrequency(unsigned long); static bool setNumberIncrements(unsigned int);

// Gain configuration static bool setPGAGain(byte);

// Excitation range configuration static bool setRange(byte);

// Read registers static byte readRegister(byte); static byte readStatusRegister(void); static int readControlRegister(void);

// Impedance data static bool getComplexData(int, int);

// Set control mode register (CTRL_REG1) static bool setControlMode(byte);

// Power mode static bool setPowerMode(byte);

// Perform frequency sweeps static bool frequencySweep(int real[], int imag[], int); static bool calibrate(double gain[], int phase[], int ref, int n); static bool calibrate(double gain[], int phase[], int real[], int imag[], int ref, int n);

private: // Private data static const unsigned long clockSpeed = 16776000;

// Sending/Receiving byte method, for easy re-use static int getByte(byte, byte*); static bool sendByte(byte, byte);

};`

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mjmeli/arduino-ad5933/issues/20#issuecomment-952716352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVXJBIF4MYXVN7JXVHK5SHDUI7HCHANCNFSM5FIYNS6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ChabaneAmaury commented 3 years ago

Can you post the code here, on github? Because you might be sending it by email, which only takes the text. I would like to have some precisions as well on your setup.

Lezaputriutami commented 1 year ago

hi,i have the same problem. and I've tried changing the h file but it doesn't work. can you help me