කලාව
රූපලාවණ්‍ය සහ සුවතාව
ශිල්පය
සංස්කෘතිය සහ ඉතිහාසය
විනෝදාස්වාදය
පරිසරය
ආහාර සහ පාන
ප්‍රතිලෝම ඉංජිනේරු
විද්‍යාවන්
ක්‍රීඩා
තාක්ෂණය
පැළඳිය හැකි
Reading a Temperature Sensor — SIK Circuit 7
Ed

නිර්මාතෘ

Ed

17. මාර්තු 2026FI
91
0
0
0
0

Reading a Temperature Sensor — SIK Circuit 7

Read temperature from a TMP36 sensor and display Celsius and Fahrenheit readings on the Serial Monitor. Your introduction to serial communication and real-world data.

උපදෙස්

1

Parts & Introduction

The TMP36 is an analog temperature sensor that outputs a voltage proportional to temperature. You'll learn to use the Serial Monitor to display real-time readings — an essential debugging tool.

Parts Needed

  • 1x Arduino Uno + USB cable
  • 1x Breadboard
  • 1x TMP36 Temperature Sensor
  • 5x Jumper Wires

Warning: The TMP36 looks similar to the transistor. Look for "TMP" in tiny letters and a triangle logo. The transistor has "222" printed on it. Inserting the wrong component can damage it!

මෙම පියවර සඳහා ද්‍රව්‍ය:

SparkFun Inventor's Kit - V3.2SparkFun Inventor's Kit - V3.21 කට්ටලය

අවශ්‍ය මෙවලම්:

Arduino IDE සහිත පරිගණකයArduino IDE සහිත පරිගණකය
2

Hardware Hookup

Wiring Instructions

With the TMP36 flat side facing you and pins pointing down, the pins are (left to right): 5V, Signal, GND.

  1. Connect the left pin to 5V.
  2. Connect the middle pin (signal) to Analog Pin A0.
  3. Connect the right pin to GND.

That's it — just 3 wires! The TMP36 can only be connected in one direction. Double-check before powering on.

මෙම පියවර සඳහා ද්‍රව්‍ය:

බ්‍රෙඩ්බෝඩ්බ්‍රෙඩ්බෝඩ්1 කැබැල්ල
සම්බන්ධක කම්බිසම්බන්ධක කම්බි3 කැබලි
3

Arduino Code

Open the Arduino IDE and upload the following sketch to your Arduino board.

temperature_sensor.inoarduino
/*
SparkFun Inventor's Kit
Example sketch 07 — TEMPERATURE SENSOR

Use the serial monitor to read temperature from a TMP36 sensor.

Hardware connections:
  TMP36 (flat side, pins down, left to right): 5V, SIGNAL, GND
  Connect 5V pin to 5V, SIGNAL pin to analog pin 0, GND pin to GND.

This code is completely free for any use.
*/

const int temperaturePin = 0;

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

void loop()
{
  float voltage, degreesC, degreesF;

  voltage = getVoltage(temperaturePin);

  degreesC = (voltage - 0.5) * 100.0;
  degreesF = degreesC * (9.0/5.0) + 32.0;

  Serial.print("voltage: ");
  Serial.print(voltage);
  Serial.print("  deg C: ");
  Serial.print(degreesC);
  Serial.print("  deg F: ");
  Serial.println(degreesF);

  delay(1000);
}

float getVoltage(int pin)
{
  return (analogRead(pin) * 0.004882814);
  // Converts 0-1023 to 0.0-5.0 volts
}

මෙම පියවර සඳහා ද්‍රව්‍ය:

Arduino Uno R3Arduino Uno R31 කැබැල්ල

අවශ්‍ය මෙවලම්:

Arduino IDE සහිත පරිගණකයArduino IDE සහිත පරිගණකය
4

Test & Experiment

What You Should See

Open the Serial Monitor (magnifying glass icon in Arduino IDE, or Ctrl+Shift+M). You'll see lines updating once per second:

voltage: 0.73  deg C: 23.24  deg F: 73.84

Troubleshooting

  • Nothing happens: Open the Serial Monitor! The output goes there, not to the LEDs.
  • Gibberish text: Set the Serial Monitor baud rate dropdown to 9600.
  • Temperature unchanged: Pinch the sensor with your fingers to warm it up, or apply ice to cool it down.

Experiments to Try

  • Add an LED that turns on above a temperature threshold (like a heat warning).
  • Log data over time to see temperature trends.
  • Combine with the LCD (Circuit 15) to display temperature without a computer.

ද්‍රව්‍ය

5

අවශ්‍ය මෙවලම්

1
ඇස්තමේන්තුගත එකතුව
නිර්මාණකරු මිලදී ගත් දේ. මිලක් නොමැතිව පෙන්වන ද්‍රව්‍ය ඔබ මිලදී ගන්නා තැනින් ලැබේ.
$105.94

CC0 පොදු වසම

මෙම බ්ලූප්‍රින්ට් CC0 යටතේ නිකුත් කර ඇත. ඔබට අවසර නොමැතිව පිටපත් කිරීම, වෙනස් කිරීම, බෙදා හැරීම සහ භාවිතා කිරීම කළ හැක.

බ්ලූප්‍රින්ට් හරහා නිෂ්පාදන මිලදී ගැනීමෙන් නිර්මාතෘට සහාය වන්න නිර්මාතෘ කොමිසම විකුණුම්කරුවන් විසින් නියම කළ, හෝ මෙම බ්ලූප්‍රින්ට්හි නව අනුවාදයක් සාදා ආදායම බෙදා ගැනීමට ඔබේ බ්ලූප්‍රින්ට්හි සම්බන්ධතාවයක් ලෙස ඇතුළත් කරන්න.

සාකච්ඡාව

(0)

පිවිසෙන්න සාකච්ඡාවට එක්වීමට

අදහස් පූරණය කරමින්...