What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

An STM32F401 can read an LM35’s analog output with its ADC, convert the sampled voltage to temperature, and transmit formatted readings over USART/UART. The exact ADC pin, serial pins, reference voltage, and board setup depend on the specific STM32F401 package and development board, so verify those before wiring or configuring firmware.

How the temperature-monitoring system works

The LM35 is an external analog temperature sensor, not a UART or other digital-output sensor. Its output voltage varies with temperature. The STM32F401 samples that voltage through an ADC-capable input, firmware converts the ADC result to voltage and then temperature, and a USART/UART connection sends the result to a host such as a computer.

  1. Sense: Connect the selected LM35 variant’s output to a compatible STM32F401 ADC input, following the sensor’s datasheet for supply, pinout, and electrical limits. The sensor and MCU need a suitable shared ground reference.
  2. Convert: Use the ADC reading, configured resolution, and effective ADC reference to calculate input voltage. Apply the transfer relation specified for the exact LM35 model to convert that voltage into temperature.
  3. Report: Format the calculated reading in firmware and transmit it through a configured USART/UART interface. A host-side serial interface is needed to view the data.

Choose pins and board before wiring

ST documents the STM32F401 family with a 12-bit ADC and USART interfaces. That establishes the MCU family’s relevant capabilities, not a universal pin assignment: ADC channels and USART alternate-function pins vary with the exact MCU suffix, package, and board routing. Consult the datasheet and reference manual for the selected part, along with the development board schematic or pinout, before choosing pins. ST’s STM32F401 documentation page includes family resources and lists the NUCLEO-F401RE as an example board; that is not a recommendation that every setup use it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Whether a separate USB-to-TTL serial adapter is necessary also depends on the board. Check whether it routes an onboard USB connection to a serial interface before adding external hardware. Neither an adapter nor a particular baud rate is inherent to the project title.

#1 Best Overall
EC Buying 3Pcs STM32F401CCU6 STM32 Minimum Core System Learning Development Board Module STM32F4 STM32F401 ARM Cortex-M4 Type-C 256 Kbytes Flash Memory
  • Frequency up to 84 MHz
  • 512 bytes of OTP memory
  • Up to 256 Kbytes of Flash memory
  • Frequency up to 84 MHz
  • STM32F401 development board

Convert ADC readings without assuming the reference

For an N-bit ADC, the idealized count-to-voltage calculation is approximately Vin = ADC count × Vref / (2N − 1). For a 12-bit conversion, the full-scale count is 4095. The value of Vref must reflect the reference actually used by the selected setup; do not assume it from the microcontroller name or substitute the MCU’s internal reference specification without confirming the ADC configuration.

Then use the transfer behavior in the datasheet for the exact LM35 variant to convert voltage to degrees. Do not infer project-level accuracy from a nominal conversion formula. The final result depends on sensor variation, ADC behavior, reference accuracy, wiring and noise, and any calibration. TI’s LM35 product information lists typical accuracy of ±¼°C at room temperature and ±¾°C across −55°C to 150°C; those are product-page typical-accuracy claims, not guaranteed accuracy for a complete STM32 project.

Rank #2
EC Buying 2Pcs STM32F411CEU6 Development Board STM32F4 Core STM32F411CEU6 Module System Board Learning Board 100Mhz Freq 128KB RAM 512KB ROM for Programming
  • Experience the power of the ARM Cortex M4 with this STM32F411CEU6 Development Board, featuring a blazing fast 100Mhz frequency and zero-wait state access to 512KB ROM and 128KB RAM for seamless programming
  • Unlock endless possibilities with the STM32F4 Core STM32F411CEU6 Module System Board, equipped with FPU floating-point unit for efficient calculations and a plethora of interfaces including USART, I2C, SPI, and USBFS for versatile connectivity options
  • Dive into the world of embedded systems with this Learning Board, boasting 20 Pin 2.54mm I/O interfaces, 4 Pin 2.54mm SW debugging interface, and user-friendly buttons like KEY (PA0), NRST, and BOOT0 for convenient operation and development
  • Stay powered up and connected with the 3.3V-5V power input, 3.3V LDO with a maximum output current of 100mA, and a USB-C interface with built-in diode to prevent power backflow, along with high-speed and low-speed crystal oscillators for reliable performance
  • Elevate your programming projects with the STM32F411CEU6 Development Board, featuring a SPI Flash for additional storage options, 12-bit ADC, 12-bit 5 S for accurate measurements, and 32.768K 6pF low-speed crystal oscillator for precise timing control

Configure ADC and serial communication

ADC setup

Set up the ADC channel corresponding to the chosen analog pin and configure its conversion sequence and sampling time for the signal and source impedance. ST’s reference manual and datasheet contain the applicable ADC guidance; the exact external-input requirements depend on the circuit and selected device. The F401 reference manual also discusses sampling-time requirements for internal channels, but those instructions should not be confused with a completed configuration for an external LM35 input.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the ADC resolution and reference used in firmware consistent with the voltage calculation. If readings appear unstable or implausible, first confirm the selected channel and pin mapping, reference assumption, ground connection, and sampling configuration before changing the temperature equation.

