0% found this document useful (0 votes)
9 views44 pages

Arduino Programming Lab Experiments

The document outlines the Arduino Programming Laboratory curriculum for Electronics & Communication Engineering students, detailing a list of experiments divided into two cycles. It includes various projects such as electrical circuits, LED control, relay control, and ultrasonic distance measurement, along with additional planned experiments. The document also provides specific procedures, apparatus required, and sample codes for several experiments.

Uploaded by

srinivas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views44 pages

Arduino Programming Lab Experiments

The document outlines the Arduino Programming Laboratory curriculum for Electronics & Communication Engineering students, detailing a list of experiments divided into two cycles. It includes various projects such as electrical circuits, LED control, relay control, and ultrasonic distance measurement, along with additional planned experiments. The document also provides specific procedures, apparatus required, and sample codes for several experiments.

Uploaded by

srinivas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

=========================================
======
DEPARTMENT OF ELECTRONICS & COMMUNICATION
ENGINEERING

ARDUINO PROGRAMMING
LABORATORY OBSERVATION
1 ARDUINO PROGRAMMING LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

FOR ECE,EEE&CIC
II [Link] (IV SEM)

2 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

LIST OF EXPERIMENTS

CYCLE-I Experiments
1. Electrical Circuit by using ARDUINOUNO
2. Blinking LED
3. LED Intensity Control
4. Relay Control
5. 16x2 LCD Display
6. Rotation Measurement
7. Voice Operated ON/OFF control circuit.
CYCLE-II Experiments

8. UltraSonic Distance Measurement


9. Speed Control of Hybrid Vehicles using
PWM Technique
10. Drunk and Drive Detection
11. Temperature Measurement
12. Women Security System usingGPS& GSM
13. Soil Moisture Control
14. Auto Intensity controlled LED

New/Additional experiments planned


1. LED Blinking of 25times
2. Theft Alarm Circuit
3. IoT based Light Monitoring System
4. GSM pollution monitoring
5. Thermistor

3 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

INDEX
[Link] NAME OF THE EXPERIMENT DATE MARKS SIGNATURE

1 Electrical Circuit by using


ARDUINOUNO
2 2a) Blinking LED
2b) Blinking LED 10Times
3 LED Intensity Control

4 Relay Control

5 16x2 LCD Display

6 Voice Operated ON/OFF control


circuit
7 UltraSonic Distance Measurement

8 Soil Moisture Control

9 Drunk & Drive detection

10 Temperature & Humidity mesurement

4 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-1 ELECTRICALCIRCUITS USINGARDUINO

AIM:Study the Electrical circuit of ARDUINO

APPARATUS:

[Link] ATMega 328P

5 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

ARDUINO MICROCONTROLLER PIN DIAGRAM

6 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CPU 8-bitAVR

NumberofPins 28/30
OperatingVoltage(V) +1.8VTO+5.5V
1MIPSfor1MHz

CPUSpeed
[Link] Upto20MHz
ProgramMemoryorFlashmemory 32Kbytes[10000write/erasecycles]
RAM 2KbytesInternalSRAM
1Kbytes EEPROM
EEPROM LifeTime :100000
Write/EraseCyclesData
Retention:20 Years
6ChannelsWith
ADC
10bitResolution
PWMCHANNELS SixPWMChannels
TwoMaster/SlaveSPISerialInterface
– OneProgrammableSerial
INTERFACE
USART
– OneByte-oriented2-wire
Serial Interface(Philips I2C
compatible)

COMPARATOR OneOn-chipAnalog Comparator

8BITTIMERS/COUNTERS 2

16BITTIMERS/COUNTERS 1

7 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

8 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

Idle,
ADCNoise
Reduction,
Power-save,
Powe
SLEEPMODES r-
down
,
Stand
by,
and
ExtendedStandby
SECURITY ProgrammingLockforSoftware
Security
AdvancedRISCArchitecture 131PowerfulInstructions

9 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

ARDUIN POWER SUPPLY

ARDUINO RESET AND OSCILLATOR

1 ARDUINO PROGRAMMING LAB


0
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

FEATURES OF DIFFERENT TYPES OF ARDUINO BOARDS

Thefeaturesofdifferent typesofArduino boardsarelistedinthe tabular


form.
Digital
Arduino BoardProcessor Memory Analogue
I/O
I/O

ArduinoUno 16Mhz
2KBSRAM,32KB 6input,0
ATmega328 14
output
flash
84MHz
ArduinoDue 96KBSRAM, 12input,2
54
output
AT91SAM3X8E 512KB

flash

ArduinoMega 16MHz
 16input,0
8KBSRAM,256KB 54
ATmega2560 output
flash

Arduino 16MHz ATmega32u4 2.5KB 20 12input,0output


SRAM,32KB

Leonardo flash

 Arduino Uno(R3)
 Arduino Nano
 Arduino Micro
 Arduino Due
 Lily Pad Arduino Board
 Arduino Bluetooth
 Arduino Diecimila
 Red Board Arduino Board
 Arduino Mega(R3)Board
 Arduino Leonardo Board
 Arduino Robot
 Arduino Esplora
 Arduino ProMic
 Arduino Ethernet
 Arduino Zero-Fastest ArduinoBoard

1 ARDUINO PROGRAMMING LAB


1
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-2(a) BLINKINGLED

AIM:Program to turn ON/OFF LED using Arduino Uno.

APPARATUS:

1. ARDUINO BOARD

2. BREAD BOARD

3. RESISTER100Ω-1

4. 8mm LED-1

5. PATCH CARDS REQUIRED

6. DESKTOP WITH ARDUINO IDE SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

12 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

13 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
#define LED 8
void setup()
{
pinMode (LED,OUTPUT);
}
void loop()
{
digitalWrite(LED,1);
delay(1000);
digitalWrite(LED,0);
delay(1000);
}

RESULT:-

14 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-2(b) LEDBLINKING10TIMES

AIM:Program to LED blinking 10times using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. RESISTER100Ω-1

4. 8mmLED-1

5. PATCH CARDS REQUIRED

6. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Arduino tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM portinthetool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

15 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

16 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
#define LED 8
int i=0; void setup()
{
pinMode (LED,OUTPUT);
}
void loop()
{
for(i=0;i<10;i++)
{
digitalWrite(LED,1)
; delay(500);
digitalWrite(LED,0);
delay(500);
}
while(1);

RESULT:-

17 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-3 LED INTENSITY CONTROL

AIM:Program to LED Intensity control using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. RESISTER100Ω-1

4. 8mmLED-1

5. PATCH CARDS REQUIRED

6. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

18 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

19 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
#define LED 8
void setup( )
{
pinMode (LED,OUTPUT);
}
void loop()

{
analogWrite(LED,0);
delay(3000);
analogWrite(LED,1);
delay(3000);
analogWrite(LED,50);
delay(3000);
analogWrite(LED,100);
delay(3000);
analogWrite(LED,150);
delay(3000);
analogWrite(LED,200);
delay(3000);
analogWrite(LED,255);
delay(3000);
}

RESULT:-

20 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-4 RELAY CONTROL

AIM:Program to Relay control using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. Relay–5V

4. 60Watt bulb with holder

5. PATCH CARDS REQUIRED

6. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

21 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT
DIAGRAM:-

22 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-

int relay_pin=7;
void setup() {
pinMode (relay_pin,OUTPUT);
}
void loop()
{
digitalWrite(relay_pin,HIGH);
delay(2000);
digitalWrite(relay_pin,LOW);
delay(2000);
}

RESULT:-

23 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-5 16X2 LCD DISPLAY

AIM:Program to 16 x2 LCD DISPLAY using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. 16x2LCDDISPLAY

4. PATCHCARDSREQUIRED

[Link] WITH ARDUINO SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

24 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT
DIAGRAM:-

25 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{
//putyoursetupcodehere,torunonce:
analogWrite(6,100);
[Link](16,2);
}
void loop()
{
//putyourmaincodehere,torunrepeatedly:
[Link]();
[Link](0,0);
[Link](" ASIST ");
[Link](0,1);
[Link](" E.C.E ");
delay(3000);
[Link]();
[Link](0,0);
[Link]("ARDIUNO");
[Link](0,1);
[Link]("II-ECE");
delay(3000);
}

RESULT:-

26 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-6 VOICE OPERATED ON/OFF CONTROL CIRCUIT

AIM:Program to Voice operated on/off control circuit using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. Relay–5V

4. 60Watt bulb with holder

5. Bluetooth

6. PATCH CARDS REQUIRED

7. DESKTOP WITH ARDUINO SOFT WARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

27 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

28 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
String voice;
int relay = 12; // Define relay pin

void setup() {
[Link](9600);
pinMode(relay, OUTPUT);
digitalWrite(relay, LOW); // Relay OFF at start
}

void loop() {
while ([Link]()) { // Check for incoming data
delay(10); // Stability delay
char c = [Link](); // Read character

if (c == '#') {
break; // End of command
}

voice += c; // Build command string


}

if ([Link]() > 0) {
[Link](voice);

// ---- Control Light ----


if (voice == "*turnonthelight") {
digitalWrite(relay, HIGH); // Turn ON relay
}

if (voice == "*turnoffthelight") {
digitalWrite(relay, LOW); // Turn OFF relay
}

voice = ""; // Clear string for next command


}
}

RESULT:-

29 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-7 ULTRASONIC DISTANCE MEASUREMENT

AIM:Program to Ultrasonic Distance Measurement using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. UVSENSOR

4. BUZZER

5. PATCHCARDS REQUIRED

6. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

30 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

31 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-

#define PIEZO_PIN 9
const int trigger = 6;
const int echo = 7;
float distance;
float dist_inches;

void setup() {
[Link](9600);

pinMode(trigger, OUTPUT);
pinMode(echo, INPUT);

pinMode(PIEZO_PIN, OUTPUT);
}

void loop() {

// Trigger ultrasonic sensor


digitalWrite(trigger, LOW);
delayMicroseconds(5);

digitalWrite(trigger, HIGH);
delayMicroseconds(10);
digitalWrite(trigger, LOW);

// Read echo
distance = pulseIn(echo, HIGH);

// Convert to inches
distance = distance * 0.0001657; // distance in meters

32 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

dist_inches = distance * 39.37; // convert meters →


inches

// If object is closer than 5 inches, beep


if (dist_inches < 5) {
tone(PIEZO_PIN, 1500);
delay(200);
noTone(PIEZO_PIN);
}

[Link]("Distance: ");
[Link](dist_inches);
[Link](" in");

delay(100); // small delay for stability


}

RESULT:-

33 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT:No-8 SOIL MOISTURE CONTROL

AIM:Program to Soil Moisture Control using Arduino Uno.

APPARATUS:

1. ARDUINOBOARD

2. BREADBOARD

3. MOISTURESENSOR

4. PATCH CARDS REQUIRED

5. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-

1. Connections are made as per the circuit diagram.

2. Enter the code in Adriuno tool and verify the code.

3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.

4. Upload the code to the Ardiuno board.

5. Verify the output.

34 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

35 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

36 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
int sensor;
int const powerpin=8;
int const delaytime=1000; void setup()
{
[Link](9600);
pinMode(powerpin,OUTPUT);
}
void loop()
{
digitalWrite(powerpin,HIGH);
delay (10);
sensor=analogRead (A0);
digitalWrite(powerpin,LOW);
[Link](sensor);
delay(delaytime);
}

RESULT:-

37 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT: No-9 DRUNK & DRIVE DETECTION

AIM: Program to Drunk & Drive detection using Arduino Uno.

APPARATUS:
[Link] BOARD
2. BREAD BOARD
3. MQ3 SENSOR -1
4. 8mm LED -1
5. 100Ω RESISTOR-1
6. BUZZER
4. PATCH CARDS REQUIRED
5. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-
1. Connections are made as per the circuit diagram.
2. Enter the code in Adriuno tool and verify the code.
3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.
4. Upload the code to the Ardiuno board.
5. Verify the output.

38 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

39 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
#define sensorDigital 2
#define LED 3
#define buzzer 4
#define sensorAnalog A1

void setup() {
pinMode(sensorDigital, INPUT);
pinMode(LED, OUTPUT);
pinMode(buzzer, OUTPUT);
[Link](9600);
}
void loop() {
bool digital = digitalRead(sensorDigital);
int analog = analogRead(sensorAnalog);

[Link]("Analog value : ");


[Link](analog);
[Link]("\t");
[Link]("Digital value :");
[Link](digital);

if (digital == 0) {
digitalWrite(LED, HIGH);
digitalWrite(buzzer, HIGH);
} else {
digitalWrite(LED, LOW);
digitalWrite(buzzer, LOW);
}

RESULT:-

40 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

EXPT: No-10 TEMPERATURE & HUMIDITY


MESUREMENT

AIM: Program to Temperature & Humidity Measurement using Arduino Uno.

APPARATUS:-
[Link] BOARD
2. BREAD BOARD
3. DHT-11 SENSOR
4. PATCH CARDS REQUIRED
5. DESKTOP WITH ARDUINO SOFTWARE

PROCEDURE:-
1. Connections are made as per the circuit diagram.
2. Enter the code in Adriuno tool and verify the code.
3. Connect the Ardiuno board to pc USB port and check the COM port in the tool.
4. Upload the code to the Ardiuno board.
5. Verify the output.

41 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CONNECTION DIAGRAM:-

CIRCUIT DIAGRAM:-

42 ARDUINO PROGRAMMING LAB


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

CODE:-
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
[Link](9600);
[Link]("DHTxx test!");
[Link]();}
void loop() {
delay(2000);
float h = [Link]();
float t = [Link]();
float f = [Link](true);
if (isnan(h) || isnan(t) || isnan(f)) {
[Link]("Failed to read from DHT sensor!");
43 ARDUINO PROGRAMMING LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING ASIST

return; }
float hif = [Link](f, h);
float hic = [Link](t, h, false);
[Link]("Humidity: ");
[Link](h);
[Link](" %\t");
[Link]("Temperature: ");
[Link](t);
[Link](" *C ");
[Link](f);
[Link](" *F\t");
[Link]("Heat index: ");
[Link](hic);
[Link](" *C ");
[Link](hif);
}
RESULT:-

44 ARDUINO PROGRAMMING LAB

You might also like