Analog.com Analog Dialogue Wiki 简体中文
EngineerZone
EngineerZone
  • Log In
  • Site
  • Search
  • User
  • Support

    Popular Forums

    • RF and Microwave
    • Power Management
    • Video
    • FPGA Reference Designs
    • Precision ADCs
    • Linux Software Drivers
    • SigmaDSP Processors & SigmaStudio Dev. Tool

    Product Forums

    • A2B
    • Amplifiers
    • Analog Microcontrollers
    • Clock and Timing
    • Data Converters
    • Direct Digital Synthesis (DDS)
    • Energy Monitoring and Metering
    • Interface and Isolation
    • MEMS Inertial Sensors
    • Processors and DSP
    • Switches/Multiplexers
    • Temperature Sensors
    • Voltage References
    View All

    Application Forums

    • Audio
    • Automated Test Equipment (ATE)
    • Condition-Based Monitoring
    • Depth, Perception & Ranging Technologies
    • Embedded Vision Sensing Library
    • Motor Control Hardware Platforms
    • Optical Sensing
    • Precision Technology Signal Chains Library
    • Video
    • Wireless Sensor Networks Reference Library

    Design Center Forums

    • ACE Evaluation Software
    • ADEF System Platforms
    • Design Tools and Calculators
    • FPGA Reference Designs
    • Linux Software Drivers
    • Microcontroller no-OS Drivers
    • Reference Designs
    • Signal Chain Power (SCP)
    • Software Interface Tools
    • System Demonstration Platform (SDP) Support
  • Learn

    Highlighted Webinar

    Audio Design Solutions for Augmented and Virtual Reality (AR/VR) Glasses

    Recent Discussions

    • Standalone Data logging using ADALM2000
    • About sdr.tx(). Can I change the transmitter frequency after call this function?
    • About the values of CurV1,2 displayed in the cursors frame of scopy.
    • Purpose of "Load" in Scopy signal generator configuration GUI
    • about the transient response experiment example of RL Circuit using adalm2000

    Places

    • ADI Education Home
    • ADI Education China
    • ADI Education India
    • ADI Education Philippines
    • StudentZone (Analog Dialogue)
    • Virtual Classroom

    Latest Webinars

    • Audio Design Solutions for Augmented and Virtual Reality (AR/VR) Glasses
    • Robust Industrial Motor Encoder Signal Chain Solutions
    • Precision Low Power Measurement Solutions for Intelligent Edge
    • Advantages of Integrating Digital Power System Management (DPSM) into your Design
    • Optimizing GaN and GaAs RF Amplifier Performance Using Novel Biasing Techniques
    View All Webinars
  • Community Hub

    Challenge Yourself!

      KCC's Quizzes AQQ231 about Birthdays and Cake Candles
    View All

    Places

    • Community Help
    • Logic Lounge

    Resources

    • EZ Code of Conduct
    • Getting Started Guide
    • ADI: Words Matter
    • Community Help Videos
    View All
  • Blogs

    Highlighted Blogs

    Understanding Public Key Infrastructures

     

    Share Your Insights! How Can We Improve Your Engineering Design Needs?

    Latest Blogs

    • 10BASE-T1L Makes Powering Intelligent Field Instruments Painless
    • Using Python To Control The Pluto Radio And Plot Data
    • Resistance is NOT Futile
    • What is The Continuity of Engineering?
    • Move Over Sensors: Actuators Are Entering The Smart Factory Stage
    Read All Blogs

    ADI Blogs

    • EZ Spotlight
    • The Engineering Mind
  • Partners

    Electronic Design Services - PartnerZone

    • Boston Engineering
    • Calian, Advanced Technologies
    • Colorado Engineering Inc. (DBA CAES AT&E)
    • Clockworks Signal Processing
    • Epiq Solutions
    • Fidus
    • PalmSens
    • Richardson RFPD
    • Tri-Star Design, Inc.
    • VadaTech
    • Vanteon
    • X-Microwave
    View All
Precision ADCs
  • Data Converters
Precision ADCs
Documents AD7193 + Arduino Tutorial - Thermocouple measurements
  • Forums
  • File Uploads
  • FAQs/Docs
  • Members
  • Tags
  • More
  • Cancel
  • +Documents
  • +General: FAQ
  • +AD1139: FAQ
  • +AD1556: FAQ
  • +AD1580: FAQ
  • +AD1582: FAQ
  • +AD2S1200: FAQ
  • +AD2S1205: FAQ
  • +AD2S1210: FAQ
  • +AD2S75: FAQ
  • +AD2S80: FAQ
  • +AD2S80A: FAQ
  • +AD2S82A: FAQ
  • +AD2S83: FAQ
  • +AD2S90: FAQ
  • +AD2S99: FAQ
  • +AD4110-1: FAQ
  • +AD411x: FAQ
  • +AD5940: FAQ
  • +AD598: FAQ
  • +AD650: FAQ
  • +AD652: FAQ
  • +AD654: FAQ
  • +AD7091: FAQ
  • +AD7091r: FAQ
  • +AD711: FAQ
  • +AD7124-4: FAQ
  • +AD7124-8: FAQ
  • +AD7134: FAQ
  • +AD713: FAQ
  • +AD7142: FAQ
  • +AD7147: FAQ
  • +AD7148: FAQ
  • +AD7150: FAQ
  • +AD7151: FAQ
  • +AD7175-2: FAQ
  • +AD7176-2: FAQ
  • +AD7176: FAQ
  • +AD717x: FAQ
  • +AD7190: FAQ
  • +AD7192: FAQ
  • -AD7193: FAQ
    • AD7193 + Arduino Tutorial - Thermocouple measurements
  • +AD7195: FAQ
  • +AD719x: FAQ
  • +AD7265: FAQ
  • +AD7266: FAQ
  • +AD7280: FAQ
  • +AD7291: FAQ
  • +AD7298: FAQ
  • +AD7305: FAQ
  • +AD7321: FAQ
  • +AD7323: FAQ
  • +AD7328: FAQ
  • +AD7366-5: FAQ
  • +AD7367: FAQ
  • +AD736ARZ: FAQ
  • +AD737: FAQ
  • +AD7380 : FAQ
  • +AD7398: FAQ
  • +AD7400A: FAQ
  • +AD7401: FAQ
  • +AD7403: FAQ
  • +AD74111: FAQ
  • +AD7415: FAQ
  • +AD7416: FAQ
  • +AD7417: FAQ
  • +AD7418: FAQ
  • +AD7450: FAQ
  • +AD7475: FAQ
  • +AD7484: FAQ
  • +AD7490: FAQ
  • +AD7492: FAQ
  • +AD75019: FAQ
  • +AD7503: FAQ
  • +AD7541A: FAQ
  • +AD7546: FAQ
  • +AD7547: FAQ
  • +AD7568: FAQ
  • +AD7578: FAQ
  • +AD7606-4: FAQ
  • +AD7606: FAQ
  • +AD7606B: FAQ
  • +AD7606C: FAQ
  • +AD7608: FAQ
  • +AD7616 FAQ
  • +AD7616-P: FAQ
  • +AD7621: FAQ
  • +AD7625: FAQ
  • +AD7626: FAQ
  • +AD7631: FAQ
  • +AD7653: FAQ
  • +AD7654: FAQ
  • +AD7655: FAQ
  • +AD7656: FAQ
  • +AD7657-1: FAQ
  • +AD7663: FAQ
  • +AD7674: FAQ
  • +AD7675: FAQ
  • +AD7678: FAQ
  • +AD7682: FAQ
  • +AD7683: FAQ
  • +AD7684: FAQ
  • +AD7685: FAQ
  • +AD7688: FAQ
  • +AD7689: FAQ
  • +AD7690: FAQ
  • +AD7691: FAQ
  • +AD7705: FAQ
  • +AD7706: FAQ
  • +AD7707: FAQ
  • +AD7708: FAQ
  • +AD7709: FAQ
  • +AD7710: FAQ
  • +AD7711A: FAQ
  • +AD7712: FAQ
  • +AD7713: FAQ
  • +AD7714: FAQ
  • +AD7714YN: FAQ
  • +AD7715: FAQ
  • +AD7716: FAQ
  • +AD7718: FAQ
  • +AD7719: FAQ
  • +AD7720: FAQ
  • +AD7722: FAQ
  • +AD7725: FAQ
  • +AD7730: FAQ
  • +AD7731: FAQ
  • +AD7732: FAQ
  • +AD7738: FAQ
  • +AD7740: FAQ
  • +AD7741: FAQ
  • +AD7745: FAQ
  • +AD7746: FAQ
  • +AD7747: FAQ
  • +AD7760: FAQ
  • +AD7763: FAQ
  • +AD7766: FAQ
  • +AD7768: FAQ
  • +AD777x: FAQ
  • +AD7780: FAQ
  • +AD7785: FAQ
  • +AD7787: FAQ
  • +AD7788: FAQ
  • +AD7790: FAQ
  • +AD7792: FAQ
  • +AD7793: FAQ
  • +AD7794: FAQ
  • +AD7795: FAQ
  • +AD7798: FAQ
  • +AD7799: FAQ
  • +AD7805: FAQ
  • +AD7808: FAQ
  • +AD7809: FAQ
  • +AD780: FAQ
  • +AD7811: FAQ
  • +AD7812: FAQ
  • +AD7817: FAQ
  • +AD7819: FAQ
  • +AD7821: FAQ
  • +AD7825: FAQ
  • +AD7829: FAQ
  • +AD7835: FAQ
  • +AD7849: FAQ
  • +AD7851: FAQ
  • +AD7854: FAQ
  • +AD7856: FAQ
  • +AD7858: FAQ
  • +AD7859: FAQ
  • +AD7864: FAQ
  • +AD7865 : FAQ
  • +AD7872: FAQ
  • +AD7874: FAQ
  • +AD7879: FAQ
  • +AD7887: FAQ
  • +AD7888: FAQ
  • +AD7891-1: FAQ
  • +AD7891: FAQ
  • +AD7893-2: FAQ
  • +AD7895: FAQ
  • +AD7896: FAQ
  • +AD7899: FAQ
  • +AD7912: FAQ
  • +AD7921: FAQ
  • +AD7924: FAQ
  • +AD7927: FAQ
  • +AD7938: FAQ
  • +AD7942: FAQ
  • +AD7949: FAQ
  • +AD7960: FAQ
  • +AD7961: FAQ
  • +AD797: FAQ
  • +AD7980: FAQ
  • +AD7982: FAQ
  • +AD7984: FAQ
  • +AD7986: FAQ
  • +AD7988-1: FAQ
  • +AD7993: FAQ
  • +AD7994: FAQ
  • +AD7997: FAQ
  • +AD7998: FAQ
  • +ADA2200: FAQ
  • +ADAS1000: FAQ
  • +ADAS3022: FAQ
  • +ADAS3023: FAQ
  • +ADC: FAQ
  • +ADVFC32: FAQ
  • +EVAL-AD7719-EB: FAQ
  • +EVAL-ADAS3022EDZ: FAQ
  • +RDC1740: FAQ
  • +AD4116: FAQ
  • AD7398 SPI Voltage vs VCC
  • +DC590, DC2026, QuikEval: FAQs
  • +Legacy LTC - Sigma Delta ADCs FAQ
  • +Precision Technology Learning Modules
  • Programming FMC FRU ID EEPROM on Linux

AD7193 + Arduino Tutorial - Thermocouple measurements

The AD7193 is 4 channel sigma-delta ADC, which is handy for sensor measurement applications - particularly sensors that generate a very small voltage that needs to be measured.  Examples include thermocouples and bridge-type sensors (such as load cells).  This tutorial is for a K-type thermocouple, but the AD7193 can be used for a variety of thermocouples, and other voltage measurements.  

The multiple channels and built-in PGAs and filtering enable measurements of multiple sensors, and flexibility measurement settings.

What you'll need:

  • 3.3V Arduino - I used an Adafruit Feather
  • K-type Thermocouple - I used this one from Adafruit
  • AD7193 - I used a Digilent Pmod AD5
  • AD7193 Arduino Library - can be installed using Arduino Library Manager
  • Prototyping materials
    • Breadboard, wire kit, alligator clips

If you chose to use a 5V Arduino (such as an Arduino Uno or Leonardo), you'll need to shift the logic levels to ensure that the AD7193 receives 3.3V logic, as well as power from a 3.3V supply (available on the Uno as the "3.3V" power pin) - I cannot be held responsible if you fry your AD7193 using a 5V Arduino!

 

Arduino specs table - look for Arduinos with 3.3V Operating voltage 

 

Arduino is an open source prototyping platform - there are many, many "Arduino-compatible" boards out there.  And, chances are good that you could get any one of them to work for this example.  But, to keep things simple, I am going show how connect the AD7193 to the Adafruit Feather.  If you deviate from this example, you are on your own.  But, don't worry!  There are loads of examples on the web, books in the bookstore/library, etc, that will very quickly help you to become an Arduino expert.

 

Getting started with Arduino

  • Download and install the Arduino IDE - https://www.arduino.cc/en/Main/Software 
  • Get your Arduino working with the Blink Example - https://www.arduino.cc/en/Tutorial/Blink 

