ECFBCK1L - Lab03 - Group 4
ECFBCK1L - Lab03 - Group 4
ECFBCK1L - Lab03 - Group 4
OBJECTIVE:
The activity aims:
LEARNING OUTCOMES (LOs) COURSE LEARNING
At the end of the activity, the students OUTCOMES (CLOs)
should be able to: Understand the basic of
Feedback and Control Systems 1 2 3
MATERIALS/EQUIPMENT NEEDED:
Arduino
Tinkercad
THEORETICAL BACKGROUND
What is Arduino?
Arduino is an open source programmable circuit board that can be integrated into a
wide variety of makerspace projects both simple and complex. This board contains a
microcontroller which is able to be programmed to sense and control objects in the
physical world. By responding to sensors and inputs, the Arduino is able to interact
with a large array of outputs such as LEDs, motors and displays. Because of it’s
flexibility and low cost, Arduino has become a very popular choice for makers and
makerspaces looking to create interactive hardware projects.
Arduino Uno
One of the most popular Arduino boards out there is the Arduino Uno. While it was not
actually the first board to be released, it remains to be the most actively used and most
widely documented on the market. Because of its extreme popularity, the Arduino Uno
has a ton of project tutorials and forums around the web that can help you get started
or out of a jam. We’re big fans of the Uno because of it’s great features and ease of
use.
1
Board Breakdown Here are the components that make up an Arduino board and what
each of their functions are.
1. Reset Button – This will restart any code that is loaded to the Arduino board
2. AREF – Stands for “Analog Reference” and is used to set an external reference
voltage
3. Ground Pin – There are a few ground pins on the Arduino and they all work the
same
4. Digital Input/Output – Pins 0-13 can be used for digital input or output
5. PWM – The pins marked with the (~) symbol can simulate analog output
6. USB Connection – Used for powering up your Arduino and uploading sketches
7. TX/RX – Transmit and receive data indication LEDs
8. ATmega Microcontroller – This is the brains and is where the programs are
stored
9. Power LED Indicator – This LED lights up anytime the board is plugged in a
power source
10. Voltage Regulator – This controls the amount of voltage going into the Arduino
board
11. DC Power Barrel Jack – This is used for powering your Arduino with a power
supply
12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects
13. 5V Pin – This pin supplies 5 volts of power to your projects
14. Ground Pins – There are a few ground pins on the Arduino and they all work
the same
15. Analog Pins – These pins can read the signal from an analog sensor and
convert it to digital.
2
ACTIVITY:
https://www.youtube.com/watch?v=lk3nuIlBBnU
https://www.youtube.com/watch?v=ClW1H9L6mio&list=PLKL6KBeCnI3X7cb1
sznYuyScUesOxS-kL&index=16
https://www.youtube.com/watch?v=DCVuK39KCEU&list=PLKL6KBeCnI3X7c
b1sznYuyScUesOxS-kL&index=18
Data:
3
https://www.tinkercad.com/things/8pGqICCyetg-exp03group-4arduino-traffic-
light?sharecode=N7-x0b0JB14qIXLTIViZ5ltp2klxoYj1Atu97h7gUeo
4
https://www.tinkercad.com/things/4juDGazmOGd-exp03group-4motor-and-sensors-
?sharecode=kutK4bkak0PVFghRp8HqYbt-E8zsPGRTlSuhggvnaF0
5
https://www.tinkercad.com/things/ckw4odqWv75-exp03group-4h-bridge-and-robot-steering-
?sharecode=7iuaLocFUMfBcAUd48c5kSIJ0yZKsDP5AxB8dkpnBAc
Observation
In the Arduino Traffic Light simulation, all the necessary pins (2, 3, and 4) are
correctly set as OUTPUT at the beginning of the sketch using the ‘pinMode()’ function,
ensuring that each LED can be controlled by the Arduino. The sequence begins with
the green LED, connected to pin 4, which lights up for 3 seconds. This is achieved by
the ‘digitalWrite(4, HIGH) ‘command followed by a ‘delay(3000)’ to maintain the state
for the required duration. After the green LED turns off, the orange LED on pin 3 lights
up for 1 second. This is managed by the ‘digitalWrite(3, HIGH)’ and ‘delay(1000)’
commands. Following the orange LED, the red LED on pin 2 is activated for 3 seconds
using the ‘digitalWrite(2, HIGH) ‘and ‘delay(3000)’. These actions are enclosed within
the ‘loop()’ function, ensuring that the sequence of LEDs continues to repeat
indefinitely, simulating a realistic traffic light system.
In the Motors and Sensors simulation, the motor control is achieved through a
transistor, allowing a higher current from an external power supply to drive the motor,
as the Arduino pins alone cannot supply sufficient current. This setup is essential for
operating more powerful hardware that requires more energy than the Arduino can
provide directly. The Passive Infrared (PIR) sensor used in this simulation detects
motion by emitting infrared light. When motion is detected, the sensor outputs a high
signal (5V), triggering the motor to start spinning. The Tinkercad simulation allows
users to visualize this interaction by moving a dot in front of the PIR sensor, which
simulates motion and activates the motor. When the motion stops, the motor stops
after a brief delay. Despite the complexity of the circuit, the interface to the Arduino
remains simple, involving just one output signal to control the transistor and one input
signal from the PIR sensor. The code for this setup uses basic principles such as pin
change interrupts and simple high/low digital signals, similar to those used in simpler
circuits with buttons and LEDs. This demonstrates that advanced hardware can be
controlled with straightforward code, making it accessible for beginners to experiment
with more complex projects.
6
3. H-bridge and Robot steering
In the H-Bridge and Robot Steering simulation, an H-bridge motor driver chip is
used to control the bidirectional movement of two motors, enabling forward, reverse,
and stop functionalities. This chip integrates multiple transistors into a single package,
simplifying the circuit design. Two switches simulate bump sensors mounted on the
front of a robot. When a sensor is triggered, it changes the direction of the
corresponding motor. For example, if the left sensor is triggered, the left motor
reverses, causing the robot to turn right, while triggering both sensors causes the robot
to reverse. This basic obstacle avoidance algorithm allows the robot to navigate
around obstacles autonomously. The code employs pin change interrupts to monitor
the sensors. Each interrupt service routine (ISR) adjusts the motor direction based on
the sensor inputs. This simulation demonstrates how basic principles learned from
simpler circuits can be applied to more complex robotics applications, encouraging
learners to step beyond simulations into real-world projects. The ability to control
multiple motors and implement simple steering algorithms showcases the practical
applications of the knowledge gained from previous lessons.