COLLEGE OF ENGINEERING
PAGE 1
Upload the Code Below
Figure 3. Wiring Diagram DC motor with Speed Control, but NO Direction Control
PAGE 2
Upload the code below
It is important to understand that some objects might not be detected by ultrasonic sensors. This is because some
objects are shaped or positioned in such a way that the sound wave bounces off the object, but are deflected away
from the Ultrasonic sensor. It is also possible for the object to be too small to reflect enough of the sound wave back
to the sensor to be detected. Other objects can absorb the sound wave all together (cloth, carpeting, etc), which
means that there is no way for the sensor to detect them accurately. These are important factors to consider when
designing and programming a robot using an ultrasonic sensor.
Figure 6. Breadboard diagram and code for measuring the distance using Ultrasonic Sensor
PAGE 4
2. Shown above is the code for Ultrasonic Sensor. Here, we have declared two pins which are for trigger pin, echo pin
and two variables for storing distance and time occupied by the ultrasonic wave. In setup, the pins are defined as
input and output and the Serial Monitor is begun at 9600 Baud. In the loop, first, generate a 10-microsecond pulse to
start ranging of Ultrasonic. After this, the time occupied by Ultrasonic stored into the duration. Then converted time
into the Distance. Finally printed it to the Serial Monitor.
HANDS-ON EXERCISES
1. Perform all the activities.
2. Create a program that uses a DC motor and an Ultrasonic Sensor. See samples below:
PAGE 5
PROBLEM-BASED DESIGN LABORATORY
1. Identify a problem in your community, or schools, or at home.
2. Create a solution to the problem using your Arduino microcontroller.
3. Design and implement the solution.
4. Provide Schematic diagram, wiring diagram and breadboard diagram of your design.
5. Provide the detailed procedure of your design and testing.
6. Due after a week. Strictly no more extension and grace period.
A. COVER PAGE
Create your own cover page be sure you indicate PROBLEM-BASED DESIGN
LABORATORY No. X
B. INTRODUCTION
Make an introduction by describing the current situation, what should be the ideal
situation, identify the gaps, and what should be done to address the gaps.
C. PROBLEM STATEMENT
State the problem you want to solve using ARDUINO.
G. LEARNING EXPERIENCES
In your conclusion you should write all the learning experiences that you acquired
during and/or after the
PAGE 6