Skip to main content

Interfacing IR Temperature Sensor with Raspberry Pi 3 ๐ŸŒก️

Interfacing IR Temperature Sensor with Raspberry Pi 3 ๐ŸŒก️

Interfacing IR Temperature Sensor with Raspberry Pi 3 ๐ŸŒก️

Infrared temperature sensors are non-contact sensors that detect the temperature of objects by sensing emitted infrared radiation. Today, we’ll learn how to interface an IR sensor (like MLX90614) with a Raspberry Pi 3. ๐ŸŽ“

๐Ÿ”ง Components Required

ComponentQuantity
Raspberry Pi 31
IR Temp Sensor (MLX90614)1
Jumper Wires4
Breadboard (optional)1

๐Ÿช› Pin Connections

Sensor PinRaspberry Pi PinPin Number
VCC3.3VPin 1
GNDGroundPin 6
SDAGPIO 2 (SDA)Pin 3
SCLGPIO 3 (SCL)Pin 5
IR Sensor Connection Diagram

Figure: IR Sensor connected to Raspberry Pi 3

⚙️ Enabling I2C on Raspberry Pi

  • Open terminal: sudo raspi-config
  • Go to Interfacing Options > I2C and enable it.
  • Reboot your Raspberry Pi.

๐Ÿ’ป Python Code

import smbus import time bus = smbus.SMBus(1) address = 0x5A def read_temp(): raw_ambient = bus.read_word_data(address, 0x06) raw_object = bus.read_word_data(address, 0x07) temp_ambient = (raw_ambient * 0.02) - 273.15 temp_object = (raw_object * 0.02) - 273.15 return temp_ambient, temp_object try: while True: ambient, obj = read_temp() print(f"Ambient: {ambient:.2f}°C | Object: {obj:.2f}°C") time.sleep(1) except KeyboardInterrupt: print("Stopped")

๐Ÿ“Œ Summary

This setup allows contactless temperature measurement, ideal for COVID screening booths, industrial monitoring, and smart home devices! ๐Ÿ”ฅ❄️

Raspberry Pi 3 เคธเคน IR เคคाเคชเคฎाเคจ เคธेเคจ्เคธเคฐ เค•เคธे เคœोเคกाเคฏเคšे ๐ŸŒก️ (เคฎเคฐाเค ी)

IR (Infrared) เคคाเคชเคฎाเคจ เคธेเคจ्เคธเคฐ เคนे เคธंเคชเคฐ्เค•เคตिเคฐเคนिเคค เคธेเคจ्เคธเคฐ เค…เคธเคคाเคค เคœे เคตเคธ्เคคूंเคชाเคธूเคจ เค‰เคค्เคธเคฐ्เคœिเคค เคนोเคฃाเคฐे เค‡เคจ्เคซ्เคฐाเคฐेเคก เคฐेเคกिเคเคถเคจ เคฎोเคœूเคจ เคคाเคชเคฎाเคจ เคฎोเคœเคคाเคค. เคšเคฒा เคนे Raspberry Pi 3 เคธोเคฌเคค เค•เคธे เคœोเคกाเคฏเคšे เคคे เคถिเค•ूเคฏा. ๐Ÿ˜Š

๐Ÿ”ง เคฒाเค—เคฃाเคฐे เคธाเคนिเคค्เคฏ

เคธाเคนिเคค्เคฏเคช्เคฐเคฎाเคฃ
Raspberry Pi 31
IR เคคाเคชเคฎाเคจ เคธेเคจ्เคธเคฐ (MLX90614)1
เคœंเคชเคฐ เคตाเคฏเคฐ4
เคฌ्เคฐेเคกเคฌोเคฐ्เคก (เคชเคฐ्เคฏाเคฏी)1

๐Ÿ”Œ เคตाเคฏเคฐिंเค— เคœोเคกเคฃी

เคธेเคจ्เคธเคฐ เคชिเคจRaspberry Pi เคชिเคจเคชिเคจ เค•्เคฐเคฎांเค•
VCC3.3Vเคชिเคจ 1
GNDGNDเคชिเคจ 6
SDAGPIO2 (SDA)เคชिเคจ 3
SCLGPIO3 (SCL)เคชिเคจ 5

⚙️ I2C เคธुเคฐू เค•เคฐเคฃे

  • เคŸเคฐ्เคฎिเคจเคฒ เค‰เค˜เคกा: sudo raspi-config
  • Interfacing Options > I2C เคฏेเคฅे เคœाเคŠเคจ I2C เคธुเคฐू เค•เคฐा.
  • Pi เคฐीเคฌूเคŸ เค•เคฐा.

