0% found this document useful (0 votes)
63 views7 pages

Worksheet 3.1

This document provides instructions for an embedded programming lab practical involving an Arduino, temperature sensor, LCD display, and LEDs. Students are asked to interface these components and write code to read temperature values from the sensor. Based on the temperature, they must turn on a specific color LED and display the temperature and status ("COLD", "MODERATE", or "HOT") on the LCD. Screenshots of the circuit and code are required. The aim is to learn how to interface Arduino with external components and conditionally execute code based on sensor readings.

Uploaded by

Humanshi Jangra
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)
63 views7 pages

Worksheet 3.1

This document provides instructions for an embedded programming lab practical involving an Arduino, temperature sensor, LCD display, and LEDs. Students are asked to interface these components and write code to read temperature values from the sensor. Based on the temperature, they must turn on a specific color LED and display the temperature and status ("COLD", "MODERATE", or "HOT") on the LCD. Screenshots of the circuit and code are required. The aim is to learn how to interface Arduino with external components and conditionally execute code based on sensor readings.

Uploaded by

Humanshi Jangra
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
You are on page 1/ 7

Worksheet 3.

Student Name: Humanshi UID: 21MCA3001


Branch: MCA Section/Group: 21MCA-4A
Semester: 4th Date of Performance: 12-05-2023
Subject Name: Embedded Programming Subject Code: 21CAH-752

1. Aim/Overview of the practical: (For ODD UIDs)


Interface an Arduino with a TMP35 sensor and follow certain conditions:

Pick the temperature value randomly: range of temp is 0 degree Celsius to 50 degrees Celsius.

a) Turn on the Red light and print “COLD” in the 2nd Row on the LCD and the temp value “Temp is = ”
in the Ist row on LCD and the rest Leds are in off condition.
b) Turn on the Green light and print “HOT” in the 2nd Row on the LCD and the temp value “Temp is = ”
in the Ist row on LCD and the rest Leds are in off condition.
c) Turn on the Yellow light and print “MODERATE” in the 2nd Row on the LCD and the temp value
“Temp is = ” in Ist row on LCD and the rest Leds are in off condition.

Note:

1. Paste the Screenshots of Every Circuit as per the mentioned case.


2. Screenshot should have your Name and UID (21MCI1234_XYZ)
3. Mention the comments in the programming.

2. Apparatus (For applied/experimental sciences/materials based labs):

Hardware Requirements: Arduino Uno, Breadboard, Resistor(1k Ohm, 220 Ohm), Temperature
Sensor, LCD(16x2), LEDs( Red, Green, Yellow)

Software requirements: Tinkercad

3. Circuit Diagram(TinkerCad):
1. Coding:
//21MCA3001_HUMANSHI
#include <LiquidCrystal.h>

int seconds = 0;
int red =6;
int yellow=8;
int green=9;
int temp= A0;
LiquidCrystal lcd_1(12, 11, 5, 4, 3, 2);

void setup()
{
lcd_1.begin(16, 2);
lcd_1.print("hello world!");
pinMode(red, OUTPUT); // Set red LED pin as output
pinMode(green, OUTPUT); // Set green LED pin as output
pinMode(yellow, OUTPUT); // Set yellow LED pin as output
pinMode(temp, INPUT);

void loop()
{
int sensorValue = analogRead(temp); // Read the analog value from TMP35
float temperature = (sensorValue * 5.0 / 1024 - 0.5) * 100; // Convert analog value to
temperature in Celsius
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting
// begins with 0):
lcd_1.setCursor(0, 0);
// print the number of seconds since reset:
lcd_1.print("temp is");
lcd_1.print(temperature);

if (temperature <= 15) {


digitalWrite(red, HIGH);
digitalWrite(yellow, LOW);
digitalWrite(green, LOW);
// Turn on red LED
lcd_1.setCursor(0, 1);
lcd_1.print("COLD");
} else if (temperature > 15 && temperature <= 35) {
digitalWrite(yellow, HIGH); // Turn on yellow LED
digitalWrite(red, LOW);
digitalWrite(green, LOW);
lcd_1.setCursor(0, 1);
lcd_1.print("MODERATE");
} else {
digitalWrite(green, HIGH); // Turn on green LED
digitalWrite(yellow, LOW);
digitalWrite(red, LOW);
lcd_1.setCursor(0, 1);
lcd_1.print("hot");
}

delay(1000);
}
5. Learning outcomes (What I have learnt):
1.

Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):

Sr. No. Parameters Marks Obtained Maximum Marks


1. Worksheet Completion 10 marks
2. Post Lab Quiz Result 5 marks
3. Student Engagement 5 marks
(Simulation/
Demonstrate/Performance
and Pre-Lab Questions))
Total 20 marks

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy