This project demonstrates how to interface the AD8495 analog K-type thermocouple amplifier with an STM32F103C6 microcontroller using the on-chip ADC for accurate temperature measurement. Unlike digital thermocouple converters, the AD8495 provides a linear analog voltage output proportional to temperature, with built-in cold-junction compensation (CJC).
AD8495 Key Features
- Supports K-type thermocouples only, ensuring optimized accuracy.
- Provides analog voltage output:
- With 5V supply → 0–5 V (≈ –250°C to +750°C).
- With 3.3V supply → 0–3.3 V (≈ –250°C to +410°C).
- Built-in cold-junction compensation.
- Operates from 3.3V to 18V supply.
By leveraging STM32’s ADC, the amplifier’s output voltage can be directly sampled and converted into temperature values, enabling precise, real-time thermal monitoring. Results are displayed via UART on a virtual terminal in Proteus.
STM32CubeMX Setup- MCU Selection: STM32F103C6 (8 MHz clock)
- ADC1 Configuration:
- Channel: IN0 (PA0)
- Resolution: 12-bit
- Trigger: Software (continuous)
- Reference Voltage: External 2.5V reference (VREF+)
- UART1 Configuration:
- Baud Rate = 9600
- Word Length = 8 bits
- Generate initialization code in STM32CubeIDE.
Key Functions
- Temperature Reading
- float Read_Temperature(void);
- Reads raw ADC value, converts to millivolts, and maps to °C.
- Cold-Junction Compensation
- float Apply_CJC(float temp);
- Adjusts raw temperature with compensation offset.
- Main Loop
- float temp = Apply_CJC(Read_Temperature());
- printf("Temperature: %.1f °C\r\n", temp);
- Continuously acquires and prints temperature readings.
Components
- STM32F103C6 microcontroller
- AD8495 K-type thermocouple amplifier
- K-type thermocouple
- Virtual Terminal (UART, 9600 baud)
Connections
- PA0 → AD8495 VOUT
- VREF+ → 2.5V precision reference
- UART TX → Virtual Terminal
Steps
- Load compiled .hex file into STM32 in Proteus.
- Set thermocouple temperature in AD8495 model properties.
- Observe temperature readings in Virtual Terminal.
That's all!
If you have any questions or suggestions don't hesitate to leave a comment below





Comments