LCENJ LM35DZ examples - 2026-09-15
Targets: classic ESP32 (esp32:esp32:esp32) and Arduino Uno R3 (arduino:avr:uno).
No additional library. Serial 115200. Separate each .ino into its matching folder.
LM35DZ LP/TO-92 pin numbering must be checked against TI datasheet BOTTOM VIEW.
Pin 1 +VS: regulated 5V; pin 2 VOUT: GPIO34 / Uno A0; pin 3 GND: shared ground.
100 nF supply bypass between +VS and GND, close to sensor. No external AREF.
Never put 5V on an ESP32 GPIO. Verify sensor output with a meter before connecting.
UNO_VREF_MV=0 intentionally prevents unconfigured temperature conversion.
Measure board 5V-to-GND with a meter under normal load and configure actual mV.
16-sample average, 20 ms sample period, 15..90 C educational application window.
Window is not the sensor rating or a reliable disconnected-sensor detector.
No heater/relay control. No medical/fire-safety use. Physical hardware not tested.
Raw and calibrated readings in the raw ESP32 sketch are separate conversions.


Revision 2026-11-13: Both sketches set global analogSetAttenuation(ADC_2_5db) before the first ADC conversion in this single-channel example. Adding other analog channels requires a review of their attenuation needs. The old per-pin-before-initialization call was removed.
Compilation only: main and raw sketches compiled for arduino:avr:uno with Arduino AVR1.8.8 and esp32:esp32:esp32 with Arduino-ESP32 3.3.10, arduino-cli1.5.1. No sensor connected, firmware upload or physical test performed. UNO_VREF_MV must still be configured from a measured supply; zero intentionally disables temperature conversion.
