yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
STM32-BoardCar📖
0. Get started quickly
  • 0.ReadMe
  • 1. Installation Instructions
  • 2. Version configuration
  • 3. Smart car installation video
  • 4. Precautions for use
1. Introduction to STM32 development board
  • 1. Learn about STM32
  • 2. Introduction to STM32 development board
  • 3. Development board pin assignment
  • 4. Introduction to HAL library and LL library
2. Setting up and using the development environment
  • 1. Common development tools
  • 2. STM32CubeMX Install - Use
  • 3. STM32CubeIDE Install - Use
  • 4. Common Driver Installation
  • 5. Program download and simulation
  • 6. Engineering experience and migration
3. Development board basic tutorial
  • 1. RGB searchlight (GPIO)
  • 2. Buzzer control (GPIO)
  • 3. Button control (EXTI)
  • 4. Serial communication (UASRT)
  • 5. Voltage detection (ADC)
  • 6. Internal temperature sensor(ADC)
  • 7. Independent watchdog(IWDG)
  • 8. Window watchdog(WWDG)
  • 9. Basic timer (TIM6)
  • 10. Universal Timer (TIM3)
  • 11. Advanced timers (TIM1)
  • 12. I2C Communication (IIC)
  • 13. Off-chip Flash (SPI)
  • 14. On-chip Flash (Flash)
  • 15. DMA:USART
  • 16. DMA:SPI
  • 17. DMA:I2C
  • 18. USB communication
  • 19. USB analog U disk
  • 20. FreeRTOS
4. Car expansion tutorial
  • 1. Servo control
  • 2. Basic use of ultrasonic steering gear gimbal
  • 3. Motor control
  • 4. OLED display light sensitivity value
  • 5. Infrared sensor
  • 6. Four-way tracking module
  • 7. Infrared remote control
  • 8. Ultrasonic ranging
  • 9. PS2 controller test
  • 10.K230 Vision Module
  • 11.AI voice interaction integration module
5. Robot car tutorials
  • 1. Car line patrol
  • 2. Ultrasonic follow
  • 3. Ultrasonic obstacle avoidance
  • 4. Ultrasonic obstacle avoidance (servo gimbal version)
  • 5. Infrared sensor obstacle avoidance
  • 6. Infrared remote control
  • 7. PS2 handle remote control
  • 8.K230 face tracking on PTZ
  • 9.K230 color tracking
  • 10.K230 Color Line Patrol
  • 11.K230 QR code command
  • 12.K230 machine code tracking
  • 13.K230 road sign indication action (voice)
  • 14.K230 color response (voice)
  • 15.K230 gesture control (voice)
  • 16.K230 Rock-Paper-Scissors Game (Voice)
6. Operation video
  • 1-How to install STM32CubeIDE software
  • 2-How to create Demo project
  • 3-How to download code into STM32 robot car
  • 4-How to open and compile a code file for STM32
  • 5-About IR control and Charge battery
Download
  • Code
  • SCH
  • Software File
  • STM32 Chip DataSheet
  • Installation manual
Download ZIP

Welcome to STM32-BoardCar repository

6. Internal temperature sensor(ADC)

Internal temperature sensor

Internal temperature sensor1、Software-Hardware2、Brief principle2.1、Hardware schematic diagram2.2、Physical connection diagram2.3、Principle of control3、Engineering configuration3.1、Tips3.2、Pin configuration4、Main functionsHAL library function parsing5、Experimental phenomenon

This tutorial demonstrates: getting real-time temperature from internal temperature sensor via ADC (ADC1_IN16) and printing battery voltage information via serial port (UASRT1) .

1、Software-Hardware

  • STM32F103CubeIDE

  • STM32机 robot expansion board

    ADC, USART, internal temperature sensor: chip internal peripherals

  • Type-C cable or ST-Link

    Download or simulate the program of the development board

2、Brief principle

2.1、Hardware schematic diagram

由于ADC、USART、内部温度传感器都是芯片内部外设,这里只展示串口相关接口

image-20231030115100474

2.2、Physical connection diagram

image-20231030121835824

2.3、Principle of control

The converted value of internal temperature is obtained through a single-channel ADC, and the value is converted into the actual temperature information and printed out through the serial port.

  • Internal temperature sensor

The STM32 has an internal temperature sensor that can be used to measure the temperature of the CPU and surrounding devices.

  • ADC conversion

Adc-related knowledge can be referred to [3. Development Board Basic Tutorial: Voltage Detection]

The internal temperature sensor is internally connected to the ADC1_IN16 input channel, which converts the voltage output of the sensor into a digital value.

()V=ValueThe number converted by the ADC∗(3.3)4096

Actual temperature:

;。V25=VSENSE:At 25 degrees Celsius;Avg_Slope:Average slope of the temperature versus VSENSE curve。

(Typical values are used here, and the calculated temperature is not exact, but it is possible to observe the temperature change)

℃T℃=V25−VSENSEAvg_Slope+25.0=1.43−V0.0043+25.0

3、Engineering configuration

Project Configuration: Prompt for configuration options during STM32CubeIDE project configuration

3.1、Tips

Omitted project configuration: New project, chip selection, project configuration, SYS for pin configuration, RCC configuration, clock configuration, and project configuration content

The project configuration part, which is not omitted, is the key point to configure in this tutorial.

xxxxxxxxxx
Please refer to [2, development environment construction and use: STM32CubeIDE installation - Use] to understand how to configure the omitted part of the project

3.2、Pin configuration

  • Configure the specified pin function

You can directly select the corresponding pin number in the pin view, and the corresponding option will appear when the mouse is left clicked

lQLPJwCL6R168dDNA-rNBE-w1poW_jTwcZIFMRlRnTDmAA_1103_1002

  • ADC

image-20231030144453024

  • USART

image-20231030144948117

image-20231030145015023

  • Clock Configuration

image-20231030003603356

  • Advanced Settings

image-20231030145238161

  • Generating code

image-20231030145217688

4、Main functions

This paper mainly introduces the functional code written by users. Detailed code can be opened by yourself in the project file we provide, and enter the Bsp folder to view the source code. .

HAL library function parsing

The HAL library functions that were covered in the previous tutorial will not be covered

xxxxxxxxxx
For information on how to parse the HAL and LL libraries that are covered throughout this tutorial, check out the documentation under the STM32 Manual: STM32F1_HAL and LL Library_ User Manual

function:HAL_ADCEx_Calibration_Start

Function prototypesHAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc)
Functional DescriptionStart the calibration process of the ADC
Input parametershadc:ADC handle address
Return valueHAL status value:HAL_OK、HAL_ERROR、HAL_BUSY、HAL_TIMEOUT

5、Experimental phenomenon

After downloading the program successfully, press the RESET button of the development board to open the serial debugging assistant to observe the phenomenon

xxxxxxxxxx
Program download can refer to [2, development environment construction and use: program download and simulation]

phenomenon:

The serial debugging assistant will print the following information:

  1. The value converted by the current ADC;

  2. The voltage converted according to the ADC value;

  3. Real-time temperature information from internal temperature sensor.

image-20231204180219278

 

Voltage detection (ADC)
Independent watchdog(IWDG)

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文