Professional Documents
Culture Documents
IOT Record
IOT Record
IOT Record
Register No :
ALGORITHM:-
STEP 1:Start the program
STEP 6:Run
STEP7: End
CODING:
a="hello world"
print(a)
print(type(a))
b=1015
print(b)
print(type(b))
c=12.56
print(c)
print(type(c))
d=complex(10j)
print(d)
print(type(d))
OUTPUT:
D:\Notes>python 1.py
hello world
<class 'str'>
1015
<class 'int'>
12.56
<class 'float'>
10j
<class 'complex'>
D:\Notes>
RESULT:
Thus the program was executed successfully and output was verified.
Ex. No : 2
Date : 01.09.2022
Write a program to arithmetic operations in python.
AIM:-
To write a Arithmetic program in python.
ALGORTHIM:-
STEP 1:Start the program
STEP 7:Run
STEP 8:End
CODING:
print("====ADDITION====")
c=a+b
print("====SUBSTRACTION====")
c=a-b
print("====MULTIPLICATION====")
c=a*b
print("====DIVISION====")
c=a/b
print("====MODULUS====")
c=a%b
print("====EXPONENTIAL====")
c=a**b
print("====FLOOR_DIVISION====")
c=a//b
D:\Notes>python 1.py
enter the first no:8
the value of a= 8
enter the second no.:4
the value of b= 4
====ADDITION====
the value of c= 12
====SUBSTRACTION====
the value of c= 4
====MULTIPLICATION====
the value of c= 32
====DIVISION====
the value of c= 2.0
====MODULUS====
the value of c= 0
====EXPONENTIAL====
the value of c= 4096
====FLOOR_DIVISION====
the value of c= 2
D:\Notes>
RESULT:
Thus the program was executed successfully and output was verified.
Ex. No : 3
Date : 06.09.2022
STEP 7:Run
STEP 8:End
CODING:
WHILE LOOP:
#while loop
count = 0
count = count + 1
else:
FOR LOOP:
#FOR LOOP
print(num,"X",i,"=",num * i)
NESTED LOOP:
#NESTED LOOP
for i in range(5):
for j in range(i+1):
print()
OUTPUT:
D:\Notes>python 1.py
enter the number=8
0 is less than 5
1 is less than 5
2 is less than 5
3 is less than 5
4 is less than 5
5 is less than 5
6 is less than 5
7 is less than 5
8 is not less than 5
Enter the number: 7
Multiplication Table of 7
7X1=7
7 X 2 = 14
7 X 3 = 21
7 X 4 = 28
7 X 5 = 35
7 X 6 = 42
7 X 7 = 49
7 X 8 = 56
7 X 9 = 63
7 X 10 = 70
Half Pyramid Pattern of Stars (*):
*
**
***
****
*****
RESULT:
Thus the program was executed successfully and output was verified.
Ex. No : 4
Date : 08.09.2022
Interfacing Arduino with LCD.
AIM:
COMPONENTS REQUIRED:
1. LCD Board.
2. Jumper wires.
ALGORITHM:
RESULT:
Thus the output to LCD Program using Arduino has successfully executed.
Ex. No : 5
Date : 21.09.2022
COMPONENTS REQUIRED:
1. Ultrasonic sensor.
2. Buzzer
3. Connectivity cable or USB cable.
4. Jumper Wires
ALGORITHM:
RESULT:
Thus the output to ultrasonic sensor using Arduino has successfully executed.
Ex. No : 6
Date : 23.09.2022
AIM:
To write a program to get Temperature notification using Arduino.
COMPONENTS REQUIRED:
1. Temperature and humidity sensor.
2. Jumper wires
3. Connectivity cable or USB cable.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Start ->Arduino 1.8.8
STEP 3: Include the DHT library to the Arduino software.
STEP 4: Then enter the coding in Arduino software.
STEP 5: Complete the coding in Arduino.
STEP 6: In Arduino board connect VCC to the power supply 5V and
connect SIG to digital signal DT and connect SND to ground GND
using jumper wires.
STEP 7: Connect the arduino board with USB cable to the system.
STEP 8: Select tools -> Selected.
STEP 9: Upload the coding to arduino board. Then the output will
be displayed in the serial monitor.
STEP 10: Stop the process.
CODING:
#include <dht.h>
#define dht_apin A0 // Analog Pin sensor is connected to
dht DHT;
void setup(){
Serial.begin(9600);
delay(500);//Delay to let system boot
Serial.println("DHT11 Humidity & temperature Sensor\n\n");
delay(1000);//Wait before accessing Sensor
}//end "setup()"
void loop(){
//Start of Program
DHT.read11(dht_apin);
RESULT:
Thus the output to get temperature notification using Arduino has successfully executed.
Ex. No : 7
Date : 17.10.2022
AIM:
To Write a program using arduino IDE for blink LED.
COMPONENTS REQUIRED:
1. LED Light.
2. Arduino Board.
3. Connectivity cable or USB cable.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Start ->Arduino.
STEP 3: Then enter the coding in Arduino software.
STEP 4: Complete the coding in Arduino.
STEP 6: In Arduino board connect 13 pin in LED light
STEP 7: Connect the arduino board with USB cable to the system.
STEP 8: Select tools-> Selected.
STEP 9: Upload the coding to arduino board. Then the output will
be displayed .
STEP 10: Stop the process.
CODING
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
OUTPUT:
RESULT:
Thus the output to get LED Light using Arduino has successfully executed.
Ex. No : 8
Date : 29.10.2022
AIM:
To Write a program for RGB LED using Arduino.
COMPONENTS REQUIRED:
1. RGB Light.
2. Jumper wires
3. Connectivity cable or USB cable.
4. Arduino Board.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Start ->Arduino 1.8.8
STEP 3: Then enter the coding in Arduino software.
STEP 4: Complete the coding in Arduino.
STEP 5: In Arduino board connect and RGB Light connect in Bread Board Red pin in 11,
Green pin in 10, blue pin in 9 connect digital pin.
STEP 6: Connect the arduino board with USB cable to the system.
STEP 7: Select tools ->Selected.
STEP 8: Upload the coding to arduino board. Then the output will
be displayed in the serial monitor.
STEP 9: Stop the process.
CODING:
RESULT:
Thus the output to get RGB Light using Arduino has successfully executed.
Ex. No : 9
Date : 03.11.2022
COMPONENTS REQUIRED:
1. Gas sensor.
2. Jumper wires
3. Connectivity cable or USB cable.
4.Arduino Board
ALGORITHM:
STEP 1: Start the process.
STEP 2: Start ->Arduino 1.8.8
STEP 3: Then enter the coding in Arduino software.
STEP 4: Complete the coding in Arduino.
STEP 5: In Arduino board connect VCC to the power supply 5V and
connect A0 to Analogy signal A0 and connect GND to ground GND
using jumper wires.
STEP 6: Connect the arduino board with USB cable to the system.
STEP 7: Select tools -> Selected.
STEP 8: Upload the coding to arduino board. Then the output will
be displayed in the serial monitor.
STEP 9: Stop the process.
CODING:
int smokeA0=A0;
int buzzer =11;
float sensorValue;
void setup() {
pinMode(buzzer,OUTPUT);
pinMode(smokeA0,INPUT);
Serial.begin(9600); // sets the serial port to 9600
Serial.println("Gas sensor warming up!");
delay(20000); // allow the MQ-6 to warm up
noTone(buzzer);
}
void loop() {
sensorValue=analogRead(smokeA0);
if(sensorValue > 300)
{
Serial.print(" | Smoke detected!");
tone(buzzer,1000,200);
}
else
{
Serial.print(" | Smoke not detected!");
noTone(buzzer);
}
delay(2000); // wait 2s for next reading
}
OUTPUT:
RESULT:
Thus the output to get Gas Sensor using Arduino has successfully executed.