Assignment 05: ELECTRONICS


Problem Statement

Combine an input and output device together and collect data for an activity connected to you. Analyze that data and make sense of it. e.g. some examples could be displaying output from temperature/RH sensor on LCD Display to find the thermal comfort in your room, sounds of different frequencies from the Buzzer as the distance computed from a proximity sensor varies, Dustbin (full vs. half vs. empty) shows LED to be RED, YELLOW, GREEN. Please documents the steps and create a video/screenshots showing the interaction between the input and the output devices. Please also upload the codes used.


List of Components Required



S.NO. COMPONENT QUANTITY
1. Arduino Uno R3 01
2. Ultrasonic Distance Sensor 01
6. LCD 16X2 01
7. BreadBoard 01
8. Potentiometer (10 kilo-ohm) 01
10. Jumper Wires As required


Softwares used

1. Autodesk TinkerCAD
2. Arduino IDE 1.8.19

Modelling using TINKERCAD

The circuit model was created using TINKERCAD software. The image of the model created has been shown below.

model


Code used for Simulation in TINKERCAD


#include <'LiquidCrystal.h>
LiquidCrystal lcd = LiquidCrystal(2, 3, 4, 5, 6, 7); // Create an LCD object. Parameters: (RS, E, D4, D5, D6, D7):
const int trigPin = 11;
const int echoPin = 12;
float time, distance;
void setup()
{
lcd.begin(16, 2); // Specify the LCD's number of columns and rows. Change to (20, 4) for a 20x4 LCD
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);

}

void loop()
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

time = pulseIn(echoPin, HIGH);

distance = (time*.0343)/2;

// For Serial Monitor
Serial.print("Distance:CM ");
Serial.println(distance);

// For LCD Display
lcd.setCursor(0,0);
lcd.print("Distance in CM");
lcd.setCursor(0,1);
lcd.print(distance);

}


Actual Hardware


model