๐Ÿ’ป Python เค•ोเคก

เค–ाเคฒीเคฒ เค•ोเคก เคตाเคชเคฐूเคจ เค†เคชเคฃ เคธेเคจ्เคธเคฐเค•เคกूเคจ เคคाเคชเคฎाเคจ เคตाเคšू เคถเค•เคคो:

# เคตเคฐीเคฒ เค‡ंเค—्เคฐเคœी เค•ोเคก เคฏेเคฅे เคตाเคชเคฐू เคถเค•เคคा (เคคेเคš เค†เคนे)

๐Ÿ“Œ เคธाเคฐांเคถ

เคนा เคธेเคจ्เคธเคฐ เคตाเคชเคฐूเคจ เค†เคชเคฃ เค•ोเคฃเคค्เคฏाเคนी เคตเคธ्เคคूเคšा เคคाเคชเคฎाเคจ เคจ เคธ्เคชเคฐ्เคถ เค•เคฐเคคा เคฎोเคœू เคถเค•เคคो. เคนा เคช्เคฐोเคœेเค•्เคŸ เคธ्เคฎाเคฐ्เคŸ เคนोเคฎ, เค‡ंเคกเคธ्เคŸ्เคฐिเคฏเคฒ เคธेเคซ्เคŸी, เคต เคนॉเคธ्เคชिเคŸเคฒ เคธ्เค•्เคฐीเคจिंเค—เคธाเค ी เค‰เคชเคฏुเค•्เคค เค†เคนे! ๐Ÿฅ๐Ÿ”ฅ

Comments

Popular posts from this blog

Interfacing Load Cell with Raspberry Pi 3 (via HX711) ⚖️

Interfacing Load Cell with Raspberry Pi 3 (via HX711) ⚖️ Interfacing Load Cell with Raspberry Pi 3 (via HX711) ⚖️ A load cell is a transducer that converts force (weight) into an electrical signal. The HX711 is a precision 24-bit analog-to-digital converter (ADC) designed for weigh scales. Today we’ll connect a load cell to Raspberry Pi 3 using the HX711 module. ๐Ÿงช ๐Ÿ”ง Components Required Component Quantity Raspberry Pi 3 1 Load Cell 1 HX711 Module 1 Jumper Wires 6 Breadboard (optional) 1 ๐Ÿ”Œ Pin Connections HX711 Pin Raspberry Pi Pin Pin Number VCC 5V Pin 2 GND Ground Pin 6 DT GPIO 5 Pin 29 SCK GPIO 6 Pin 31 Figure: Load Cell connected to Raspberry Pi 3 via HX711 ๐Ÿ’ป Python Code from hx711 import HX711 import RPi.GPIO as GPIO import time hx = HX711(dout_pin=5, pd_sck_pin=6) hx.set_reading_format("MSB", "MSB") hx.set_reference_unit(1) hx.reset()...

Interfacing Sound Sensor with Raspberry Pi 3

๐Ÿ”น Overview The KY-037 is a high-sensitivity sound detection sensor that can detect noise levels in the environment. It provides both analog and digital outputs. In this tutorial, we’ll interface the digital output of KY-037 with Raspberry Pi 3 Model B+ (without using an ADC like MCP3008) and detect sound events.

Interfacing Water Flow Sensor with Raspberry Pi 3 ๐Ÿšฟ

Interfacing Water Flow Sensor with Raspberry Pi 3 ๐Ÿšฟ ๐ŸŽฏ Objective To measure the flow rate of water using a Water Flow Sensor (YF-S201) and Raspberry Pi 3. Useful in smart irrigation and water management systems. ๐Ÿงฐ Components Required Component Quantity Raspberry Pi 3 1 YF-S201 Water Flow Sensor 1 10K Pull-down Resistor 1 Jumper Wires As required Breadboard 1 ⚡ Circuit Connections Sensor Pin Connect To Red (VCC) 5V (Raspberry Pi) Black (GND) GND (Raspberry Pi) Yellow (Pulse Out) GPIO18 (Pin 12) with pull-down resistor ๐Ÿง  Python Code import RPi.GPIO as GPIO import time FLOW_SENSOR = 18 pulse_count = 0 def countPulse(channel): global pulse_count pulse_count += 1 GPIO.setmode(GPIO.BCM) GPIO.setup(FLOW_SENSOR, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.add_event_detect(FLOW_SENSOR, GPIO.FALLING, callback=countPulse) try: while True: pulse_count = 0 time.sleep(1) flow_rate = (pulse_count / 7.5) ...