==============================================================
WEEK 1: LED BLINK USING ARDUINO
==============================================================

AIM:
To implement a program to blink two LEDs alternatively for 10 times using Arduino.

DESCRIPTION:
This program demonstrates the fundamental concept of digital output control using Arduino by blinking 
two LEDs alternately. The LEDs are connected to digital pins 8 and 9, which are configured as OUTPUT using the pinMode() 
function in the setup() section. Inside the loop(), a while loop is used to control the execution for a fixed number of iterations,
ensuring that the LEDs blink exactly 10 times. During each cycle, one LED is turned ON while the other is turned OFF using digitalWrite(),
and after a delay of one second, their states are reversed. The delay() function plays a crucial role in controlling the timing of LED switching.
A counter variable is used to keep track of the number of iterations, preventing infinite execution. This experiment helps in understanding basic 
Arduino programming concepts such as loops, digital signals, timing control, and hardware interfacing. It also introduces alternating signal patterns
used in real-world applications like traffic signals, indicators, and automation systems.

PROGRAM:
int i = 0;

void setup(){ 
  pinMode(8, OUTPUT); 
  pinMode(9, OUTPUT); 
} 

void loop(){ 
  while(i < 10){ 
    digitalWrite(8, HIGH); 
    digitalWrite(9, LOW); 
    delay(1000); 

    digitalWrite(8, LOW); 
    digitalWrite(9, HIGH); 
    delay(1000); 

    i++; 
  } 
}

OUTPUT:

   TIME →     1s        2s        3s        4s   ...

   LED1 →    [ON]      [OFF]     [ON]      [OFF]
   LED2 →    [OFF]     [ON]      [OFF]     [ON]

   Pattern: Alternating Blink (10 Times)
+--------------------------------------------------+
|   LED 1 ON     LED 2 OFF                         |
|   LED 1 OFF    LED 2 ON                          |
|   (Alternates every 1 second)                    |
|   Repeats for 10 times                           |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output clearly shows two LEDs blinking in an alternating pattern, where one LED is ON while the other 
is OFF at any given moment. After a delay of one second, their states are reversed, creating a visible switching effect.
This sequence continues for exactly 10 iterations, as controlled by the counter variable inside the while loop. Once the count 
reaches 10, the loop stops executing, and no further blinking occurs. This confirms correct implementation of loop control, timing
using delay(), and digital output functions. The experiment verifies that Arduino can manage multiple output devices efficiently and 
execute instructions with precise timing. It also demonstrates how logical sequencing and iteration control are used in embedded 
systems. Such alternating patterns are commonly used in real-life applications like warning lights, signal indicators, and basic 
automation systems, making this experiment an essential foundation for beginners.


==============================================================
WEEK 2: LED AND BUZZER INTERFACING USING ARDUINO
==============================================================

AIM:
To implement a program to switch LED and buzzer ON every second.

DESCRIPTION:
This program demonstrates how to interface and control multiple output devices simultaneously using Arduino, specifically an 
LED and a buzzer. The LED is connected to digital pin 8 and the buzzer to pin 9. Both pins are configured as OUTPUT using the 
pinMode() function in the setup() section. In the loop(), the Arduino sends HIGH signals to both pins, turning ON the LED and 
activating the buzzer at the same time. After a delay of one second, both devices are turned OFF by sending LOW signals. This 
ON-OFF cycle repeats continuously, creating a periodic blinking and sound pattern. The delay() function ensures proper timing 
between state changes. This experiment helps in understanding how Arduino can handle multiple outputs simultaneously and perform 
synchronized operations. It also introduces the concept of generating combined visual and audio alerts, which are widely used in 
real-world applications such as alarm systems, notification devices, and warning indicators. It strengthens understanding of digital 
signals, timing control, and hardware interfacing in embedded systems.

PROGRAM:
void setup(){ 
  pinMode(8, OUTPUT); 
  pinMode(9, OUTPUT); 
} 

void loop(){ 
  digitalWrite(8, HIGH); 
  digitalWrite(9, HIGH); 
  delay(1000); 

  digitalWrite(8, LOW); 
  digitalWrite(9, LOW); 
  delay(1000); 
}

OUTPUT:

   TIME →     1s        2s        3s        4s   ...

   LED    →  [ON]      [OFF]     [ON]      [OFF]
   BUZZER →  [ON]      [OFF]     [ON]      [OFF]

   Pattern: LED and Buzzer work together (Synchronized)
+--------------------------------------------------+
|   LED ON  +  BUZZER SOUND                        |
|   LED OFF +  BUZZER OFF                          |
|   (Repeats every 1 second)                       |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output demonstrates synchronized operation of both LED and buzzer. When the program runs, both devices 
turn ON simultaneously, producing light and sound together, followed by turning OFF after a delay of one second.
This cycle repeats continuously, creating a clear and consistent pattern. The behavior confirms that Arduino can control 
multiple output devices at the same time using digitalWrite() and manage timing accurately using delay(). The simultaneous
activation shows proper synchronization of outputs. This experiment also verifies that hardware components respond correctly 
to digital signals from Arduino. Such coordinated operations are widely used in real-world systems like alarms, emergency 
alerts, and notification devices. The experiment highlights the importance of timing control and synchronization in embedded 
systems, making it a useful example for understanding how multiple actuators can be controlled efficiently in IoT applications.



==============================================================
WEEK 3: RGB LED USING PWM WITH ARDUINO
==============================================================

AIM:
To implement a program to obtain different colours of RGB LED using user input.

DESCRIPTION:
This program demonstrates how to control an RGB LED using Arduino and user input through the Serial Monitor.
An RGB LED consists of three individual LEDs (Red, Green, and Blue) combined in a single unit, each connected to 
separate digital pins. The Arduino reads user input using Serial.parseInt(), and based on the entered value, it activates 
the corresponding LED. For example, entering ‘1’ turns ON the red LED, ‘2’ activates green, and ‘3’ activates blue. The 
pins are configured as OUTPUT using pinMode(), and digitalWrite() is used to control the ON/OFF state of each color. Although 
PWM can be used for generating multiple color combinations, this program focuses on selecting individual colors based on user 
input. This experiment helps in understanding serial communication between the user and Arduino, decision-making using conditional
statements, and control of multiple outputs. It also introduces the concept of color generation using RGB components, which is 
widely used in display systems, smart lighting, and IoT applications.

PROGRAM:
int c;

void setup() { 
  Serial.begin(9600); 
  pinMode(10, OUTPUT); 
  pinMode(8, OUTPUT); 
  pinMode(9, OUTPUT); 
} 

void loop(){ 
  c = Serial.parseInt(); 

  if(c == 1){        
    digitalWrite(8, HIGH); 
    digitalWrite(9, LOW); 
    digitalWrite(10, LOW); 
  } 
  else if(c == 2){   
    digitalWrite(9, HIGH); 
    digitalWrite(8, LOW); 
    digitalWrite(10, LOW); 
  } 
  else if(c == 3){   
    digitalWrite(10, HIGH); 
    digitalWrite(8, LOW); 
    digitalWrite(9, LOW); 
  } 

  Serial.println(c); 
}

OUTPUT:

   INPUT →    1          2          3

   OUTPUT:
              [RED]     [GREEN]    [BLUE]

   RGB LED STATE:
              R=ON      R=OFF      R=OFF
              G=OFF     G=ON       G=OFF
              B=OFF     B=OFF      B=ON
+--------------------------------------------------+
|   Input 1 → RED LED ON                           |
|   Input 2 → GREEN LED ON                         |
|   Input 3 → BLUE LED ON                          |
|   (Controlled via Serial Monitor)                |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output depends on user input provided through the Serial Monitor. When the user enters a value such as 
1, 2, or 3, the Arduino processes the input and activates the corresponding LED color. Only one LED glows at a time,
ensuring clear identification of each color. The result confirms successful serial communication, input processing,
and execution of conditional statements. The program also demonstrates how Arduino can interact with external input 
sources and control hardware accordingly. The use of digitalWrite() ensures precise control over each LED. This experiment 
highlights the importance of user-driven control in embedded systems and IoT applications. It also provides a basic understanding 
of RGB color control, which can be extended further using PWM to create multiple color combinations. Overall, the output verifies 
correct implementation of logic, communication, and hardware interfacing.


==============================================================
WEEK 4: SERVO AND STEPPER MOTOR USING ARDUINO
==============================================================

AIM:
a) To control a servo motor using Arduino with a push button input.
b) To rotate a stepper motor clockwise and anti-clockwise using Arduino.

DESCRIPTION:
This experiment demonstrates the control of two different types of motors—servo and stepper—using Arduino. 
A servo motor is designed for precise angular movement, while a stepper motor moves in discrete steps for accurate 
positioning. In the servo motor setup, a push button is connected as an input device. When the button is pressed, the
Arduino sends a signal to rotate the servo motor to a fixed angle (15 degrees), and when released, it returns to its 
original position. This demonstrates position control using PWM signals. In the stepper motor setup, the Stepper library 
is used to control motor movement. The motor rotates in a clockwise direction for a specific number of steps and then reverses
direction after a delay. The concept of steps per revolution and gear reduction is used to achieve precise control. This experiment
helps in understanding motor interfacing, input handling, and motion control, which are essential in robotics, automation systems, 
and industrial IoT applications.

--------------------------------------------------------------
PROGRAM 4(a): SERVO MOTOR WITH PUSH BUTTON
--------------------------------------------------------------
#include <Servo.h>

Servo s1;
int button = 7;

void setup(){ 
  pinMode(button, INPUT); 
  s1.attach(8); 
} 

void loop(){ 
  if(digitalRead(button) == HIGH){ 
    s1.write(15);   
  } 
  else{ 
    s1.write(0); 
  } 
}

--------------------------------------------------------------
PROGRAM 4(b): STEPPER MOTOR ROTATION
--------------------------------------------------------------
#include <Stepper.h>

int steps_per_rev = 32;
int gear_reduction = 64;
int steps_req = steps_per_rev * gear_reduction;

Stepper motor(steps_per_rev, 2, 4, 3, 5);

void setup(){ 
  motor.setSpeed(900); 
} 

void loop(){ 
  motor.step(steps_req);    
  delay(1000); 

  motor.step(-steps_req);   
  delay(1000); 
}

OUTPUT:

   SERVO MOTOR:

   Button Pressed  →  Angle = 15°
   Button Released →  Angle = 0°

   STEP MOTOR:

   Direction →   CLOCKWISE  →  STOP →  ANTICLOCKWISE → STOP

   Pattern: Continuous back-and-forth rotation
+--------------------------------------------------+
|  Servo rotates 15° when button is pressed        |
|  Returns to 0° when released                     |
|  Stepper rotates CW and CCW continuously         |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output demonstrates two types of motor control mechanisms. In the servo motor setup,
the motor rotates to 15 degrees when the push button is pressed and returns to its initial position 
when the button is released. This confirms proper reading of digital input and accurate position 
control using PWM signals. In the stepper motor setup, the motor rotates in a clockwise direction for
a fixed number of steps and then reverses direction after a delay, creating continuous back-and-forth motion. 
This verifies correct implementation of step control and direction reversal. The experiment highlights the 
difference between continuous rotation and precise angular control. It also shows how Arduino can handle both 
input and output devices simultaneously. Such control mechanisms are widely used in robotics, automation, 
CNC machines, and smart systems where precise movement and positioning are required.



==============================================================
WEEK 5: CONTROL ACTUATORS USING BLUETOOTH (ARDUINO)
==============================================================

AIM:
To control an actuator (LED) connected to Arduino using Bluetooth.

DESCRIPTION:
This program demonstrates wireless control of an actuator using a Bluetooth module (HC-05/HC-06) with Arduino.
The SoftwareSerial library is used to establish communication between the Arduino and the Bluetooth module using digital pins.
A smartphone with a Bluetooth terminal application is used to send commands to the Arduino. The module receives data and 
transfers it to the Arduino, where it is processed using Serial communication functions. Based on the received input, 
the Arduino controls an LED connected to a digital pin. If the user sends ‘1’, the LED turns ON, and if ‘0’ is sent, the 
LED turns OFF. This experiment introduces the concept of wireless communication and remote device control. It helps in 
understanding serial data transfer, communication protocols, and real-time control of hardware. Such systems are widely 
used in IoT applications like home automation, remote monitoring, and smart control systems where devices can be operated wirelessly from a distance.

PROGRAM:
#include <SoftwareSerial.h>

SoftwareSerial EEBLUE(10,11);
int input;

void setup() 
{ 
  Serial.begin(9600); 
  EEBLUE.begin(9600); 
  Serial.println("BLUETOOTH IS READY"); 
  pinMode(8, OUTPUT); 
} 

void loop() 
{ 
  if(EEBLUE.available()){ 
    input = EEBLUE.parseInt(); 

    if(input == 1) 
      digitalWrite(8, HIGH); 

    if(input == 0) 
      digitalWrite(8, LOW); 
  } 
}

OUTPUT:


   MOBILE INPUT →   1          0

   LED OUTPUT  →  [ON]       [OFF]

   Communication:
   Mobile App → Bluetooth Module → Arduino → LED

   Pattern: Wireless ON/OFF control
+--------------------------------------------------+
|   Input '1' → LED ON                             |
|   Input '0' → LED OFF                            |
|   Controlled via Bluetooth mobile app            |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output shows successful wireless control of an LED using Bluetooth communication. When the user sends input ‘1’
from a mobile device, the LED turns ON, and when ‘0’ is sent, it turns OFF. This confirms that the Bluetooth module is
properly connected and communicating with the Arduino. The SoftwareSerial library effectively handles data transmission and reception. 
The experiment demonstrates real-time response to user commands, validating the concept of remote control. It also highlights the
importance of serial communication and data parsing in embedded systems. Such wireless control systems are commonly used in smart 
home automation, remote switching, and IoT-based applications. The experiment proves that Arduino can be integrated with communication 
modules to control devices efficiently from a distance.



==============================================================
WEEK 6: SENSOR INTERFACING USING ARDUINO (DHT11)
==============================================================

AIM:
To interface DHT11 sensor for measuring humidity and temperature.

DESCRIPTION:
This program demonstrates how to interface a DHT11 sensor with Arduino to measure environmental
parameters such as temperature and humidity. The DHT library is used to communicate with the sensor 
and retrieve data. The sensor is connected to a digital pin, and the Arduino continuously reads values 
using dedicated library functions. If the sensor fails to provide valid data, the program displays an
error message; otherwise, it prints the humidity and temperature values on the Serial Monitor. The delay() 
function is used to control the interval between readings. This experiment helps in understanding sensor 
interfacing, data acquisition, and real-time monitoring. It introduces the concept of environmental sensing,
which is widely used in weather monitoring systems, smart agriculture, and IoT-based climate control applications. 
It also demonstrates how Arduino handles sensor errors and ensures reliable data output.

PROGRAM:
#include <DHT.h>

DHT dht(8, DHT11);
float t, h;

void setup(){ 
  Serial.begin(9600); 
  dht.begin(); 
  Serial.println("Starting DHT Test"); 
  delay(2000); 
} 

void loop(){ 
  h = dht.readHumidity(); 
  t = dht.readTemperature(); 

  if(isnan(h) || isnan(t)){ 
    Serial.println("Failed to read"); 
  } 
  else{ 
    Serial.print("Humidity: "); 
    Serial.println(h); 
    Serial.print("Temperature: "); 
    Serial.println(t); 
  } 

  delay(1000); 
}

OUTPUT:


   SERIAL MONITOR DISPLAY:

   -----------------------------
   Humidity    :  65 %
   Temperature :  28 °C
   -----------------------------

   (Values update every second)
+--------------------------------------------------+
|  Humidity: XX %                                  |
|  Temperature: XX °C                              |
|  (Values displayed on Serial Monitor)            |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output displays real-time humidity and temperature values measured by the DHT11 sensor on the Serial Monitor. 
If the sensor functions correctly, numerical values are continuously updated at regular intervals. In case of sensor 
failure or improper connection, an error message is displayed, indicating unsuccessful data retrieval. This confirms 
proper use of the DHT library and sensor interfacing. The experiment demonstrates how Arduino collects and processes 
environmental data efficiently. It also highlights the importance of error handling in embedded systems. Such sensor-based
systems are widely used in weather stations, smart agriculture, HVAC systems, and IoT applications. The experiment validates
that Arduino can reliably interact with sensors and provide meaningful real-world data.


==============================================================
WEEK 7: INSTALLATION AND SETUP OF RASPBERRY PI
==============================================================

AIM:
To implement a program to blink LED using Raspberry Pi.

DESCRIPTION:
This program demonstrates basic GPIO control using Raspberry Pi and Python programming. Two LEDs are connected
to GPIO pins 12 and 13, and the RPi.GPIO library is used to control these pins. The pins are configured as OUTPUT,
and the program alternately turns the LEDs ON and OFF with a delay of one second. A continuous loop is used to repeat 
the process indefinitely. The try-except block ensures safe termination of the program when interrupted, and GPIO.cleanup() 
resets the pin configuration. This experiment introduces Python-based hardware control and GPIO handling in Raspberry Pi. It
helps in understanding how Raspberry Pi can be used as a mini-computer for embedded and IoT applications. The concept of pin 
configuration, signal control, and timing is similar to Arduino but implemented using Python, making it versatile and powerful for advanced applications.

PROGRAM:
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

ledPinOne = 12
ledPinTwo = 13

GPIO.setup(ledPinOne, GPIO.OUT)
GPIO.setup(ledPinTwo, GPIO.OUT)

try:
    while True:
        GPIO.output(ledPinOne, GPIO.HIGH)
        GPIO.output(ledPinTwo, GPIO.LOW)
        time.sleep(1)

        GPIO.output(ledPinOne, GPIO.LOW)
        GPIO.output(ledPinTwo, GPIO.HIGH)
        time.sleep(1)

except KeyboardInterrupt:
    print("\nExiting Program\n")
    GPIO.cleanup()
    exit()

OUTPUT:


   TIME →     1s        2s        3s        4s   ...

   LED1 →    [ON]      [OFF]     [ON]      [OFF]
   LED2 →    [OFF]     [ON]      [OFF]     [ON]

   Pattern: Continuous Alternating Blink
+--------------------------------------------------+
|  LED1 ON  , LED2 OFF                             |
|  LED1 OFF , LED2 ON                              |
|  (Alternates continuously)                       |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output shows two LEDs blinking alternately using Raspberry Pi GPIO control. One LED remains ON 
while the other is OFF, and after a one-second delay, their states are reversed. This cycle continues 
indefinitely until the program is manually stopped. The try-except block ensures safe termination, preventing 
GPIO damage. The experiment verifies correct use of Python programming for hardware control and demonstrates 
how Raspberry Pi handles GPIO operations. It also highlights similarities between Arduino and Raspberry Pi in 
controlling digital outputs. Such implementations are widely used in automation systems, signal indicators, and 
IoT-based applications. The experiment confirms that Raspberry Pi can effectively control external hardware using software instructions.


==============================================================
WEEK 8: RGB LED WITH RASPBERRY PI USING PWM
==============================================================

AIM:
To interface RGB LED brightness using PWM pins with Raspberry Pi.

DESCRIPTION:
This program demonstrates how to control an RGB LED using Raspberry Pi with PWM signals. Each color pin 
(Red, Green, Blue) is connected to GPIO pins and controlled using PWM to vary brightness levels. The PWM
signals are generated using the RPi.GPIO library, allowing gradual increase and decrease in intensity. A 
loop is used to change the duty cycle from 0 to 100 and then back to 0, creating a smooth fading effect. 
This experiment introduces PWM concepts, duty cycle control, and color mixing. It helps in understanding 
how different brightness levels combine to produce various colors. Such techniques are widely used in smart 
lighting systems, display technologies, and IoT applications.

PROGRAM:
import RPi.GPIO as g
import time

g.setmode(g.BCM)
g.setwarnings(False)

ground = 10
red = 11
green = 12
blue = 13

g.setup(red, g.OUT)
g.setup(green, g.OUT)
g.setup(blue, g.OUT)
g.setup(ground, g.OUT)

g.output(ground, g.LOW)

p = g.PWM(red, 100)
q = g.PWM(green, 100)
r = g.PWM(blue, 100)

p.start(0)
q.start(0)
r.start(0)

while True:
    for i in range(0, 101):
        p.ChangeDutyCycle(i)
        q.ChangeDutyCycle(i)
        r.ChangeDutyCycle(i)
        time.sleep(0.05)

    for i in range(100, -1, -1):
        p.ChangeDutyCycle(i)
        q.ChangeDutyCycle(i)
        r.ChangeDutyCycle(i)
        time.sleep(0.05)

OUTPUT:


   BRIGHTNESS LEVEL:

   0% → 25% → 50% → 75% → 100% → 75% → 50% → 25% → 0%

   VISUAL EFFECT:

   [Dim] → [Glow] → [Bright] → [Full] → [Fade] → [Dim]

   Pattern: Smooth brightness increase and decrease
+--------------------------------------------------+
|  RGB LED brightness increases and decreases      |
|  Smooth color fading effect observed             |
+--------------------------------------------------+

OUTPUT ANALYSIS & DESCRIPTION:
The output shows a smooth transition in brightness of the RGB LED, where intensity gradually increases 
from minimum to maximum and then decreases back to minimum. This creates a fading effect, demonstrating proper 
PWM control. The simultaneous variation of red, green, and blue channels results in combined color changes. 
The experiment confirms correct implementation of PWM signals and duty cycle adjustments. It highlights how 
brightness control affects color mixing and visual output. Such effects are widely used in smart lighting, displays, 
and decorative systems. The experiment verifies that Raspberry Pi can generate PWM signals and control LED brightness 
efficiently, making it suitable for advanced IoT and embedded applications.