Rank #3
DORHEA 3Pcs STM32F401 Development Board V3.0 STM32F401CCU6 STM32F4 Learning Board 84Mhz Freq 64KB RAM 256KB ROM for Programming
  • STM32F401CCU6 84Mhz, 64KB RAM, 256KB ROM
  • 25MHZ high speed crystal oscillator & 32.768khz 6PF low speed crystal oscillator
  • STM32F401CCU6 support for MicroPython programming with available MicroPython firmware; Support for programming development; Support C language programming development
  • STM32F401CCU6 there are 3 buttons, reset key, BOOT0 key, user key

USART/UART setup

Choose a USART instance and its alternate-function pins that are available on the exact package and accessible on the board. Configure matching serial settings at both ends, including baud rate and frame format; these are implementation choices, not values established by the component-family capability alone. If the computer does not receive readable output, check pin routing, host interface, and whether the two ends use the same serial settings.

Keep the MCU’s internal temperature sensor separate

The STM32F401 also has an on-die temperature-sensor channel, but it is distinct from the external LM35. STMicroelectronics says in RM0368 Rev 6 that “The internal temperature sensor is more suited for applications that detect temperature variations instead of absolute temperatures.” That caution applies to the MCU’s internal sensor, not to the LM35.

Rank #4
STM32F401 Development Board STM32F401CCU6 STM32F4 Learning Board 84Mhz 64KB RAM 256KB
  • STM32F401 Development Board STM32F401CCU6 STM32F4 Learning Board 84Mhz 64KB RAM 256KB

ST’s DS9716 Rev 11 (2019) gives the internal sensor an average slope of 2.5 mV/°C and a typical output voltage of 0.76 V at 25°C. The same datasheet specifies the internal reference voltage as 1.18 V minimum, 1.21 V typical, and 1.24 V maximum under its stated conditions. These are MCU specifications, not LM35 characteristics and not evidence of which reference a particular board uses for its ADC.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What this setup does—and does not—establish

The architecture provides a straightforward path from an analog sensor reading to serial telemetry, but a component pairing alone does not establish a working pinout, firmware implementation, sampling interval, baud rate, or measured accuracy. Those details must be determined for the exact board and circuit. Treat any displayed temperature as a calculated reading whose accuracy depends on the sensor, ADC reference and behavior, electrical setup, and calibration.

Quick Recap

Bestseller No. 1
EC Buying 3Pcs STM32F401CCU6 STM32 Minimum Core System Learning Development Board Module STM32F4 STM32F401 ARM Cortex-M4 Type-C 256 Kbytes Flash Memory
EC Buying 3Pcs STM32F401CCU6 STM32 Minimum Core System Learning Development Board Module STM32F4 STM32F401 ARM Cortex-M4 Type-C 256 Kbytes Flash Memory
Frequency up to 84 MHz; 512 bytes of OTP memory; Up to 256 Kbytes of Flash memory; Frequency up to 84 MHz
$14.99
Bestseller No. 3
DORHEA 3Pcs STM32F401 Development Board V3.0 STM32F401CCU6 STM32F4 Learning Board 84Mhz Freq 64KB RAM 256KB ROM for Programming
DORHEA 3Pcs STM32F401 Development Board V3.0 STM32F401CCU6 STM32F4 Learning Board 84Mhz Freq 64KB RAM 256KB ROM for Programming
STM32F401CCU6 84Mhz, 64KB RAM, 256KB ROM; 25MHZ high speed crystal oscillator & 32.768khz 6PF low speed crystal oscillator
$15.99
Bestseller No. 4
STM32F401 Development Board STM32F401CCU6 STM32F4 Learning Board 84Mhz 64KB RAM 256KB
STM32F401 Development Board STM32F401CCU6 STM32F4 Learning Board 84Mhz 64KB RAM 256KB
STM32F401 Development Board STM32F401CCU6 STM32F4 Learning Board 84Mhz 64KB RAM 256KB
$7.61
Bestseller No. 5
STM32 Nucleo Development Board with STM32F446RE MCU NUCLEO-F446RE
STM32 Nucleo Development Board with STM32F446RE MCU NUCLEO-F446RE
On-board ST-LINK/V2-1 debugger/programmer with SWD connector; Can be powered from USB; Three LEDs, Two Push-buttons
$33.11
Best Value
STM32 Nucleo Development Board with STM32F446RE MCU NUCLEO-F446RE
  • High-performance foundation line, ARM Cortex-M4 core with DSP and FPU, 512 Kbytes Flash, 180 MHz CPU, ART Accelerator, Dual QSPI
  • On-board ST-LINK/V2-1 debugger/programmer with SWD connector
  • Can be powered from USB
  • Three LEDs, Two Push-buttons
  • Support of wide choice of Integrated Development Environments (IDEs) including IAR, ARM Keil, GCC-based IDEs

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.