You are on page 1of 5

MICROPROCESSORS - LAB

LABORATORY MODULE 1
Name of Members:
1. __Gerian Fajardo_________________________  P1
2. _Aram  ___________
Roque___________________________________  P2
___________
3. Dan Mart 
P3
Miranda____________________________________
___________
E1
___________

Project 1 — LED Flasher


For the very first project, we are going to connect an LED to one of the digital pins which is soldered to
the board. We will also learn exactly how the hardware and the software for this project works as we go,
learning a bit about electronics and coding in the Arduino language (which is a variant of C) at the same
time. Table 2-1 below shows the parts required for our very first project.

Connect It Up
First, make sure your Arduino is powered off by unplugging it from the USB cable. Next, take your
breadboard, LED, resistor, and wires, and connect
everything up as in Figure 2-1.

Enter the Code


Open up your Arduino IDE and type in the code from listing 2-1:
Project 2 – S.O.S. Morse Code Signaler
For this project, we are going to leave the exact same circuit set up as in Project 1, but will use some
different code to make the LED display a message in Morse code. In this case, we are going to get the
LED to signal the letters S.O.S., which is the international Morse code distress signal. Morse code is a
type of character encoding that transmits letters and numbers using patterns of on and off. It is
therefore nicely suited to our digital system as we can turn an LED on and off in the necessary pattern to
spell out a word or a series of characters.
Project 3 – Traffic Lights
We are now going to create a set of traffic lights based on the system that will change from green to red,
via amber, and back again, after a set length of time using the four-state system. We will use the parts
listed in Table 2-3. This project could be used on a model railway to make a set of working traffic lights
or for a child’s toy town.

Connect It Up
Connect your circuit as in Figure 2-6. This time, we have connected three LEDs with the anode of each
one going to digital pins 8, 9 and 10, via a 150W current-limiting resistor (or whichever value you
require) for each.
Enter the Code

Discuss your observation on each project output.

Project 1:

___________ For the 1st project, we used an LED and an 100 ohms resistor. As the name suggest, the
projects goal is to make the LED blink. Using the code given, the result is that the LED would turn on for
1 second and then would turn off for another 1 second. After that the code would start again, which is
the outcome of what we call a loop.
__________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Project 2:

__ The second project used the same circuit as the first, but with a different code. The project's goal is to
create an S.O.S. code signaler, which is the international distress signal. Because Morse codes are made
up of dashes and dots, it is ideal for modifying our 1" project. Looking at the code, we can already tell
that for the dash the LED would be on for 400ms and off for 100ms per dash, and for the dots the LED
would be on for 150ms and off for 100ms, and after each letter there is an interval of 100ms, and then
after all the letters have been shown there would be a 5 second delay and then the loop will reset again.
___________________________________________________________________________________
__________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
Project 3:

_____________________________________________________________________________________
_______________________________ For this project, we will use three red, yellow, and green LEDs, as
well as three 150 ohm resistors. The loop begins with the red LED turned on, and we must wait 10
seconds for the next command to execute. While the red LED is turned on, the yellow LED will also turn
on. Wait 2 seconds for the green LED to turn on and the red and yellow LEDs to turn off. We would have
to wait 10 seconds for the next command to execute. The next command is to turn on the yellow LED
while turning off the green LED, wait 2 seconds, and then turn off the yellow LED as well. This is where
the loop begins.
_________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

EXERCISE:

Make your own Morse code according to the first letter of the first name of each members.

The corresponding number of each letter will be the number of blinks and each blink has a 500ms delay.
Then the transition of each letters has a 2 seconds delay.

After the last letter loop it back from the start.

Example: M-13, G-7

CONCLUSION:

_____________________________________________________________________________________
_____________________________________________________________________________________
__________Using Project 2, we were able to create our own code that caused the LED to blink based on
the first letter of our first letter. A gets one, J gets ten, and L gets twelve. Each blink has a 500ms interval,
and there is a 2 second delay after each
letter___________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

You might also like