Compile Draft
Compile Draft
COMPUTER ENGINEERING
SUBMITTED BY:
CABILDO, AERRON LANCE H.
FRANCISCO, SEAN ANTONIO B.
SUBMITTED TO:
ENGR.OLIVER A. MEDINA
OCTOBER 28 2024
TABLE OF CONTENTS
A. Identification of Tools
1. Arduino UNO R3 – We use this device as a platform for controlling on
how lab activity is will work.
2. Breadboard – this help to organize our components and wirings or
connections.
3. Wires – This will be the connectors of each component and for the
Arduino.
4. LED - To show the output
B. Problem
- The task is to control 8 LEDs connected to an Arduino by lighting them up in
specific sequences. The first sequence involves lighting up all odd-numbered
LEDs, followed by lighting up all even-numbered LEDs in an alternating
pattern. The second sequence requires performing a "running light" effect,
where each LED lights up in succession, creating a chasing effect.
C. Solution
- To achieve this, we need to connect 8 LEDs to Arduino’s digital pins and
program the Arduino to control their lighting sequence. First, we’ll identify the
odd and even LEDs based on their connection pins. By writing code to control
the LEDs in groups, we can create the odd/even alternating effect. Next, to
perform the running lights effect, we will turn on each LED one after another
in a loop, making it look like the light is moving across the LEDs.
D. Technique:
- The technique involves using simple digitalWrite commands in the Arduino
code to control each LED individually. We will use a loop to alternate between
odd and even LEDs for the first sequence and another loop to create the
running light effect. Adding a delay between LED changes will help visually
distinguish each pattern. Using arrays to store the LED pin numbers makes
the code more efficient, as we can loop through the LEDs without writing
repetitive code.
LAB ACTIVITY 2 – CONTROLLING THE CONCEPT OF 7 SEGMENT
A. Identification of Tools
Arduino UNO R3 – We use this device as a platform for controlling on how
lab activity is will work.
Breadboard – this help to organize our components and wirings or
connections.
Wires – This will be the connectors of each component and for the Arduino.
LED - To show the output
B. Problem
- How can we design a 7-segment display using LEDs controlled by an
Arduino, where the input to display each digit (0-9) is provided in Binary
Coded Decimal (BCD) using 4 switches?
C. Solution
- LED Configuration: Arrange 7 LEDs on the breadboard to mimic a standard 7-
segment display layout, labeling each segment from A to G.
BCD Input: Connect the 4 switches to designated Arduino digital pins to serve
as inputs. These switches will set the BCD values (0 to 9).
Coding: Write an Arduino program that reads the BCD input from the
switches. Based on the BCD value, the program will determine which LEDs
(segments A to G) should be lit to display the corresponding number.
Control Logic: Using if statements or a switch case in the code, map each
BCD input (0000 to 1001 for 0 to 9) to its corresponding segments to light up
the right LEDs.
D. Technique:
- This project involves configuring the LEDs as a 7-segment display layout,
using SPDT switches as BCD input, and programming the Arduino to light the
correct segments based on BCD input values. The challenge lies in
accurately translating each BCD input to the correct segments.
LAB ACTIVITY 3 – IMPLEMENTING AN INFRARED SENSOR
A. Materials needed
1 × Breadboard
1 × Arduino Uno R3
2 × IR sensors
Jumper wires
1 × Typewriting paper (white surface)
1 × Electrical tape (black)
B. Problem
- How can we use IR sensors connected to an Arduino to detect the difference
between a black line on a white background and a white background with a
black line, and respond accordingly?
C. Solution
- Setup: Place the typewriting paper on a flat surface and use the electrical
tape to create black lines on the paper. Position the IR sensors close to the
paper, so they can read the reflectivity of each surface type.
Sensor Calibration: IR sensors work by detecting reflected infrared light.
Black surfaces absorb more infrared light, giving a lower reading, while white
surfaces reflect more, resulting in higher reading.
Code Modification: Modify the provided Arduino code to read values from the
IR sensors. Set threshold values in the code that differentiate between black
and white surfaces based on the readings.
Testing: Test the setup by moving the IR sensors over different areas of the
paper to ensure accurate detection of the black and white surfaces. Adjust the
threshold if necessary.
D. Technique:
- This project involves configuring the LEDs as a 7-segment display layout,
using SPDT switches as BCD input, and programming the Arduino to light the
correct segments based on BCD input values. The challenge lies in
accurately translating each BCD input to the correct segments.
LAB ACTIVITY 4 & 5 – CONTROL SYSTEM FOR MOTOR
CONTROLLER
A. Materials needed
1 × Arduino Uno R3
1 × L293D Motor Driver
2 × DC Motors
Jumper wires
Power source (for motors and Arduino)
B. Problem
- How can we build a system using an Arduino and an L293D motor driver to
control two DC motors, including both speed and direction?
C. Solution
- Connect the L293D motor driver’s VCC1 to the Arduino’s 5V pin, VCC2 to an
external power source for the motors, and GND to both the Arduino and the
power source ground. Attach Motor1 to OUT1 and OUT2 and Motor2 to OUT3
and OUT4 on the L293D. Use Arduino digital pins to control the direction:
connect IN1 and IN2 for Motor1, and IN3 and IN4 for Motor2. Finally, connect
ENA and ENB to PWM pins for speed control. The Arduino code will manage
direction and speed by setting these pins accordingly.
D. Technique:
- This setup provides full control over two motors using the L293D driver. The
Arduino sends PWM signals to adjust the speed and sets digital signals for
directional control. This design is adaptable for a range of projects, such as
moving a robot in various directions or adjusting speed as per required tasks.
B. Problem
- Design a basic mobile robot using Arduino, an L293D motor driver, and two
BO motors, capable of detecting and reacting to black-and-white surfaces
using IR sensors. The structure must be lightweight and straightforward,
utilizing popsicle sticks for the body frame, with controllable motor speed for
smooth movement.
C. Solution
- The Arduino Uno connects to an L293D motor driver, which controls the two
BO motors. IR sensors attached to the front detect black and white surfaces,
guiding motor adjustments. By configuring digital pins for direction and PWM
pins for speed, the Arduino can adjust motor speed and turning as the
sensors detect changes in surface color. A popsicle stick frame supports the
components, creating a lightweight, functional body.
D. Technique:
- The technique involves programming the Arduino to read IR sensor signals,
adjusting motor direction based on sensor input for line-following or obstacle
avoidance. PWM values control speed, making movement smoother. Popsicle
sticks offer a simple, sturdy frame, enhancing stability without adding weight,
ideal for effective IR-based navigation.
B. Problem
- The goal is to monitor water flow levels using a water flow level sensor and
store the data in a Firebase Realtime Database using an ESP8266 NodeMCU
V3, enabling real-time access and analysis.
C. Solution
- Connect the water flow sensor to the ESP8266 by linking the VCC to 3.3V,
GND to ground, and the signal pin to a digital pin (e.g., D1). Use the Firebase
library in the Arduino code to read the flow sensor's pulse count, calculate the
flow rate, and upload this data to Firebase at regular intervals.
D. Technique:
- The ESP8266 utilizes an interrupt service routine to count pulses from the
flow sensor accurately, allowing the calculation of flow rate. This data is sent
to Firebase for real-time monitoring, making the setup efficient for applications
that require constant water usage tracking and analysis.
LAB ACTIVITY 8 – ESP8266 CONTROLLING CAR USING HTML
CONTROLLER
A. Materials needed
1 × ESP8266 NodeMCU V3
1 × Water Flow Level Sensor (e.g., YF-S201)
1 × Breadboard (optional for easier connections)
Jumper wires
Power source (USB or battery)
B. Problem
- The goal is to monitor water flow levels using a water flow level sensor and
store the data in a Firebase Realtime Database using an ESP8266 NodeMCU
V3, enabling real-time access and analysis.
C. Solution
- Connect the water flow sensor to the ESP8266 by linking the VCC to 3.3V,
GND to ground, and the signal pin to a digital pin (e.g., D1). Use the Firebase
library in the Arduino code to read the flow sensor's pulse count, calculate the
flow rate, and upload this data to Firebase at regular intervals.
D. Technique:
- The ESP8266 utilizes an interrupt service routine to count pulses from the
flow sensor accurately, allowing the calculation of flow rate. This data is sent
to Firebase for real-time monitoring, making the setup efficient for applications
that require constant water usage tracking and analysis.