
Encoder
byrantech/laptop
anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

STM32F103C8 USB CDC thermometer project with PT1000 analog sensing and TMP117 I2C reference measurement, plus a desktop Python viewer for live plotting and filtering.
Tmp117 is an open-source printed circuit board by VlasovLabTech, from the VlasovLabTech/stm32_tmp117_PT1000_temperature repository on GitHub. It is a 2-layer board of 24 × 24.5 mm with 7 parts on 6 nets, routed with 58 tracks and 0 vias.
Its parts include 4 resistors, 1 capacitor, 1 IC and 1 connector. It belongs with the sensors and measurement boards of this library.
This project is a USB-connected temperature measurement setup for the STM32F103C8T6 BluePill board.
It combines:
The board connects to the PC directly over USB and enumerates as a virtual COM port. No separate USB-UART adapter is required.
The firmware runs on an STM32F103C8-based BluePill board and streams temperature data over USB CDC.
Current default behavior:
On the PC side, the included viewer can:
Reference specifications used here:
The PT1000 element used for this project is PT106052 / SA10200542 style: Pt1000, class B 0.12 %, 3850 ppm/C, with a specified operating range of approximately -50 C to +500 C.
This is the intended practical measurement range for the PT1000 channel.
The firmware uses a simple linear PT1000 approximation:
R(T) = R0 * (1 + 0.00385 * T)So the conversion is intentionally simple and integer-friendly for STM32F103. For better absolute accuracy across the full -50...500 C span, the next improvement would be a calibrated table or Callendar-Van Dusen conversion.
With the current divider value, the PT1000 range maps well into the 12-bit ADC input range:
| Temperature | Approx. PT1000 resistance | Approx. ADC code | Approx. ADC voltage at 3.3 V |
|---|---|---|---|
-50 C | 807.5 Ohm | 2749 | 2.22 V |
0 C | 1000.0 Ohm | 2550 | 2.06 V |
25 C | 1096.3 Ohm | 2460 | 1.98 V |
100 C | 1385.0 Ohm | 2226 | 1.79 V |
500 C | 2925.0 Ohm | 1477 | 1.19 V |
The ADC itself has much wider mathematical headroom, but the useful documented PT1000 range should be treated as -50 C to +500 C unless the sensor, mounting, wiring, and calibration are validated outside that range.
The TMP117 channel is intended for the TMP117 operating range: -55 C to +150 C.
In the current firmware, TMP117 is polled at 20 Hz, but the default USB stream sends PT1000 only. TMP117 output can be enabled in firmware with USB_STREAM_MODE_TMP117 or USB_STREAM_MODE_BOTH.
The PT1000 is connected as a simple divider from 3.3 V:
PA0 / ADC1_IN0Divider:
3.3V -> PT1000 -> PA0 -> 1.65k -> GND
The 1.65 kOhm resistor was chosen to place the expected -50...500 C PT1000 resistance range comfortably inside the ADC range while keeping useful sensitivity over the whole span. It is not a common single resistor value, so it can be made from two 3.3 kOhm resistors in parallel:
3.3k || 3.3k = 1.65kThe divider resistor is used directly by the firmware conversion. In main.c, the value is defined as PT1000_BOTTOM_RESISTOR_MOHM. It is stored in milliohms; the current nominal value is 1650000, meaning 1650.000 Ohm.
If better absolute accuracy is needed, measure the actual parallel resistance and put that value into PT1000_BOTTOM_RESISTOR_MOHM in milliohms.
If the PT1000 and the 1.65 kOhm resistor are physically swapped during assembly, the firmware can be switched without rewiring. Set PT1000_DIVIDER_PT1000_ON_TOP to 0 in main.c. Default is 1, meaning 3.3V -> PT1000 -> PA0 -> 1.65k -> GND.
Swapping the divider mostly reverses the ADC slope. Sensitivity and self-heating are nearly the same because the same two resistors are still in series. With the correct define, measurements remain valid; with the wrong define, the temperature will be badly wrong.
PB6 -> I2C1_SCLPB7 -> I2C1_SDA0x48Additional pins:
PB8 -> TMP117 ALERT input with external pull-upPB9 -> TMP117 ADD0 output, held low with external pull-downThe firmware uses the STM32 USB CDC device interface and appears on the PC as a virtual COM port.
Project-specific USB notes:
PB5 is used for the external USB reconnect/reset wiring1.5 kOhm pull-up to 3.3 VFirmware source is in:
Main application file:
ADC1 on PA0I2C1Current default build sends only PT1000:
PT1000=24.875 CWith line ending on the wire:
PT1000=24.875 C\r\nThe firmware can also send:
These modes are selected in main.c by the USB_STREAM_MODE define.
Typical options in the code:
USB_STREAM_MODE_PT1000USB_STREAM_MODE_TMP117USB_STREAM_MODE_BOTHExample combined line:
PT1000=24.875 C TMP117=24.937 CViewer file:
The viewer is intended for direct use with the BluePill USB CDC connection.
COM3OffEMASMAFollow latest modeAuto YShow allReset viewClear plotHelp button with built-in usage notesThere are two different filtering layers in this project:
Firmware PT1000 LPF
10 HzViewer software LPF
TMP117 currently has no firmware LPF. In the viewer, TMP117 can still be filtered in software for visualization.
The viewer accepts the current labeled firmware stream, for example:
PT1000=24.875 Cor:
PT1000=24.875 C TMP117=24.937 CIt also keeps compatibility with older single-value lines through the Single line selector in the UI.
The viewer can save CSV with these columns:
timestamp_s,pt1000_raw_c,pt1000_filtered_c,tmp117_raw_c,tmp117_filtered_cThe viewer uses:
PyQt6pyqtgraphpyserialExample install command:
pip install PyQt6 pyqtgraph pyserialRun the viewer with:
py temperature_viewer.pywOn Windows, you can also launch the .pyw file directly.
This firmware project is based on an STM32CubeIDE-generated STM32F103 project.
Main project file:
.ioc if neededIf the local Debug build directory already exists, the project can also be built with:
make -C TMP117_stm32f103c8/Debug allNote:
Debug/ is gitignoredInside the PCB folder:
Typical workflow:
ConnectUse this connection for the PT1000 divider:
BluePill 3V3 -> PT1000 -> PA0 / ADC1_IN0 -> 1.65k -> GNDThis is the default firmware setting:
#define PT1000_DIVIDER_PT1000_ON_TOP 1UIf the parts are swapped:
BluePill 3V3 -> 1.65k -> PA0 / ADC1_IN0 -> PT1000 -> GNDuse this firmware setting:
#define PT1000_DIVIDER_PT1000_ON_TOP 0UThe bottom resistor may be either:
single 1.65k resistoror:
two 3.3k resistors in parallelKeep the ADC node connected only to PA0, the PT1000, and the bottom resistor. Do not connect the divider to 5 V; the firmware assumes 3.3 V ADC reference behavior.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 4k7 | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1, R2, R3, R4 |
| 1 | 104 | Capacitor_SMD:C_1206_3216Metric | C1 |
| 1 | Conn_01x06 | Connector_Zhaoxing:Zhaoxing_VH_ZX-VH3.96-6PLT_1x06-1MP_P3.96mm_Vertical | J1 |
| 1 | TMP117xxDRV | Package_SON:WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mm | U1 |

byrantech/laptop
anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.



AxxAxx/AxxSolder
STM32 Based soldering station for JBC cartridges, 9-24 VDC and USB-PD power


jamro/tiny-engineer
A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.

hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

It measures 24 × 24.5 mm and has 2 copper layers, 1.6 mm thick.
7 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the VlasovLabTech/stm32_tmp117_PT1000_temperature repository on GitHub, at the commit this page was made from: the board is TMP117_PCB/tmp117/tmp117.kicad_pcb and its schematic TMP117_PCB/tmp117/tmp117.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask VlasovLabTech before reusing the design.