Skip to content

X-croot/LM35_XCR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LM35_XCR

A lightweight and easy-to-use Arduino library for interfacing with the LM35 temperature sensor.


resim

Overview

The LM35_XCR library allows you to read temperature data from an LM35 analog sensor in both Celsius and Fahrenheit. Designed to be simple and flexible, it supports projects requiring accurate temperature measurement with minimal code.


Features

  • Read temperature in Celsius or Fahrenheit
  • Lightweight and efficient
  • No external dependencies
  • Ideal for beginners and advanced Arduino projects

Hardware Requirements

  • Arduino board (UNO, Nano, Mega, etc.)
  • LM35 temperature sensor
  • Jumper wires

LM35 Pinout:

    +-----------+
    |           |
    |   LM35    |
    |           |
    +-----------+
    | 1 | VCC   |
    | 2 | OUT   |
    | 3 | GND   |
  • Connect VCC to 5V
  • Connect GND to GND
  • Connect OUT to any analog pin (e.g., A0)


Usage

Example Code

#include <LM35_XCR.h>

LM35_XCR sensor(A0);

void setup() {
    Serial.begin(9600);
}

void loop() {
    float temperatureC = sensor.readCelsius();
    float temperatureF = sensor.readFahrenheit();

    Serial.print("Temperature: ");
    Serial.print(temperatureC);
    Serial.print(" °C | ");
    Serial.print(temperatureF);
    Serial.println(" °F");

    delay(1000);
}

API Reference

Function Description
readCelsius() Returns the temperature in Celsius (°C).
readFahrenheit() Returns the temperature in Fahrenheit (°F).

About

LM-35 library

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages