Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ECFBCK1L - Lab03 - Group 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

EXPERIMENT 03

Tinkercad-Arduino – Circuit Simulation 2

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

1. Perform activity usingTinkercad


and Arduino. X

2. Built a street light circuit


X

3. Build a Motor and sensor circuit


X
4. Build an H-bridge and Robot
steering circuit X

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:

1. Arduino Traffic light. Watch video below of a traffic light.

https://www.youtube.com/watch?v=lk3nuIlBBnU

2. Perform the traffic light circuit above.

3. Motor and sensors. Watch video below of motor and sensors.

https://www.youtube.com/watch?v=ClW1H9L6mio&list=PLKL6KBeCnI3X7cb1
sznYuyScUesOxS-kL&index=16

4. Perform simulation of the motor and sensors.

5. H-bridge and Robot steering. H-bridge and Robot steering

https://www.youtube.com/watch?v=DCVuK39KCEU&list=PLKL6KBeCnI3X7c
b1sznYuyScUesOxS-kL&index=18

6. Perform simulation of H-bridge and Robot steering circuit.

Data:

1. Screen shot of Arduino Traffic light inTinkercad

3
https://www.tinkercad.com/things/8pGqICCyetg-exp03group-4arduino-traffic-
light?sharecode=N7-x0b0JB14qIXLTIViZ5ltp2klxoYj1Atu97h7gUeo

2. Screen shot of Motor and sensors in Tinkercad

4
https://www.tinkercad.com/things/4juDGazmOGd-exp03group-4motor-and-sensors-
?sharecode=kutK4bkak0PVFghRp8HqYbt-E8zsPGRTlSuhggvnaF0

3. Screen shot of H-bridge and Robot steering in Tinkercad

5
https://www.tinkercad.com/things/ckw4odqWv75-exp03group-4h-bridge-and-robot-steering-
?sharecode=7iuaLocFUMfBcAUd48c5kSIJ0yZKsDP5AxB8dkpnBAc

Observation

1. Arduino Traffic Light

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.

2. Motors and Sensors

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.

Conclusion and Recommendation

In conclusion, the simulations presented offer valuable insights into the


application of Arduino in various projects, ranging from basic traffic light systems to
more complex motor control and robotics. Through these observations, several key
principles emerge. Firstly, the importance of proper pin configuration and
understanding of output control mechanisms is evident, as demonstrated in the
Arduino Traffic Light simulation. Additionally, the utilization of external components
like transistors and motor driver chips highlights the necessity of interfacing with
higher-power devices beyond the capabilities of the Arduino alone, as seen in the
Motors and Sensors as well as H-Bridge and Robot Steering simulations.

Furthermore, the simulations emphasize the simplicity with which complex


interactions can be programmed using Arduino. From basic digital signal manipulation
to more advanced concepts like interrupts and motor direction control, the code
remains accessible even as the hardware complexity increases. This accessibility
encourages beginners to delve into more sophisticated projects, fostering a deeper
understanding of both hardware and software aspects of embedded systems.

Overall, these observations underscore the versatility and educational value of


Arduino simulations in teaching electronics and programming. They serve as valuable
tools for both learning and experimentation, providing a bridge between theoretical
concepts and practical implementation in real-world applications. As aspiring
engineers and hobbyists engage with these simulations, they gain not only technical
skills but also the confidence to explore and innovate in the field of embedded
systems.

Group Members Present:

• Visitacion, Hannah Mae


• Cariaso, Antonio III
• Bongyad, Rovic
• Leongson, Robilyn
• Sabado, Sanshai
7

You might also like