Project 2 & 3 (Group 1)

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

ELECTIVE 4: Robotics Technology Presented to Engr.

Josua Pitong GROUP 1

ARDUINO
PROJECT P R O J E C T 2 & 3

ARVIOLA - BENDO - BERNAL - CABANELA - GONZALES - LABASTIDA - ORTIZ - ROJAS - VILLALUZ


ELECTIVE 4: Robotics Technology Presented to Engr. Josua Pitong GROUP 1

PROJECT 2:
LIGHT DIMMER
LIGHT DIMMER
In this project, you'll create a
dimmer switch by adding a
potentiometer to control the
brightness of a LED.
COMPONENTS
ARDUINO BOARD

BREADBOARD

JUMPER WIRES

50K-OHM POTENTIOMETER

470-OHM RESISTOR

RED LED
ARDUINO BOARD
An Arduino board is an open-source
electronics platform that consists of a
physical programmable circuit board
and a piece of software used to write
and upload computer code to the
board. It is designed to be easy to use
and allows users to read inputs from
various sources, such as sensors or
buttons, and turn them into outputs,
such as activating a motor or turning
on an LED.
BREADBOARD

A breadboard is a rectangular plastic


board with a grid of holes that are
connected by metal strips underneath
the board. The holes are arranged in
rows and columns, and each row and
column is electrically connected. This
allows electronic components to be
inserted into the holes and connected
together to form a circuit.
JUMPER WIRES

Jumper wires are simply wires that


have connector pins at each end,
allowing them to be used to connect
two points to each other without
soldering. Jumper wires are typically
used with breadboards and other
prototyping tools in order to make it
easy to change a circuit as needed.
50K-OHM POTENTIOMETER

It is a variable resistor with a knob that


alters the resistance of the
potentiometer by adjusting or turning
it. It is commonly used in electrical
devices such as volume controls on
audio equipment. This project uses a
50k-ohm potentiometer to control the
brightness of an LED.
470-OHM RESISTOR

A 470-ohm resistor is an electronic


component that is used to resist the
flow of electrical current in a circuit. It
is a passive component, which means
that it does not generate or consume
electrical energy, but rather it converts
some of the electrical energy that
passes through it into heat.
RED LED

A light-emitting diode (LED) is a


semiconductor device that emits light
when an electric current flows through
it. When current passes through an
LED, the electrons recombine with
holes emitting light in the process.
LEDs allow the current to flow in the
forward direction and blocks the
current in the reverse direction.
HOW IT WORKS?
CIRCUIT
DIAGRAM
THE SKETCH
int potPin = A0; // Analog input pin connected to the potentiometer
int potValue = 0; // Value that will be read from the potentiometer
int led = 9; // Pin 9 (connected to the LED) is capable of PWM

// Runs once at beginning of the program


void setup() {
pinMode(led, OUTPUT); // Set pin 9 to output
}
// Loops continuously
void loop() {
potValue = analogRead(potPin); // Read potentiometer value
// from A0 pin
analogWrite(led, potValue/4); // Send potentiometer value to LED
// to control brightness with PWM
delay(10); // Wait for 10 ms
}
Program using Arduino Software
PULSE WIDTH MODULATION (PWM)
PWM is a very common method of
dimming LED lights that works by very
rapidly turning them on and off
(pulsing) for periods that visually
appear as a steady dimmed light. We
adjust the brightness level by adjusting
the percentage of the time the lights
are on (100%) to the time they are off
(0%).

Pulse width modulationas a waveform


ELECTIVE 4: Robotics Technology Presented to Engr. Josua Pitong GROUP 1

PROJECT 3:
BAR GRAPH
PROJECT 3: BAR GRAPH GROUP 1

BAR GRAPH
In this project, you’ll combine
what you’ve learned in the
previous LED projects to create
an LED bar graph that you can
control with a potentiometer.
COMPONENTS
ARDUINO BOARD

BREADBOARD

JUMPER WIRES

50K-OHM POTENTIOMETER

220-OHM RESISTOR

LEDS
ARDUINO BOARD
Arduino is an open-source platform
used for building electronics projects.
It consists of both a physical
programmable circuit board (often
referred to as a microcontroller) and a
piece of software, or IDE (Integrated
Development Environment) that runs
on a computer. It is used to write and
upload computer code to the physical
board.
BREADBOARD

A breadboard is a rectangular plastic


board with a grid of holes that are
connected by metal strips underneath
the board. The holes are arranged in
rows and columns, and each row and
column is electrically connected. This
allows electronic components to be
inserted into the holes and connected
together to form a circuit.
JUMPER WIRES

Jumper wires are simply wires that


have connector pins at each end,
allowing them to be used to connect
two points to each other without
soldering. Jumper wires are typically
used with breadboards and other
prototyping tools in order to make it
easy to change a circuit as needed.
50K-OHM POTENTIOMETER

A potentiometer is a variable resistor.


The resistance of the potentiometer
can be adjusted by rotating the
thumbwheel. 50K Potentiometer has
adjustable resistance between 1Ω and
50kΩ.
220-OHM RESISTOR

A 220-ohm resistor is a passive


electrical component with two
terminals that are used to limit or
regulate the flow of electric current in
electrical circuits. It is one of the most
common resistors in electronics and is
often used with LEDs to limit the
current that the LED can use.
LEDS

A light-emitting diode (LED) is a


semiconductor device that emits light
when an electric current flows through
it. Different color of LEDs are used in
this project to identify the level of
brightness.
HOW IT WORKS?
CIRCUIT
DIAGRAM
THE SKETCH
const int analogPin = A0; // Pin connected to the potentiometer
const int ledCount = 9; // Number of LEDs
int ledPins[] = {2,3,4,5,6,7,8,9,10}; // Pins connected to the LEDs

void setup() {
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT); // Set the LED pins as output
}
}

// Start a loop
void loop() {
int sensorReading = analogRead(analogPin); // Analog input
int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);
for (int thisLed = 0; thisLed < ledCount; thisLed++) {
if (thisLed < ledLevel) { // Turn on LEDs in sequence
digitalWrite(ledPins[thisLed], HIGH);
}
else { // Turn off LEDs in sequence
digitalWrite(ledPins[thisLed], LOW);
}
}
}
Program using Arduino Software
ELECTIVE 4: Robotics Technology Presented to Engr. Josua Pitong GROUP 1

RESOURCES

1. Arduino Project Handbook 25 Practical Projects to Get You Started. Project


2: Light Dimmer, pg. 28-33. Project 3: Bar Graph, pg. 34-38.
2. Digital Electronics 2: Group 3, pictures and videos of Arduino Project 2 and
Project 3.
ELECTIVE 4: Robotics Technology Presented to Engr. Josua Pitong GROUP 1

THANK
YOU!
ARVIOLA - BENDO - BERNAL - CABANELA - GONZALES - LABASTIDA - ORTIZ - ROJAS - VILLALUZ

You might also like