Posts

Procedure for Automatic Plant Watering System without Flyback Diode

Image
  Procedure for Automatic Plant Watering System without Flyback Diode Step 1: Gather Components Arduino UNO Soil moisture sensor NPN transistor (e.g., 2N2222 or BC547) or N-channel MOSFET (e.g., IRF540N or IRLZ44N) Water pump 1kΩ resistor 5V or 12V power supply for the pump (depending on the pump specifications) Jumper wires Breadboard Step 2: Connect the Soil Moisture Sensor Attach the VCC pin of the soil moisture sensor to the 5V pin on the Arduino. Connect the GND pin of the sensor to the GND pin on the Arduino. Attach the A0 pin of the sensor to the A1 analog pin on the Arduino. Step 3: Set Up the Transistor or MOSFET For NPN Transistor: Connect the emitter pin of the transistor to GND . Connect the collector pin to the positive terminal of the water pump. Connect the base pin to Arduino digital pin 8 via a 1kΩ resistor . For N-Channel MOSFET: Connect the source pin of the MOSFET to GND . Connect the drain pin to the negative terminal of the water pump. Connect th...

Temperature and Humidity Monitor

  Project Title : Temperature and Humidity Monitor Components Required Arduino UNO DHT11 sensor I2C LCD Display Jumper wires Breadboard Connections DHT11 Sensor : VCC -> 5V GND -> GND Data -> Pin 2 I2C LCD Display (Assuming your setup): Using the Adafruit_LiquidCrystal library: SCL -> A5 SDA -> A4 Code # include <Adafruit_LiquidCrystal.h> # include <DHT.h> // Define DHT sensor type and pin # define DHTTYPE DHT11 # define DHTPIN 2 // Initialize DHT sensor DHT dht (DHTPIN, DHTTYPE) ; // Initialize the LCD Adafruit_LiquidCrystal lcd ( 0 ) ; // Assuming default I2C address void setup () { // Begin serial communication Serial. begin ( 9600 ); // Initialize the DHT sensor dht. begin (); // Initialize the LCD lcd. begin ( 16 , 2 ); lcd. setBacklight ( 1 ); // Display a welcome message lcd. print ( "Temp & Humidity" ); lcd. setCursor ( 0 , 1 ); lcd. print ( "Monitoring..." ); delay ( 2000 ...

2.Light-Controlled LED Using an LDR and Arduino

Image
Light-Controlled LED Using an LDR and Arduino Components Needed: Arduino board LDR (photoresistor) 10kΩ resistor LED 220Ω resistor Breadboard and jumper wires Circuit Connections: LDR Circuit : Connect one leg of the LDR to 5V on the Arduino. Connect the other leg of the LDR to an analog input pin (e.g., A0) and a 10kΩ resistor. Connect the other end of the 10kΩ resistor to GND. LED Circuit : Connect the anode (longer leg) of the LED to a digital pin (e.g., 13). Connect a 220Ω resistor in series with the cathode of the LED, and connect the other end of the resistor to GND. Example Code: C++ Code int ldrPin = A0; // Analog pin for LDR int ledPin = 13 ; // Digital pin for LED int threshold = 500 ; // Threshold value for light level void setup () { pinMode (ledPin, OUTPUT); // Set LED pin as output Serial. begin ( 9600 ); // Start serial communication } void loop () { int ldrValue = analogRead (ldrPin); // Read LDR value Serial. println (ldrValue); ...

1.Using an LDR (Light Dependent Resistor) with Arduino to Measure Light Intensity

Image
 Using an LDR (Light Dependent Resistor) with Arduino to Measure Light Intensity. Components Needed: Arduino board LDR (photoresistor) 10kΩ resistor Breadboard and jumper wires Circuit Connections: LDR : Connect one leg of the LDR to 5V on the Arduino, and the other leg to an analog input pin (e.g., A0). Resistor : Connect a 10kΩ resistor between the LDR leg (that goes to the analog pin) and GND. This forms a voltage divider. Explanation: When light falls on the LDR, its resistance changes, affecting the voltage at the analog pin. The analog pin reads a value between 0 and 1023 depending on the light intensity. Example Code: C++ Code int ldrPin = A0; // Analog pin to which LDR is connected int ldrValue; void setup () { Serial. begin ( 9600 ); // Start the serial communication to view the LDR value } void loop () { ldrValue = analogRead (ldrPin); // Read the LDR value Serial. println (ldrValue); // Print the value to the Serial Monitor delay ( 500 ); // Delay for...

10.Ultrasonic Distance Measurement Display Using I2C LCD with Arduino

Image
 Ultrasonic Distance Measurement Display Using I2C LCD with Arduino Materials Needed: Arduino board (e.g., Uno, Nano) Ultrasonic sensor (HC-SR04) I2C LCD (16x2) Jumper wires Breadboard (optional) Connections: Ultrasonic Sensor to Arduino: TRIG pin → Pin 9 on Arduino. ECHO pin → Pin 10 on Arduino. VCC pin → 5V on Arduino. GND pin → GND on Arduino. I2C LCD to Arduino: SDA → A4 on Arduino (for Uno). SCL → A5 on Arduino (for Uno). VCC → 5V on Arduino. GND → GND on Arduino. Procedure: Step 1: Set Up Arduino IDE Make sure the <Adafruit_LiquidCrystal.h> library is installed in your Arduino IDE. Step 2: Write the Code Copy and paste the following code into the Arduino IDE: C++ Code: #include <Wire.h> #include <Adafruit_LiquidCrystal.h> // Ultrasonic sensor pins const int trigPin = 9; const int echoPin = 10; // Set up the LCD for I2C communication Adafruit_LiquidCrystal lcd(0); void setup() {   // Initialize serial communication   Serial.begin(9600); ...

9.Distance Measurement System Using Ultrasonic Sensor and LCD Display with Arduino

Image
  Distance Measurement System Using Ultrasonic Sensor and LCD Display with Arduino                                                                    Circuit Diagram Materials Needed: Arduino board Ultrasonic sensor (e.g., HC-SR04) LCD (16x2) with I2C interface Jumper wires Breadboard (optional) Connections: Ultrasonic Sensor to Arduino: TRIG pin → Pin 9 ECHO pin → Pin 10 VCC pin → 5V GND pin → GND LCD to Arduino: RS → Pin 8 E → Pin 7 D4 → Pin 6 D5 → Pin 5 D6 → Pin 4 D7 → Pin 3 Procedure: Connect the Components: Use jumper wires to connect the ultrasonic sensor and the LCD as described above. Write the Arduino Code: Copy and paste the following code into the Arduino IDE: C++ Code #include <Adafruit_LiquidCrystal.h> // Ultrasonic sensor pins const int trigPin = 9; const int echoPin = 10; // Initializ...

8.Ultrasonic with servo

Ultrasonic with servo Materials Needed: Arduino board Ultrasonic sensor (e.g., HC-SR04) Servo motor Jumper wires Breadboard (optional) Connections: Ultrasonic Sensor to Arduino: TRIG pin → Pin 9 ECHO pin → Pin 10 VCC pin → 5V GND pin → GND Servo Motor to Arduino: Signal pin → Pin 11 VCC → 5V GND → GND Procedure: Connect the Components: Use jumper wires to connect the ultrasonic sensor and the servo motor as described above. Write the Arduino Code: Copy and paste the following code into the Arduino IDE: C++ Code #include <Servo.h> const int trigPin = 9; const int echoPin = 10; const int servoPin = 11; int thresholdDistance = 20;  // Set the distance threshold in centimeters Servo myServo; void setup() {   Serial.begin(9600);  // Start the serial communication at 9600 baud rate   pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);   myServo.attach(servoPin);   myServo.write(0);  // Set servo to initial position (0 degrees) } void loop(...