Skip to main content

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

ComponentQuantity
Raspberry Pi 31
Load Cell1
HX711 Module1
Jumper Wires6
Breadboard (optional)1

🔌 Pin Connections

HX711 PinRaspberry Pi PinPin Number
VCC5VPin 2
GNDGroundPin 6
DTGPIO 5Pin 29
SCKGPIO 6Pin 31
Load Cell and HX711 Connection Diagram

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() hx.tare() print("Place item on load cell") try: while True: weight = hx.get_weight(5) print(f"Weight: {weight:.2f} grams") hx.power_down() hx.power_up() time.sleep(1) except KeyboardInterrupt: print("Exiting...") GPIO.cleanup()

📌 Summary

This setup lets you build your own weighing machine, useful for kitchen scales, industrial applications, or science projects! ⚖️🍽️

Raspberry Pi 3 सह लोड सेल व HX711 कसे जोडावे ⚖️ (मराठी)

लोड सेल हे उपकरण वजन मोजण्यासाठी वापरले जाते. HX711 हा त्यासाठी खास तयार केलेला अ‍ॅनालॉग-टू-डिजिटल कन्वर्टर आहे. चला याला Raspberry Pi 3 सोबत जोडण्याची प्रक्रिया बघूया. 🧪

🔧 लागणारे साहित्य

साहित्यप्रमाण
Raspberry Pi 31
लोड सेल1
HX711 मॉड्यूल1
जंपर वायर6
ब्रेडबोर्ड (पर्यायी)1

🔌 वायरिंग जोडणी

HX711 पिनRaspberry Pi पिनपिन क्रमांक
VCC5Vपिन 2
GNDGNDपिन 6
DTGPIO 5पिन 29
SCKGPIO 6पिन 31

💻 Python कोड

लोड सेलचे वाचन करण्यासाठी खालील कोड वापरा:

# वरील इंग्रजी कोड लागू आहे (तेच वापरा)

📌 सारांश

हे सर्किट वापरून तुम्ही स्वतःची इलेक्ट्रॉनिक वजन काटा बनवू शकता. हे शिक्षण, प्रयोगशाळा व स्वयंपाकघरासाठी उपयुक्त आहे! 🥣📏

Comments

Popular posts from this blog

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) ...