Assignment 2 Ann
Assignment 2 Ann
By
<Ehab Ahmad Soud Elamaireh 320200109187>
9/4/2025
Submitted to
Dr. Abdel Ilah Alshbatat>
Embedded Systems /0107445/1
AQC-90-24113
Page |
Ref.: Deans' Council Session (31/2024), 1
Decision No.: 282, Date:29/10/2024
Objective
The objective is to digitize an analog signal, display the voltage level of the signal
ontheserialmonitorand
accordingly excite an output device.
Apparatus
1. Tinker Cad Simulation
2. Embedded board (Arduino Uno)
3. Arduino IDE software
4. 2-Light Emitting Diode (LED)
5. 2-resistor
6. 1-10K potentiometer
7. Jumpers
8. Breadboard
Block Diagram / Circuit Schematics
(Include a diagram showing the connections between the Arduino, LED, resistors, and push-
button switches.)
AQC-90-24113
Page |
Ref.: Deans' Council Session (31/2024), 2
Decision No.: 282, Date:29/10/2024
AQC-90-24113
Page |
Ref.: Deans' Council Session (31/2024), 3
Decision No.: 282, Date:29/10/2024
Program Code
int potentiometerPin = A0;
int ledPin1 = 12;
int ledPin2 = 7;
void setup() {
Serial.begin(9600);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
}
void loop() {
int sensorValue = analogRead(potentiometerPin);
float voltage = sensorValue * (5.0 / 1023.0); // Convert sensor value to voltage
(assuming 5V reference)
Serial.print("Analog Voltage: ");
Serial.print(voltage);
Serial.println("V");
if (voltage > 3.0) {
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
} else {
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, HIGH);
}
delay(10); // Optional delay to slow down the reading frequency
}
AQC-90-24113
Page |
Ref.: Deans' Council Session (31/2024), 4
Decision No.: 282, Date:29/10/2024
Theory / Calculations/ Plots
No Calculations
In this experiment, we used the pointmeter as an input and used the LED as an output
so that the voltage value is controlled from the pionometer. If the voltage is less than
3V, the LED will light up, and if it is greater, another light will light up.
It can be used to study and control the state of voltage and use it with devices that need
to know the value of voltage to do a specific thing
AQC-90-24113
Page |
Ref.: Deans' Council Session (31/2024), 5
Decision No.: 282, Date:29/10/2024