Do not continue until you get Blink working.  If you're struggling with Blink, keep working through tutorials and getting started guides until you understand how to communicate with and program.

  • Arduino - Getting Started 
  • Learn Arduino Tutorial Series by Simon Monk 
  • Adafruit Feather 32u4 Adalogger tutorial 

Installing the AD7193 library

To install the AD7193 library using the Arduino Library Manager, click Sketch -> Include Library -> Manage Libraries.  When the library manager comes up, type "AD7193" in the filter field, and click the "Install" button to install the library.

See Installing Additional Arduino Libraries for more detailed information about using the Library Manager.

Connecting AD7193 to Arduino

Make the following connections between your Arduino and the AD7193 (using Pmod AD5 in this example):

Arduino Pin Pmod AD5 Pin

Wire Color in

picture below

3.3V VCC  (J1, Pin 6) Red
GND GND  (J1, Pin 5) Black
SCLK or 13 or ICSP-3 SCLK  (J1, Pin 4) Yellow
MISO or 12 or ICSP-1 MISO  (J1, Pin 3) Green
MOSI or 11 or ICSP-4 MOSI  (J1, Pin 2) Blue
10 ~CS (J1, Pin1) White

Connecting thermocouple to AD7193

Connect the thermocouple leads to AIN1 and AIN2 on the AD7193 - in the case of the Pmod AD5 and the K-type thermocouple from Adafruit, connect the yellow thermocouple lead to Pin 1 on J2, and the red thermocouple lead to Pin 2 on J2.  This is where alligator clips can come in very handy - the leads from the thermocouple are not rigid enough to push into J2.

Open and upload thermocouple example sketch

In Arduino IDE, select File -> Examples -> AD7193 -> AD7193_Thermocouple_Example

Click the "Upload" button (right pointing arrow, circled in red).  When upload is complete, click the "Serial Monitor" button on the far right (also circled in red).

Observe data on serial monitor

This example includes a wait loop, that's necessary for default USB devices, like the Leonardo and the Feather.  

   while (!Serial) {
   }

This means code you've just uploaded won't actually run until it detects that the Serial Monitor is open.  Open the serial monitor to view the setup and measured results.

If you want to modify this example for use in a more embedded application (meaning, no serial monitor), just remove the wait loop.

The example below is what the serial monitor looks like when I have the thermocouple in a cup of ice water.  (Keep in mind, I'm using the on-chip temp sensor, which according to the datasheet, has a ±2°C accuracy AFTER user calibration.  Also, this example does not include any user calibration of the on-chip temperature sensor, so you'll need to determine if your application requires calibration to get the accuracy you need.)

Troubleshooting tips

Issue: When sketch is running through initial setup, the "Read All Registers" portion of serial monitor output is showing all registers as all zeros.

Check power and ground connections to the AD7193, and check all SPI connections.  Debugging the SPI connectivity can be tricky - I've seen bad connections due to poor quality wiring, faulty breadboards, etc.  Pay particular attention to CSB connection. If you can get your hands on a logic analyzer, probe the SPI connections to see.

I have a Saleae logic analyzer, which is easily one of the handiest things I own.  https://www.saleae.com/ 

Issue: "Read All Registers" portion of serial monitor output is showing all registers as all ones (F's).

Similar to issue above - check all SPI connections, and debug with a logic analyzer.

Issue: Calculated temperature isn't what I expected.

Rerun sketch, just to be sure there was an issue with the program load and initial execution.  If temperature is low when you expect high, or vice versa, try reversing thermocouple terminals.  Program as written only supports K-type thermocouples.  If using a different type, you'll need to add the linearization code for that type.

Questions and Feedback

Leave any questions or feedback in the comments below.  

  • arduino
  • ad7193
  • Share
  • History
  • More
  • Cancel
Related
Recommended
Social
Quick Links
  • About ADI
  • ADI Signals+
  • Analog Dialogue
  • Careers
  • Contact us
  • Investor Relations
  • News Room
  • Quality & Reliability
  • Sales & Distribution
  • Incubators
Languages
  • English
  • 简体中文
  • 日本語
Newsletter

Interested in the latest news and articles about ADI products, design tools, training and events? Subscribe today!

Sign Up
Analog Logo
©1995 - 2023 Analog Devices, Inc. All Rights Reserved
沪ICP备09046653号-1
  • Sitemap
  • Legal
  • Privacy & Security
  • Privacy Settings
EngineerZone Uses cookies to ensure you get the best experience in our community. For more information on cookies, please read our Privacy & Security Statement.