782 BJT temperature sensor

782 : BJT temperature sensor

Design render

How it works

This is a BJT temperature sensor. It turns temperature into the ratio of two oscillator periods, so the reading does not depend on the absolute value of any capacitor, current or resistor on the chip. The numbers on this page come from post-layout simulation; the chip has not been measured yet.

Bandgap core. Two substrate PNP transistors carry the same current, one of them eight times larger (Q1 = 1 unit, Q2 = 8 units, in a 5 × 5 common-centroid array). Their base-emitter voltage difference is ΔV_EB = (kT/q)·ln 8, proportional to absolute temperature. A two-stage op-amp holds ΔV_EB across a resistor R1, which sets a PTAT current of about 2.77 µA at 25 °C. A PMOS current mirror copies that current through R3 = 10·R1 into a third PNP, Q3, which gives two voltages:

  • V_EB3, about 0.71 V at 25 °C, falling about 1.8 mV per °C
  • V_REF = V_EB3 + 10·ΔV_EB, about 1.24 V and nearly flat with temperature

R1 and R3 are built from 48 identical poly resistor units in one row (R1 = 4 units, R3 = 40 units, 4 dummies), so their ratio holds even though the absolute resistance drifts.

Readout. A relaxation oscillator charges a 5 pF capacitor with a copy of the PTAT current and resets it when it reaches a threshold. thr_sel picks the threshold: V_REF (thr_sel = 0) or V_EB3 (thr_sel = 1). The ramp time is proportional to the threshold, so the ratio

μ = 1 − T_EB / T_REF = 10·ΔV_EB / V_REF

cancels the capacitor, the charging current and the resistor temperature coefficient. Ideally μ is 0.429 at 25 °C and rises by 1.44 × 10⁻³ per °C.

