Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod AD5 with Arduino Uno

Application notes for Pmod AD5 and Arduino Uno. The result of the A/D conversion of the AIN1 channel is displayed on the serial monitor.

BeginnerShowcase (no instructions)1 hour3,752
Using the Pmod AD5 with Arduino Uno

Things used in this project

Story

Read more

Schematics

Pmod AD5 and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod AD5 to the Arduino Uno.

Pmod AD5 and Arduino Uno Fritzing Image

Fritzing image displaying the connection between the Pmod AD5 and Arduino Uno.

Code

Pmod AD5 and Arduino Uno Code

Arduino
Using this code will display the result of the A/D conversion of the AIN1 channel on the serial monitor.
/************************************************************************
*
* Test of the Pmod
*
*************************************************************************
* Description: Pmod_AD5
* The result of the A / D conversion of the AIN1 channel is displayed on the serial monitor.
*
*
* Material
* 1. Arduino Uno
* 2. Pmod AD5 (do not touch the jumper and
* dowload library https://github.com/annem/AD7193)
*
************************************************************************/

#include <SPI.h> // Call of libraries
#include <AD7193.h>

AD7193 AD7193; // Creation of the object AD7193

unsigned long valeur;
float tension;

void setup()
{
 Serial.begin(9600); // initialization of serial communication
 Init_AD7193();
}

void loop()
{
 valeur = AD7193.ReadADCChannel(0); // conversion A/N on input 1
 valeur = valeur >> 8; // Extraction of value
 tension = AD7193.DataToVoltage(valeur); // Recovery of tension
 Serial.println("");
 Serial.print("Valeur=");
 Serial.print(valeur);
 Serial.print('\t'); // tabulation
 Serial.print("Tension=");
 Serial.print(tension);
 Serial.println("V");
}

// Initialisation du module Pmod AD5
void Init_AD7193(void)
{
 AD7193.begin(); // initialization of Pmod AD5 module
 AD7193.AppendStatusValuetoData(); // configuration of Pmod AD5 module
 AD7193.SetPGAGain(1);
 AD7193.SetAveraging(100);
 AD7193.Calibrate();
 AD7193.ReadRegisterMap();
}

Credits

Martha Migliacio

Martha Migliacio

5 projects • 18 followers
Alex Wong

Alex Wong

14 projects • 53 followers
I work in Digilent and like creating projects
Thanks to Lextronics.

Comments