Skip to main content

Posts

Showing posts with the label ELECTRONICS PROJECTS

Interfacing Raspberry Pi 3 B+ with DC Motor using L298N 🚀🔧

 Controlling a DC motor with a Raspberry Pi 3 B+ is an essential project for robotics and automation. In this tutorial, we will interface a DC motor with Raspberry Pi 3 B+ using the L298N motor driver . Let’s get started! 🚗⚡ 📝 Components Required Component Quantity Description Raspberry Pi 3 B+ 1 Main Controller L298N Motor Driver 1 To control the DC motor DC Motor 1 The motor to be controlled Power Supply (12V) 1 External power for motor Jumper Wires As needed To connect components Breadboard 1 For connections (optional) 🔌 Circuit Connections L298N Pin Connects To 12V 12V Power Supply GND Raspberry Pi GND & Power Supply GND 5V Not Connected (Raspberry Pi provides 3.3V) IN1 Raspberry Pi GPIO 17 (BCM) IN2 Raspberry Pi GPIO 18 (BCM) ENA Raspberry Pi GPIO 22 (BCM) OUT1 & OUT2 DC Motor Terminals 🔴 Note: The L298N module needs an external power supply (12V) to drive the DC motor efficiently. The Raspberry Pi should not power the motor directly. 📷 Circuit Diagram...

Interfacing Raspberry Pi 3 with an Ultrasonic Sensor (HC-SR04) - English & Marathi

Introduction The HC-SR04 ultrasonic sensor is used to measure distance by sending and receiving ultrasonic waves. In this tutorial, we will interface the HC-SR04 sensor with Raspberry Pi 3 to measure the distance of an object. HC-SR04 अल्ट्रासोनिक सेन्सर अल्ट्रासोनिक तरंग पाठवून आणि प्राप्त करून अंतर मोजण्यासाठी वापरला जातो. या ट्यूटोरियलमध्ये, आपण HC-SR04 सेन्सरला Raspberry Pi 3 शी जोडून वस्तूचे अंतर कसे मोजायचे ते शिकू. Components Required | आवश्यक घटक: 1. Raspberry Pi 3 2. HC-SR04 Ultrasonic Sensor 3. Jumper Wires 4. Breadboard Circuit Diagram | सर्किट जोडणी: Connections: - HC-SR04 VCC → 5V (Pin 2) - HC-SR04 GND → GND (Pin 6) - HC-SR04 Trig → GPIO23 (Pin 16) - HC-SR04 Echo → GPIO24 (Pin 18) Python Code | पायथन कोड: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) TRIG = 23 ECHO = 24 GPIO.setup(TRIG, GPIO.OUT) GPIO.setup(ECHO, GPIO.IN) def measure_distance():     GPIO.output(TRIG, True)     time.sleep(0.00001)     GPIO.output(TRIG, False)  ...

Interfacing Rain Sensor with Raspberry Pi 3 ☔

Interfacing Rain Sensor with Raspberry Pi 3 ☔ 🎯 Objective To detect the presence of rain using a Rain Sensor module with Raspberry Pi 3 and display alerts on the console. Perfect for smart weather stations and automatic window systems! 🧰 Components Required Component Quantity Raspberry Pi 3 1 Rain Sensor Module (Analog & Digital Output) 1 Jumper Wires As required Breadboard 1 ⚡ Circuit Connections Rain Sensor Pin Connect To VCC 5V (Raspberry Pi) GND GND (Raspberry Pi) D0 (Digital Out) GPIO17 (Pin 11) 🧠 Python Code import RPi.GPIO as GPIO import time RAIN_SENSOR_PIN = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(RAIN_SENSOR_PIN, GPIO.IN) try: while True: if GPIO.input(RAIN_SENSOR_PIN) == 0: print("🌧️ Rain Detected!") else: print("☀️ No Rain.") time.sleep(1) except KeyboardInterrupt: GPIO.cleanup() 📊 Output Prints "🌧️ Rain Detected!" when...

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 Raspberry Pi 3 B+ with Servo Motor ✨ (English & Marathi)

 💻 Introduction A servo motor is widely used in robotics and automation projects. It allows precise control over rotation. In this tutorial, we will learn how to interface a servo motor with Raspberry Pi 3 B+ using Python . What will you learn? How a servo motor works Wiring the servo with RPi 3 B+ Writing Python code to control the servo 🛠 Components Required           Component Quantity           Raspberry Pi 3 B+                1           SG90 Servo Motor           1           Jumper Wires           3           External 5V Power Supply (Optional)           1 🛠 Circuit Diagram & Connection :  Connect the servo motor to Raspberry Pi as follows:...

🌡️ Interfacing BMP180 Pressure & Temperature Sensor with Raspberry Pi 3

🔹 Overview The BMP180 is a sensor that measures atmospheric pressure and temperature . It is commonly used in weather stations, altitude measurement, and IoT projects . In this tutorial, we will interface the BMP180 sensor with Raspberry Pi 3 and display the readings. 🛠️ Components Required ✔️ Raspberry Pi 3 ✔️ BMP180 Sensor ✔️ Breadboard & Jumper Wires 🔌 Circuit Diagram The BMP180 communicates with the Raspberry Pi using the I2C protocol . 🔗 BMP180 to Raspberry Pi Connections    BMP180 Pin Connection VCC 3.3V (Raspberry Pi) GND GND SDA GPIO 2 (I2C SDA) SCL GPIO 3 (I2C SCL) 📜 Python Code to Read BMP180 Sensor Save the following Python script as bmp180_sensor.py and run it on Raspberry Pi. python Copy Edit import smbus import time # BMP180 Default Address BMP180_ADDR = 0x77 # Open I2C bus bus = smbus.SMBus( 1 ) def read_temperature (): bus.write_byte_data(BMP180_ADDR, 0xF4 , 0x2E ) time.sleep( 0.005 ) temp_msb = bus.read_byte_data...

Interfacing IR Obstacle Sensor with Raspberry Pi 3

  🔹 Overview An IR Obstacle Sensor is used to detect obstacles using infrared light. It is commonly used in robots, line-following cars, and automatic doors . In this tutorial, we will connect an IR sensor to Raspberry Pi 3 and detect obstacles. 🛠️ Components Required ✔️ Raspberry Pi 3 ✔️ IR Obstacle Sensor ✔️ Breadboard & Jumper Wires 🔌 Circuit Diagram 🔗 IR Sensor to Raspberry Pi Connections  IR Sensor Pin Connection VCC 3.3V (Raspberry Pi) GND GND OUT GPIO 17 (Detects obstacle) 📜 Python Code to Read IR Sensor Save the following Python script as ir_sensor.py and run it on Raspberry Pi. python Copy Edit import RPi.GPIO as GPIO import time # Define GPIO pin IR_SENSOR_PIN = 17 # Setup GPIO.setmode(GPIO.BCM) GPIO.setup(IR_SENSOR_PIN, GPIO.IN) try : while True : if GPIO. input (IR_SENSOR_PIN) == 0 : print ( "🚧 Obstacle Detected!" ) else : print ( "✅ No Obstacle." ) time.sleep( 1 ) ...

Interfacing RFID Module (RC522) with Raspberry Pi 3

  🔹 Overview RFID (Radio Frequency Identification) is used for contactless authentication in access control systems, attendance tracking, and payment systems . The RC522 RFID module reads RFID cards and tags using SPI communication. 🛠️ Components Required ✔️ Raspberry Pi 3 ✔️ RC522 RFID Module ✔️ RFID Card/Tag ✔️ Breadboard & Jumper Wires 🔌 Circuit Diagram 🔗 RC522 to Raspberry Pi Connections RC522 Pin  Raspberry Pi Connection VCC                3.3V GND GND RST GPIO 25 SDA GPIO 8 (SPI CE0) SCK GPIO 11 (SPI SCLK) MOSI GPIO 10 (SPI MOSI) MISO GPIO 9 (SPI MISO) 📜 Python Code to Read RFID Card Save the following Python script as rfid_reader.py and run it on Raspberry Pi. python Copy Edit import RPi.GPIO as GPIO from mfrc522 import SimpleMFRC522 reader = SimpleMFRC522() try : print ( "Place your RFID card near the reader..." ) id , text = reader.read() print ( f"Card ID: { id }") print (...

Interfacing Raspberry Pi 3 with a Temperature Sensor (DHT11) - English & Marathi

  Introduction The DHT11 sensor is a simple and popular sensor used to measure temperature and humidity. In this tutorial, we will learn how to interface the DHT11 sensor with Raspberry Pi 3 and display the temperature and humidity readings on the terminal. DHT11 सेन्सर तापमान आणि आर्द्रता मोजण्यासाठी वापरला जाणारा एक सोपा आणि लोकप्रिय सेन्सर आहे. या ट्यूटोरियलमध्ये, आपण DHT11 सेन्सरला Raspberry Pi 3 शी कसे जोडायचे आणि टर्मिनलवर वाचन कसे प्रदर्शित करायचे हे शिकू. Components Required | आवश्यक घटक: Raspberry Pi 3 DHT11 Temperature and Humidity Sensor 10KΩ Resistor Jumper Wires Breadboard Circuit Diagram | सर्किट जोडणी: Connections: DHT11 VCC → 3.3V (Pin 1) DHT11 GND → GND (Pin 6) DHT11 Data → GPIO4 (Pin 7) 10KΩ resistor between VCC and Data pin Python Code | पायथन कोड: import Adafruit_DHT sensor = Adafruit_DHT.DHT11 pin = 4 # GPIO4 humidity, temperature = Adafruit_DHT.read_retry(sensor, pin) if humidity is not None and temperature is not None: print(f"Te...