Each period also contains a fixed dead time of about 105 ns (the comparator's delay plus the reset pulse), so the ratio read at the pin is a little lower: about 0.419 at 25 °C, rising by about 1.36 × 10⁻³ per °C. The half-slope mode (ich_sel) exists to measure that dead time on each chip and take it out. On the V_REF threshold the oscillator runs at about 200 kHz at 25 °C (175 kHz at −20 °C, 240 kHz at 100 °C).

The microcontroller on the demo board measures both periods by reciprocal counting and converts μ to temperature with a polynomial and a one-point trim.

Inputs (all inputs are 0 when the project is not selected: oscillator off, monitors off, normal slope and current):

Input Function
osc_en (ui[0]) Starts the oscillator.
thr_sel (ui[1]) Threshold: 0 = V_REF, 1 = V_EB3.
vref_mon_en (ui[2]) Connects V_REF to ua[0].
iptat_mon_en (ui[3]) Sends half the PTAT current (about 1.4 µA at 25 °C) out of ua[1].
ich_sel (ui[4]) Halves the charging current. Comparing μ at the two slopes removes the dead time from the result.
chop_sel (ui[5]) Swaps the op-amp inputs and its load (static chopping). The average of μ in the two states cancels the op-amp offset; their difference is an offset monitor.
ring_en (ui[6]) Starts three digital ring oscillators. Use only while osc_en = 0.
i3_sel (ui[7]) Runs Q3 at half current (V_REF falls to about 0.96 V): a self-check of the output branch and the PMOS mirror.

Outputs:

Output Function
osc_out (uo[0]) Toggles once per oscillator period: a square wave at half the oscillator frequency.
ringn_out (uo[1]) NAND2 ring divided by 32, about 7.5 MHz at 25 °C.
cmp_raw (uo[2]) The raw comparator output.
ringp_out (uo[3]) NOR2 ring divided by 32, about 6.6 MHz at 25 °C.
bg_ok (uo[4]) High once the bias currents are running. V_REF reaches its value within about 50 µs of a fast power-up.
ring_out (uo[6]) Delay-cell ring divided by 16, about 3.4 MHz at 25 °C. It follows the supply voltage (about 1.5 % per 10 mV).

The three ring outputs give a second, all-digital estimate of supply and temperature and a fingerprint of the process corner. Over process, supply and temperature expect them anywhere from 2.5 to 10 MHz.

Target accuracy is ±2 °C (3σ) from −20 to 100 °C after a one-point trim at 25 °C. Simulation over process corners, supply and Monte Carlo mismatch predicts about ±1.3 °C at 100 °C and ±0.9 °C at −20 °C. The project draws about 29 µA from 1.8 V at 25 °C with the oscillator running.

How to test

On the Tiny Tapeout demo board (RP2350, MicroPython SDK):

  1. Select the project and wait at least 1 ms. Check that bg_ok (uo[4]) is 1.
  2. Set ui_in = 0b00000001 (osc_en = 1, thr_sel = 0, V_REF threshold). osc_out (uo[0]) is a square wave of about 100 kHz at 25 °C.
  3. Discard the first 8 oscillator periods, then measure the duration of M = 256 oscillator periods (128 cycles of osc_out) with a fast counter, for example a PIO state machine counting system-clock cycles. This is N_REF.
  4. Set ui_in = 0b00000011 (thr_sel = 1, V_EB3 threshold), discard 8 periods, and measure N_EB the same way.
  5. Compute μ = 1 − N_EB / N_REF. Expect about 0.42 at room temperature.
  6. A first estimate before calibration: T ≈ 25 + (μ − 0.419) / 0.00136 °C.

For a better reading, take the dead time out with the half-slope mode:

  1. Repeat steps 2–5 with ich_sel = 1 (ui_in = 0b00010001, then 0b00010011). The periods are about twice as long. This gives μ_half.
  2. Compute 1/μ0 = 1/μ_half − k·(1/μ − 1/μ_half) with k ≈ 1.35. Expect μ0 of about 0.426 at 25 °C, and T ≈ 25 + (μ0 − 0.426) / 0.00141 °C.
  3. Repeat with chop_sel = 1 and average the two μ0 values to cancel the op-amp offset.

For the calibrated reading, fit a polynomial T(μ0) and trim it once at a known temperature with a reference thermometer next to the chip.

Ring oscillators (optional): with osc_en = 0, set ui_in = 0b01000000 and count edges on uo[1], uo[3] and uo[6] for 1 ms each.

Analog monitors (optional):

  • ua[0], with vref_mon_en = 1: V_REF, about 1.24 V. It is a high-impedance node (about 200 kΩ), so do not load it: disconnect the demo board's pull-down on this pin and use a meter with at least 1 GΩ input resistance (it then reads about 0.25 mV low). Closing this switch disturbs V_REF for about 20 µs, so do not change it during a conversion.
  • ua[1], with iptat_mon_en = 1: about 1.4 µA at 25 °C. Measure it as the voltage across a resistor of 100 kΩ or less to ground (about 140 mV on 100 kΩ).

External hardware

  • Tiny Tapeout demo board
  • A reference thermometer for the one-point trim (a temperature chamber or hot plate for checks at other temperatures is optional)
  • Optional: a voltmeter with at least 1 GΩ input resistance for ua[0], and a resistor of 100 kΩ or less to ground for ua[1]

IO

#InputOutputBidirectional
0osc_enosc_out
1thr_selringn_out
2vref_mon_encmp_raw
3iptat_mon_enringp_out
4ich_selbg_ok
5chop_sel
6ring_enring_out
7i3_sel

Analog pins

uaPCB PinInternal indexDescription
0R10vref_mon
1Q11iptat_mon

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Analog Mux Mux Mux Mux Analog Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_barakhoffer_chargepump27 (5V Cross-Coupled Charge Pump) tt_um_marzmmp_adama_plasticity (ADAMA-1 Plasticity Core) tt_um_asic1b_dsp (ASIC-1B Open-Source DSP Integration — Qualification Only) tt_um_ew_iqmag (ASIC-1A Signed IQ Magnitude-Squared Accelerator) tt_um_serialdev_sloth_stream (Sloth one Qwen neuron and three slices) tt_um_LnL_ringosc (Programmable Ring Oscillator) tt_um_aesa_brain (AESA Digital Brain) tt_um_kennanlau_aesa_brain_v2 (AESA Digital Brain) tt_um_jhkong_vco (Current-starved ring VCO + divider (silicon vs. simulation)) tt_um_kennanlau_beam_steer (AESA Beam Steering Engine) tt_um_tiny_breakout (Tiny Breakout) tt_um_jonahss_msac (openav1 msac: the AV1 arithmetic decoder) tt_um_VCOerik1567 (Digitally Band-Switched VCO) tt_um_hft_1 (HFT Challenge 1) tt_um_jambu_fmbearmf (jambu) tt_um_not_so_tiny_sparse_acc_ramzxc (rSPARK) tt_um_sphatika11_minitage (Mini-TAGE Branch Predictor (1x1, single TAGE table)) tt_um_2048 (Hardware-Accelerated-2048-VGA-Game) tt_um_cordic (Cordic Processor) tt_um_EV_Charging_CTRL (EV Charging Controller) tt_um_project_fpu (Parameterized_FPU_Adder_Subtractor) tt_um_dino (Dino-Inspired-VGA-Obstacle-Avoidance-Game) tt_um_systolic_mm (Systolic Array - 4x4 Matrix Multiplier) tt_um_pulse_stretcher (Programmable Digital Pulse Stretcher) tt_um_reyhaha999_skykey (SkyKey) tt_um_bh_gc_memory (Gain-cell eDRAM: 112 x 8 bits, byte writes) tt_um_fc_pong_ai (Pong vs Quantized AI) tt_um_janane2802_mac_unit (MAC Unit) tt_um_sidisnotacoder_shadowstack (Zicfiss-inspired Shadow Stack Monitor) tt_um_izaiah_thigpen_sparse_conv (SJSU Sparsity-Aware Convolution Core) tt_um_tmartins_ro_puf_v8 (RO-PUF V8 - 64 ROs Dual Ripple Counter) tt_um_tiny_breakout_pave (Tiny Breakout (Paved)) tt_um_rakesh_tiny_nfc (tiny_nfc - ISO14443A NFC Type 2 tag (mixed-signal)) tt_um_rakesh_tiny_kws (tiny_kws: PDM-mic keyword spotter with streamed GRU) tt_um_adpll_dco (ADPLL DCO test chip) tt_um_Sumedh350_dot4 (DOT4: A Custom INT8 Dot-Product Instruction for RISC-V Edge-AI) tt_um_eleva_ccro_adc (CCRO differential VCO ADC) tt_um_sidisnotacoder_approx_mult (Approximate vs. Exact 8x8 Multiplier) tt_um_joaopedro_ro_puf_v8 (RO-PUF V8 - 64 ROs Dual Ripple Counter (João Pedro)) tt_um_alu4 (4-bit ALU) tt_um_i3cbridge (Minimal I3C target to I2C bridge) tt_um_nityashah1811_cnn_accel (CNN Conv Accelerator) tt_um_armohamed_r2rvc (SKY130 Voltage Comparator Prototype) tt_um_jamesrosssharp_high_speed_comp (High Speed Comparator YOLO) tt_um_janane2802_divcounter (Glitch-Free Divider + Gated Frequency Counter) tt_um_prasa_droop_monitor (On-Chip Supply-Droop Timing Monitor) tt_um_armohamed_tdc12 (12-bit pulse-width time-to-digital converter) tt_um_zec_square1 ("SQUARE-1": VGA/audio demo) tt_um_yodalee_tinyaes (ttsky_tiny_aes) tt_um_rt5w_attn (RT5W analog attention head (QK^T + softmax, on-die SS-SGD)) tt_um_sensor_monitor (Sensor Covariance Anomaly Detector) tt_um_deeksha5334_timing_margin (On-chip timing-margin sensor) tt_um_wokwi_481584708677923841 (memecycler) tt_um_charlieplex (Single-wire 8x8 Charlieplex LED controller) tt_um_duarte_diamantino_lifi_tx (Reconfigurable LiFi Transmitter (OOK / Manchester / 4-PPM)) tt_um_mnist8 (MNIST 8x8 digit classifier) tt_um_wokwi_481583898817310721 (Tiny Tapeout Template by DSJM) tt_um_wokwi_481590988497887233 (Tiny Tapeout Template Copy) tt_um_duarte_diamantino_pid8 (8-bit Digital PID Controller) tt_um_wokwi_481590657199122433 (Tiny Tapeout Template Copy) tt_um_dinis_aes256 (AES-256 iterative GF S-box) tt_um_wokwi_481588972466141185 (Ines woki design 4) tt_um_wokwi_481591934277017601 (2-bit Magnitude Comparator with 7-Segment Display) tt_um_wokwi_481584895163029505 (Tiny Tapeout ) tt_um_duarte_diamantino_blocos (Blocos: 8x8 falling-block game on VGA) tt_um_wokwi_481849947835978753 (8-bit Arbiter PUF 2) tt_um_wokwi_481590741896846337 (Tiny Tapeout Template Copy) tt_um_wokwi_481774177156248577 (Seven_Seg_Disp_Hello_ISEL_ISEL_display_v5) tt_um_wokwi_481590548148238337 (3bitCycler) tt_um_wokwi_481592066634608641 (Tiny Tapeout - 'my hello world' Copy) tt_um_wokwi_442987575358494721 (Tiny Tapeout Template-Loibingdorfer Copy) tt_um_mbacvanski_analog_eqprop (Analog equilibrium propagation: three neurons, six learnable weights) tt_um_huanprojects_tsense (BJT temperature sensor) tt_um_tillwitt_dac8r (8-bit current-steering DAC with on-chip reference, serial trim/code interface and temperature sensor (revision 2)) tt_um_rudresphotos_sram (SKY130 SRAM 32x8 (OpenRAM, custom StrongARM sense amp)) tt_um_riskgate_ml (RiskGate-ML: Pre-Trade Risk Gateway with On-Chip ML) tt_um_tjfreeborn1_cpe_a07a05 (Fractional-order capacitors with α = 0.7 and 0.5) tt_um_bennett_miller_4_bit_arc_angel_alu (4-Bit ALU Akron Research Company Arc Angel) tt_um_polite_mini (POLITE Mini) tt_um_jlvsdlv_ecg (Sub-uVrms 1-uW GOhm-input ECG amplifier) tt_um_mbotros_diff_amp_lvt (Differential amplifier (LVT NMOS, 1.8 V)) tt_um_wokwi_481590405529284609 (Baby's First Counter) tt_um_icieq (ICIEQ Analog Gate Driver) tt_um_toksaitov_almurut2 (Almurut II) tt_um_nikhil_a_e_conv (Reconfigurable MAC-Based Convolution Engine) tt_um_rayforge_3d (RayForge-X: Analytic VGA Scene Renderer) tt_um_harshilkundety_ro_trng (Ring-Oscillator Jitter TRNG) tt_um_priority_arbiter_8bit (8-Bit Parallel-Prefix Priority Arbiter) tt_um_pranavhegdee_sparse_lif (Sparse Event-Driven LIF Neurons) tt_um_rvce_uart_crc_cmd (CRC-protected UART Command Interface) tt_um_wokwi_481521554867536897 (8-bit Arbiter PUF) tt_um_wokwi_481591140137746433 (Baby's First Counter Final) tt_um_wokwi_481770524049471489 (test) tt_um_wokwi_442977436543634433 (Nico_Design) tt_um_wokwi_481770605701073921 (2bits_MovingAverage) tt_um_dinisoliv_systolic_array (Tiny Systolic Array) tt_um_lrama_spatial_sd (Space-time sigma-delta for a 6-element array) tt_um_wokwi_481771282255144961 (Tiny Tapeout Ripple Adder) tt_um_umigv_sensorfusion (UMARV sensor fusion) tt_um_mcap_rx_uart (M-CAP digital receiver with UART) tt_um_wokwi_481771090722193409 (3 Bit Adder with 2 bit Inputs Copy) tt_um_wokwi_481771306715289601 (HEX to 7SegDisplay) tt_um_wokwi_481771457225837569 (Tiny Tapeout Template (BCD Decoder)) tt_um_wokwi_481772106444550145 (Tiny Tapeout Template DEEPASINGH) tt_um_crypto_otp (Crypto OTP) tt_um_wokwi_481770518345213953 (Tiny Tapeout Template Copy) tt_um_wokwi_480337522217648129 (TBMPPT) tt_um_openblastcore32_tt16 (OpenBlastCore32-TT16b TBLEND) tt_um_sofiainacio_adpll (All-Digital PLL Demonstrator) tt_um_wokwi_481522334865641473 (trng) tt_um_wokwi_481591026011755521 (Davod) tt_um_wokwi_481584898812076033 (Design do Mikas) tt_um_pedrorito_eq (Tiny Graphic EQ) tt_um_wokwi_481436559394914305 (SLIPT Manchester Receiver) tt_um_tmdias_traffic_light_controller (Traffic Light Controller) tt_um_wokwi_481591230948654081 (Tiny Tapeout Template Copy) tt_um_wokwi_481590770568078337 (Tiny Tapeout Template Copy) tt_um_ayush_hegde_uart_tx (8-Bit UART Transmitter (8N1, 9600 baud)) tt_um_pryzm_cordic (PRYZM CORDIC-16) tt_um_flex_mac (Flexible 8-bit Streaming MAC) tt_um_arcadia1_vco_adc (2nd-order VCO Delta-Sigma ADC) tt_um_dsx99_ro_puf (RO-PUF readout chip) tt_um_fcapz_ela_tile (fcapz_ela_tile) tt_um_1marcb_jamguard (JAMGUARD DSSS Anti-Jam Link) tt_um_sclw_dual_lfsr (Dual Cross-Coupled LFSR) tt_um_srcejon_adc_dac (8-bit ADC and DAC) tt_um_nityashah1811_snn_mnist (SNN MNIST Digit Classifier) tt_um_tmartins_ro_trng_12x8 (12x8 Ring Oscillator TRNG - Raw Bit Sampler) tt_um_im2col_tm (Bunny-CNN-Accelerator) tt_um_async_fifo (Async FIFO with Gray Code CDC (2-Flop Synchronizer)) tt_um_tmr_secded_alu (Fault-Tolerant TMR + SECDED ALU) tt_um_phaneeswar2006_prog (Dead-Time PWM Controller) tt_um_rvce_secded_ecc (SEC-DED Hamming ECC Encoder/Decoder) tt_um_cokane_soc (CoKANE NPU) Micro tile container tt_um_microtile_group_1 tt_um_alfadelta10010_pocketchords (PocketChords: SNES chord arpeggiator), micro tile slot 132/0 tt_um_xy_spirograph (XY Spirograph), micro tile slot 132/1 tt_um_leowang_micro_apu (MicroAPU), micro tile slot 132/2 tt_um_mc14500b_micro (MC14500B 1-bit Microcontroller (micro tile)), micro tile slot 132/3 tt_um_rvce_cordic (CORDIC Sine/Cosine Generator) tt_um_robutler_dbg (REDA debug tile) tt_um_quevedol_serv_tinyml (SERV TinyML SoC) tt_um_psidethename_vltpe (VL-TPE: Variable-Latency Telescopic Priority Encoder) tt_um_rohan_j_r_adaptive_adder (Data-Aware Adaptive Approximate 16-bit Adder) tt_um_sa3x3_int8int4 (SPI Precision-Scalable INT8/INT4 3x3 Systolic Array) tt_um_radmac (RadMAC) tt_um_joeycastillo_lcd (4x12 segment LCD driver) Micro tile container tt_um_microtile_group_2 tt_um_MaligayangPasko (Maligayang Pasko! (Christmas tree in a micro tile)), micro tile slot 198/0 tt_um_wokwi_481740336442682369 (Quiz Bee Buzzer Switch), micro tile slot 198/1 tt_um_pettit_micro (Micro Munch (VGA demo in a micro tile)), micro tile slot 198/2 tt_um_pettit_adpcm (Micro ADPCM (streaming audio decoder in a micro tile)), micro tile slot 198/3 Micro tile container tt_um_microtile_group_3 tt_um_wokwi_481767137105960961 (tt_um_pettit_microsnake), micro tile slot 200/0 tt_um_pettit_microcpu (MicroCPU (a bit-serial 4-bit CPU in a micro tile)), micro tile slot 200/1 tt_um_pranav0x2212_tiny_piano (Tiny Piano), micro tile slot 200/2 tt_um_micro_pio (microPIO), micro tile slot 200/3 tt_um_rishabhrkaushik_fractal_generator_gamepad_SPI (Fractal Generator with Gamepad and SPI) tt_um_howardlee_tinyscope32 (TinyScope-32) tt_um_space_brain (Space Brain) tt_um_vinay_mem_access (Self-testing atomic banked memory) tt_um_configurable_pwm (Configurable Multi-Mode PWM Generator) tt_um_htfab_presenter (VGA Presenter) tt_um_rvce_2ff_sync (2-FF Synchronizer / Clock-Domain-Crossing Demo) tt_um_vaishnavipatil5_configurable_multiplier_mac (Customizable Exact and Approximate Multiplier with MAC) Micro tile container tt_um_microtile_group_4 tt_um_astrok_micro_chiptune (Micro Chiptune), micro tile slot 937/0 tt_um_wokwi_481793265415286785 (tt_um_pettit_micropwm), micro tile slot 937/1 tt_um_urish_micro_simon (micro Simon Says memory game), micro tile slot 937/2 tt_um_robutler_mcpu8dac (MCPU8 DAC: 8-bit CPU with a sigma-delta DAC), micro tile slot 937/3 tt_um_yangzhou08_tetris (Tetris player (on-chip placement search, board features and neural network)) tt_um_yangzhou08_mnist (MNIST digit classifier (binary/ternary CNN, all weights in logic)) tt_um_yangzhou08_pusht (Push-T visuomotor policy (image moments + hardwired MLP)) tt_um_yangzhou_tetris (Tetris skyline player with serial debug scan) tt_um_pusht_servo (Push-T visual servo with serial debug scan) tt_um_compact_digit (Pooled handwritten digit classifier with serial debug scan) tt_um_dinis_chacha20_V2 (ChaCha20 1QR byte-interface baseline) tt_um_i2c_des (I2C_DES) tt_um_tskurata354_serv4_tdc (SERV4 RF4 with 16-stage TDC) tt_um_bomu_mthanson1 (BoMu resistively-loaded NMOS diff amp, 1.2V series-dropper supply + i_trim) tt_um_tinymppt (TinyMPPT) tt_um_totara_zn417q (ZN417Q-style AM receiver with differential tap) tt_um_Zero_Drift_Opamp (Zero-Drift Amplifiers) tt_um_sunrise_rv32i (32 Bit In Order 5 Stage RISC V CPU) tt_um_tarun135678_crc16 (Configurable CRC-16 Hardware Engine) tt_um_nitikac24_hchoi2927_pagerank (Markov Chain - PageRank) tt_um_vikaskumart176_fp16_nr_div (Newton-Raphson Divider) tt_um_yiminglu_tinydsp8 (TinyDSP-8) tt_um_harinarayanans2006_fifo32 (8x32 FIFO with almost-full/empty) tt_um_seeded_prng (8-bit LFSR Random Number Generator) tt_um_mealycpp_geb (GEB-ATOM: run-time splittable Keccak core) tt_um_priyaasuti_sea (SEA-24/4 Lightweight Block Cipher) tt_um_zarif_systolic (VGG16 2D Systolic Array (4-bit, weight-stationary)) tt_um_bdawg4113_armv6m (ARMv6-M style multicycle CPU) tt_um_ageorgis_aigaionpu (AigaioNPU) tt_um_leowang_tpu (tiny-tpu) tt_um_VRA_CPU (VRA CPU) tt_um_sul_tan1_nanogpu (NanoGPU) tt_um_hybrid_crypto_sel (Hybrid Crypto Selector (SIMON-32/64 + AES/SIMON selection logic)) tt_um_vga_sd_proto (SD-to-VGA Animation Player) tt_um_cursedrock17_adc (8-bit ADC) tt_um_franktype_dda (DDARaycaster) tt_um_kianv_rv32_regfile (KianV uLinux RISC-V regfile edition) tt_um_urish_simon (Simon Says memory game) tt_um_mmalpha (MMAlpha integer matrix multiplier Design02) tt_um_justice_lif (LIF Spiking Pattern Generator) tt_um_atompu_s1 (ATOMPU Silicon 1) tt_um_tinyfpga (TinyFPGA: 4x LUT4 with SPI config) tt_um_strider93_lif (LIF Neuron PE (CSNN accelerator)) Available