Saturday, March 2, 2024

Including Temperature Sensor Performance To The CH32V003 MCU

Plot of the temperature measurement using the improvised CH32V003 -based temperature sensor. (Credit: eeucalyptus)
Plot of the temperature measurement utilizing the improvised CH32V003 -based temperature sensor. (Credit score: eeucalyptus)

As low-cost because the WCH CH32V003 MCU is, its roughly $0.10 price ticket seems to be far much less engaging when it is advisable begin including on exterior ICs for lacking fundamental options, reminiscent of temperature measurement. This can be a characteristic that’s generally discovered on even fundamental STM32 MCUs. Concern not although, as [eeucalyptus] exhibits, you possibly can improvise a working answer by discovering various sources that may act as a thermometer.

The CH32V003 is a low-end, 32-bit RISC-V-based MCU by the China-based Nanjing Qinheng Microelectronics, generally identified abbreviated as ‘WCH’, and featured on Hackaday beforehand. Though it incorporates a single-core, 48 MHz CPU, its number of peripherals is pretty fundamental:

Internal diagram of the CH32V003 MCU. (Credit: WCH)
Inside diagram of the CH32V003 MCU. (Credit score: WCH)

So how do you create an inner temperature sensor utilizing simply this? [eeucalyptus] figured that each one that’s wanted is to measure the drift between two inner clocks – such because the LSI and HSI – as temperatures change and use this to calibrate a temperature graph. Sadly, the LSI isn’t readily accessible, even by way of the Timer peripheral. This left the AWU (computerized wake-up unit) which additionally makes use of the LSI as a clock supply. By letting it fall asleep and get up after N LSI cycles, the AWU enabled oblique entry to the LSI.

After calibrating towards room temperature (~22 °C) and ice water (0 °C), a temperature plot was obtained, which might conceivably be considerably correct. As [eeucalyptus] warns, it is a form of calibration that probably differs per MCU, and no try to quantify absolutely the accuracy of this technique has been made but. Even so, as a crude temperature measurement, it would simply be ok.

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles