Professional Documents
Culture Documents
Read the temperature of the liquid filled container, if temperature is less than
25 degreeC turn on the heater, turn off the heater if temperature is 27 degree C.
Aim: To Read the temperature of the liquid filled container, if temperature is less than
25 degree C turn on the heater, turn off the heater if temperature is 27 degree C.
Apparatus required:
PC with Arduino Software
Arduino kit
Jumper Wires
Temperature Sensor (LM35)
Program:
float temp;
int tempPin = A0;
int led=13;
void setup()
{
pinMode(13,OUTPUT);
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125;
Serial.print("TEMPERATURE = ");
Serial.print(temp);
Serial.println("*C");
delay(1000);
if(temp>=25)
{
digitalWrite(13,HIGH);
DATE:23-08-2023 Exp No:02 PAGE No:03
}
else
{
digitalWrite(13,LOW);
}
if(temp<=27)
{
digitalWrite(13,HIGH);
}
else
{
digitalWrite(13,LOW);
}
}
Result: Read and Perform the application of Liquid filled container is Verified.
DATE:23-08-2023 Exp No:03 PAGE No:04
Aim: To open the sliding door of shopping mall automatically in the presence of
movement in front of the door, wait for 5 sec and if no movement in front the door
close the door.
Apparatus required:
PC with Arduino Software
Arduino kit
Jumper Wires
IR Sensor
Program:
int irpin=13;
int b=12;
void setup ()
{
pinMode(13,INPUT);
pinMode(12,OUTPUT);
}
void loop ()
{
int irpin= digitalRead(13);
if(irpin == LOW)
{
digitalWrite(12,HIGH);
delay(5000);
}else {
digitalWrite(12,LOW);
}
}
DATE:23-08-2023 Exp No:04 PAGE No:05
void setup() {
Serial.begin(9600);
myservo.attach(9);
}
void loop() {
if (Serial.available()) {
count = 0;
while (Serial.available() && count < 12) {
input[count] = Serial.read();
count++;
delay(5);
}
input[count] = '\0';
Serial.println(input);
DATE:23-08-2023 Exp No:04 PAGE No:06
if (strcmp(input, "14004AAD699A") == 0) {
Serial.println("The door is open");
myservo.write(0);
delay(1000);
myservo.write(180);
delay(1000);
} else {
Serial.println("Error");
}
}
}
Build a circuit to illustrate how we can build a wavy moving robot with
obstacle sensing.
Aim: To Build a circuit to illustrate how we can build a wavy moving robot with
obstacle sensing.
Apparatus required:
PC with Arduino Software
Arduino kit
IR Sensor
Jumper Wires
Program:
const int LED1=10;
{
Serial.print(9600); pinMode(LED1,OUTPUT); pinMode(LED2,OUTPUT);
pinMode(IR1,INPUT);
}
void loop()
{
if(IR1==HIGH)
{
digitalWrite(LED1,HIGH);
}else{
digitalWrite(LED1,HIGH);
delay(1500);
digitalWrite(LED2,HIGH);
delay(1500);
}
}
Result: Wavy moving robot with obstacle sensing is build and Verified.
EXP:-06 DATE:-22-08-2023 Page:-06
6. Build a circuit to monitor room brightness and turn on room light during
darkness.
AIM:-
To built an circuit to turn ON the lights during dark using LDR.
Apraturs required:
o PC with aurduino software installed.
o Arduino kit & jumper Wires
o LDR
Answer :
int LDR=A0;//Set A0(Analog Input) for LDR. int LED1=3;
int value=0;
void setup()
{
Serial.begin(9600);
pinMode(LDR,INPUT);
pinMode(LED1,OUTPUT);
}
void loop()
{
value=analogRead(LDR);//Reads the Value of LDR(light). Serial.println("LDR value is :");//Prints the
value of LDR to
Serial Monitor. Serial.println(value);
if(value<300)
{
digitalWrite(LED1,HIGH);//Makes the LED glow in Dark.
}
else
{
digitalWrite(LED1,LOW);//Turns the LED OFF in Light.
}
}
EXP:-07 DATE:-22-08-2023 Page:-07
Answer :
Answer :
#include <SoftwareSerial.h>
SoftwareSerial bt(0,1);
const int LM=A0;
float temp=0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
temp=analogRead(LM);
temp=temp/2.62; Serial.print("temperature");
Serial.print(temp); delay(1000);
[b:GB200]=[b:y00000];
[b:GB201]=[b:y00001];
if([b:GB200]==1)
{
[w:GD200]=[w:GD200]+1;
if([b:GB201]==1){if([w:GD200]=400;}
if([w:GD200]==800)
{[w:GD200]=0;}
}