0% found this document useful (0 votes)
27 views6 pages

ECE Lab 2

Uploaded by

Adilet Sanatkhan
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)
27 views6 pages

ECE Lab 2

Uploaded by

Adilet Sanatkhan
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/ 6

ELCE 100 – Introduction to Engineering (ECE Lab) REPORT

School of Engineering and Digital Sciences

Department of Electrical and Computer Engineering

[Semester, Year]

Adilet Sanatkhan, 202218041

Kuanysh Zholdybayev, 202243199

Amir Yerkebay, 202225348

Adil Shayakhmetov, 202211205

17.10.2023
2

School of Engineering and Digital Sciences

Introduction to Engineering ENG 100

ECE LABORATORY: Introduction to Arduino and circuits

Objective:

The main objectives of the laboratory work are to learn how to use the Arduino Uno
microcontroller for basic tasks. Relying on instructions and sources provided by the professor, we
gained familiarity with programming Arduino boards and working with circuits of resistors and
LEDs.

Part 1:

In this part of the lab work, three schematics of the circuits were drawn, using tinkercad
simulations. The circuits from the Laboratory slides were used in these exercises: “Motor”, “Hello
World”, and “Wheels”.

1.

2.

3.

Part 2:

Introduction:

This part of the laboratory work was conducted experimentally in the class, using the kit
provided by the instructor and the Arduino Uno. The kit included resistors, LEDs, switches, and
wires.

Objectives: кажись нужны Schematics

The purpose of this laboratory work was to experimentally learn how the Arduino Uno
microcontroller works in simple circuits, conducting different operations that depend on tasks the
user requires.

Project 1

For the first interactive experiment, Arduino was only the source of power for the simple
circuits of a resistor, an LED, and a switch.

Task 1
3

Figure 1. The first task of Project 1.

To obtain a power in the board, one end of the first wire was connected to the 5 volts pin
on the Arduino, and the other end was plugged in the long bus line in the breadboard. The other
wire was connected to the ground on the Arduino. The switch of the circuit was placed across the
center. By its color code, the resistor of 220 ohm was found and connected to the circuit,
according to the instructions. As soon as the anode and the cathode were connected to the LED,
the USB cable was plugged into the Arduino. Pressing the switch, the results shown in the Figure 1
was witnessed.

Task 2

Figure 2. The second task of Project 1.

The second task was to place components in series – one after another. Altering the circuit
built in the first task, the second switch was placed next to the one in the circuit. Wires were
placed in series, as pictured in the illustrations. The anode and the cathode were connected to the
LED, according to the instructions. To turn the LED on, both switched had to be pressed, as they
were set in series. The result from the Figure 2 was obtained.

Task 3

Figure 3. The third task of Project 1

In the third task, the switches were supposed to be connected in parallel. This time, the
switches were wired to the resistor. The other ends of the switched were connected to the LED.
This way, if either button is pressed, the circuit will be completed, and the light will turn on, as
shown in Figure 3.
4

Project 2

Figure 4. Circuit of Project 2 task.

Purpose of project 2 is to create a spacecraft interface. Circuit consists of 3 diods


connected in series to 220 Ohm resistors, and each diod is attached to different digital pins. Also,
switch is connected in series with 10 kOhm and 5V pin, ground pin of Arduino breadboard.
According to this circuit, green LED diod is turned on when switch is open. But when switch is
closed other 2 blue LED diods light up by delay of 250 milliseconds.

In order to accomplish this project, we also needed to use the code. Arduino has two main
functions which are setup() and loop(). Here is the code with appropriate comments:

int switchState = 0;

// switchState variable is used to store the state of switch of integer data type

void setup()

// the setup() function is executed when the Arduino is first powered on

pinMode(3, OUTPUT); // the pins connected to LEDs are OUTPUTs

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(2, INPUT); // the switch pin is INPUT

}
5

void loop()

// this function check for voltage on the inputs, and turns outputs on and off

switchState = digitalRead(2);

// this function checks the voltage level on a digital cafe

if(switchState==LOW)

// the button is not pressed, hence 3 (green LED) is on, whereas other 4 and 5 (blue LEDs)
are off

digitalWrite(3, HIGH);

digitalWrite(4, LOW);

digitalWrite(5, LOW);

else

// the button is pressed

digitalWrite(3, LOW);

digitalWrite(4, LOW);

digitalWrite(5, HIGH);

delay(250);

// this is needed for the LEDs to turn on one-by-one, and their time delay is equal to
quarter second

digitalWrite(4, HIGH);

digitalWrite(5, LOW);

delay(250);

}
6

Figure 5. Scheme of resistor value reading.

Conclusion

In conclusion, as a result of done laboratory work, we can assume that members of our
group had successfully accomplished the goals. We learned the principles of creating electrical
circuits consisting of resistors, diods and switches in combination with Arduino plate. Also, we
figured out a basics of writing code for Arduino circuits. Nevertheless, during the experimental
work we had faced few problems. One of them was related to the malfunctioning of wires and
diods used, because of this we could not reach an expected result. However, we could derive a
cause of problem and successfully finished all experimental tasks.

You might also like