Description
Assignment #2
.From this week you will start working with Arduino Uno. This Module is introductory. Follow the video instructions and install the Arduino IDE on your computers and then write the “Hello World” Example.
What you need to do is:
1- Install the IDE
2- Upload your first program to your Arduino board.
3- Explain everything you have done in steps:
from the installation of IDE to write your program. And discuss how you write the code and explain your code line by line and what is your program output.
Module 2 Summary
Please summarize briefly (bullet points) what you have learned in this Module.
Module 3 Summary
Please summarize briefly (bullet points) what you have learned in this Module
Presentation (10 minutes)
Please prepare 10 minutes presentations (~ 5 slides)
Search and select any topic at your choice related to AIML, Robotics, Wireless communication systems, Cloud systems, or IOT
Each students required to submit the presentation slides via Canvas
Each student required to present during the ground session
Unformatted Attachment Preview
From this module, we will start the Arduino workshop.
Arduino Workshop
For the workshop, you need to follow the instructions which cover everything you’ll need
to know in order to create your own Arduino projects. Along with the course videos
themselves, you can find all of the related course material such as code examples, circuit
diagrams, images, and other resources.
Workshop Goals:
•
•
•
•
•
•
•
Understand what an Arduino is and how it works
Learn how to use an Arduino safely
Program your Arduino using code that you’ve written in the Arduino IDE
(Integrated Development Environment)
Learn programming concepts using C and C++ along with Arduino-specific
programming
Understand best practice concepts for programming and prototyping
Use a wide variety of hardware and components and prototype your projects
using a breadboard
Build your own innovative project with Arduino
TdlE9NALinks to an external site.
Chapter 1: Introduction to Arduino
1.0 Chapter Overview
In this chapter you’ll learn about:
•
•
•
•
•
•
What is Arduino
Different types of Arduino boards
How does the Arduino Uno board work and why it’s so popular
What is a microcontroller
How to use the Arduino IDE (Integrated Development Environment)
Powering and connecting your Arduino to your computer
•
Uploading programs to your Arduino board
By the end of this chapter, you will have uploaded your first program to your Arduino
board to control an LED.
(435) Arduino Workshop – Chapter One – Introduction – YouTubeLinks to an external site.
1.1 What is Arduino?
In this section, we look at what is Arduino, what it’s good for makers, and some of the
different types of Arduino boards available.
(435) Arduino Workshop – Chapter One – What is Arduino? – YouTubeLinks to an external
site.
1.2 What is a Microcontroller?
In this section, we’ll be looking at what is a microcontroller (the chip at the heart of any
Arduino board), an overview of how they work, and how it integrates with the Arduino
environment.
(435) Arduino Workshop – Chapter One – What is a Microcontroller? – YouTubeLinks to an
external site.
1.3 The Arduino Uno
In this section, you’ll learn about the features and capabilities of the Arduino Uno board,
how the layout of the board can affect your project, and why the Uno is such a great allrounder.
(435) Arduino Workshop – Chapter One – The Arduino Uno – YouTubeLinks to an external
site.
1.4 Arduino IDE and the Language
In this section, we’ll take a look at the Arduino IDE, which is where you write the code for
your Arduino, upload it, and communicate with your board. We’ll also cover the
programming language that Arduino IDE uses, and where to download it.
(435) Arduino Workshop – Chapter One – Arduino IDE and the Language – YouTubeLinks
to an external site.
1.5 Powering and Connecting Your Arduino
In this section, you’ll be learning about the various ways to power your Arduino, and how
to connect it up to your computer for uploading your programs, and communicating to the
computer using the serial port.
(435) Arduino Workshop – Chapter One – Powering and Connecting Your Arduino –
YouTubeLinks to an external site.
Arduino Power Layout
1.6 Hello World Example
In the final section of this chapter, we’ll talk about using the Arduino IDE to upload your
first program to your Arduino board.
void setup() {
pinMode(13, OUTPUT);
//setup pin 13 as an output
}
void loop() {
}
digitalWrite(13, HIGH);
// turn the LED on (HIGH outputs 5V)
delay(500);
// wait for 500 milliseconds
digitalWrite(13, LOW);
// turn the LED off (LOW outputs 0V)
delay(500);
// wait for 500 milliseconds
(435) Arduino Workshop – Chapter One – Hello World Example – YouTubeLinks to an
external site.
Module 3 Readings
Chapter 2: Using Inputs and Outputs – Part 1
2.0 Chapter Overview
In this chapter you’ll learn about:
•
•
•
How to properly structure your code
Using variables to write more capable programs
Building circuits using a breadboard
2.1 Program Structure
In this section, we’ll be learning about how to properly structure code using indentations,
nested levels, and semicolons.
(442) Arduino Workshop – Chapter Two – Progam Structure – YouTubeLinks to an
external site.
2.2 Using Variables
In this section, we’ll explore the use of variables, which will allow you to write more
sophisticated code.
(442) Arduino Workshop – Chapter Two – Using Variables – YouTubeLinks to an external
site.
Arduino Reference Datatypes:
If you’re interested in learning more about the various data types that Arduino supports,
check out the reference pageLinks to an external site..
2.3 Building Your First Circuit Using a Breadboard
In this section, we’ll look at using different components such as LEDs, buttons, jumper
wires, resistors, and a breadboard to construct a circuit.
(442) Arduino Workshop – Chapter Two – Building Your First Circuit – YouTubeLinks to an
external site.
If you’d like to know more about how electronic components work, check out
the Analogue Electronics Crash Course and All About LEDs tutorials for more in-depth
information.
Wiring Diagram
Analog Electronics Crash Course
Welcome to our beginners tutorial on analog electronics. Living in the digital age that we
do, it’s easy to disregard the world of discrete analog components, however, these concepts
form the basis for everything from your mobile phone to space satellites.
You don’t need to know anything about electronics, we’ll go through everything in a way
that’s easy to understand, and by the end of this tutorial, you’ll be building circuits like a
pro! Don’t worry if you read something and it doesn’t make sense at first.
Check out the Beginner Parts Kit:
First Checkout the Electronic Components Guide Video
A clear, concise, yet simple explanation of resistors, capacitors, diodes, and transistors.
https://www.youtube.com/watch?v=N8_1wb0r0DQLinks to an external site.
The general Guide
This tutorial has a lot of content in it, but never fear! Our general Guide below has various
sections.
•
•
•
What is electricity
Ohms law
Difference between components
o Resistors
o Capacitors
o Diodes
o Transistors
What is Electricity?
Before we get anywhere, we need to understand what electricity actually is. We’ll be
simplifying things quite a bit, however, it’s a good starting point.
To understand how an electrical circuit works, we’re going to create an analogy and a set
of rules which govern how the analogy works.
Imagine a pipe that is on a slant (one end is higher than the other). At the high end, there is
a big pile of marbles, and there is an empty container at the low end. The pipe is filled with
marbles with no gaps, however, the marbles can’t roll down the pipe by themselves, you
have to push a marble in from the top, and then a marble will (almost) instantaneously
come out at the bottom. And the marbles can only travel down from the top end to the
bottom, they can’t travel from the bottom up.
That’s the basic analog, now let’s tie in electrical concepts with our imaginary pipe.
The high end represents the positive terminal on our battery/power supply and the low
end represents the negative terminal. The amount of marbles that are stored at the top of
the pipe is like our battery/power supply. A battery can run out of charge when the
marbles at the top are diminished.
The gradient of the slope of the pipe (the difference in height between the top and
bottom) represents the Voltage, which is measured in Volts. Voltage is the potential work
that can be done. It is like the potential energy that our marbles have. The greater the
height, the greater the potential energy they have. The higher the voltage, the more
potential we have to perform work.
The diameter of the pipe is our load, or resistance, which is measured in Ohms. The higher
the resistance, the smaller the pipe is, and fewer marbles can pass through it at a time. The
wider the pipe, the lower the resistive load.
As we alluded to above, a current is the number of marbles that can pass through a circuit
at any given time, and is measured in Amps. Therefore, the greater the resistance is in a
circuit, less current can flow, the lower the resistance, the greater the current.
Ohm’s Law: V = IR
The relationship between Voltage, Current, and Resistance is expressed quite si
Law: V = I x R. That is Voltage (V) is equal to the Current (I) multiplied by the Re
Some simple algebra shows that we can work out any of those values in a circu
know the other two.
Let’s use this knowledge to work out the current flowing through the circuit to our left.
We are using a 9V battery as our power supply, and a resistor symbol to simulate a circuit
load of 100 Ohms. We have 9 volts of electrical potential energy which will be used by the
time it gets back to the negative terminal (the short line on the right of our battery is the
negative terminal, and the taller line on the left is the positive terminal). That means that
there will be a voltage drop of 9V across the resistor (load). We need to rearrange V = IR
to become I =V/R. Let’s put our values in to make I = 9/100.
We, therefore, have 0.09 Amps (A) of current flowing through our circuit, or 90 milliamps
(mA). **We use the letter ‘I’ in equations to refer to the current**
Going back to our pipe analogy, because the wire has such a low resistance (for most
schematics we pretend it doesn’t have a resistance) putting that resistor in our circuit is
like we’ve put a narrow section of pipe in between the top and the bottom, and it has
reduced the number of marbles that can be pushed through at a time.
So now we have a basic understanding of how electrical energy works, let’s take a look at
some of the common components we can use in a circuit to change the way that the
electricity (marbles) flows.
Components
Electronic components are the building blocks of circuits. Even the fanciest code would be
useless without a circuit for it to run on. There are thousands of different categories of
components, we’ll be focusing on the main ones.
Resistors
Resistors are the unappreciated working class of electronics components. The job of a
resistor is fairly self-explanatory, it resists the flow of current in a circuit. We measure
resistor values in Ohms. An Ohm is a very small unit, most resistors are measured from
several hundred Ohms to millions of Ohms. Every part of a circuit will have a resistance;
the copper wires we use to connect our components have a resistance (it is so small we
ignore it usually) because whilst copper (or other conductive materials) is a great
conductor, it is not 100% perfect. Resistors are non-polarised components, which means
that it doesn’t matter which end you connect to what, it will still function exactly the same.
The schematic symbol for a resistor:
Capacitors
A capacitor can be thought of as a battery that can charge and discharge extremely
quickly. Its construction is a bit like a sandwich; there are two conductive plates,
separated by an insulator. Capacitors are measured in Farads (F). A Farad is quite a large
unit of measurement and most capacitors that you will find in everyday circuits are
measured in picoFarads (pF), nanoFarads (nF), and microFarads (uF). Capacitors can be
used for many different reasons such as power supply filtering, timing, frequency
responsive filters, and decoupling (blocking Direct Current). Capacitors come in two
flavors, polarised and non-polarised. They are generally named after the dielectric used in
them (the conductive material). Some examples of non-polarised capacitors include Film,
and Silver Mica capacitors, whilst Tantalum and Aluminium Electrolytic capacitors are
polarised. They usually have a grey stripe or marking to denote the negative lead.
The schematic symbol for a polarized (left) and unpolarized capacitor (right):
Diodes
There are a few important things to note when choosing a diode to use. A diode acts as a
one-way valve for an electrical current to flow. A diode has two leads, one that is called
the ‘anode’ and the other the ‘cathode’. The modern-day silicon diode looks nothing like
the original vacuum tube diodes, however, the concept is the same. There are different
types of diodes such as general signal, Schottky, Zener, Rectifier, and LED, however, they
are mostly just spec variations of a general diode, designed to fulfill specific applications
(with a few functional twists thrown in). Allowing the current to flow through the diode is
known as forward biasing (ON) and occurs when the voltage at the anode is higher than
the cathode. This will allow current to flow from the anode to the cathode. Reverse biasing
(OFF) is the state where the diode is blocking current flow.
The forward (ON) voltage that is required for the diode to start conducting, is usually
around 0.7V, however, Schottky diodes are designed specially to have a low (0.2V – 0.3V)
forward voltage.
Current and Voltage ratings are important to note, as if exceeded, you can blow the diode.
Small signal diodes are generally only rated for 200-300mA, whereas rectifier diodes are
designed to handle larger amounts of current for power supply purposes.
Likewise, diodes will have a breakdown voltage which they are rated for, so if you reverse
bias a diode with a greater voltage than this, it will conduct in reverse bias, however, it will
usually permanently damage the diode. Zener diodes are special diodes that have low
breakdown voltages and are designed to be reverse biased as well as forward biased.
Diodes will also exhibit a forward voltage drop which is dependent on the forward
current, however, for most diodes, it is around 0.7V.
LEDs are a special type of diode which emit light when their forward is met.
The schematic symbol for a general-purpose diode:
Transistors
Rounding off our basic components is the humble transistor. The invention of this little
device is what opened the floodgates for modern electronics. Everything from your car
radio to your cellphone, to a space satellite, has transistors in it. Even the most advanced
computer processor consists of billions of tiny transistors packed onto a single chip.
There are two main transistor technologies, however, we’ll be focusing on the most
commonly used one, the Bipolar-Junction Transistor (BJT).
A transistor’s function is to control the flow of current, from another source. You can
control a very large current/voltage from a very small control signal. Instead of powering a
motor directly from a small microcontroller (which will most likely draw more current
than the microcontroller can handle, and fry it), you can control the transistor using a
small logic-level signal, and use the transistor as a switch to drive a larger power supply for
the motor.
Bipolar-Junction Transistors come in two varieties: NPN and PNP.
An NPN transistor symbol has the arrow pointing away from the body (left), and a PNP
transistor symbol has the arrow pointing towards the body (right) indicating the flow of
conventional current relative to the device.
The difference is in the semiconductor construction and while operating in the same
manner, the control method for them is slightly different. The most commonly used type is
the NPN BJT so let’s have a look at how it works.
When using an NPN transistor as a switch, we place our load between the positive supply
and the Collector pin and use the transistor as a switch from the load (Connector) to the
ground at the Emitter pin. A BJT transistor has 3 pins; Base, Collector, and Emitter. The
base is the control pin, and the current flows to the Emitter and Collector. This will give us
nice simple, stable operation.
Let’s Build Something
Now that we’ve looked at what each basic component does, we’re going to take
everything we’ve learned so far and integrate it all into one circuit.
Let’s take a commonly used transistor like the BC547. The BC547 is a good all-rounder
NPN transistor that is suitable for small signal switching, and low-power audio
amplification.
Let’s have a look at the circuit on the right. Our goal is to turn on the LED using a
transistor as a switch. You might be wondering why we’d bother using a transistor in this
schematic, and it’s a fair question. For this particular application of switching an LED,
there isn’t really much point, however, we can use the transistor to drive bigger loads, or
replace the switch with a microcontroller.
Anyway, we’re going to break the circuit down component by component. We have a 5V
power source at the top, and we’re using the schematic shorthand for our ground
connections. Now, what do all these extra components do?
•
•
•
•
•
Switch: When the switch is open, the transistor base is left unconnected which won’t
allow any current to flow through it. When we close the switch, we connect the base to
our 5V supply via a resistor in series (R1) to limit the current to the transistor. This will
turn the transistor ‘on’ and allow the current to flow.
T1: This is our BC547 transistor which will act as a switch to turn our LED on.
R1: This is a current limiting resistor to make sure that we don’t destroy our transistor
by allowing it to draw too much current (it’s only designed for small signals). 1K Ohm is
a good value for this.
R2: This is another current limiting resistor, this time for our LED. We’ll use Ohm’s law
to work out the value below.
C1: This capacitor is going to act a bit like a backup reservoir which will continue to
power our circuit for a short time after disconnecting the power supply. When we
connect 5V to our circuit, it will charge the capacitor, but having nowhere to go, it will
simply remain charged until there is a load to drain it. Because our power supply is
powering our circuit, it is constantly topping up C1, however, when we disconnect our
power supply, C1 will briefly provide a small amount of power while we are drawing
current with our circuit. Calculating the exact capacitance needed is slightly more
complicated than using Ohm’s law, so we’ll just use a standard large(ish) 100uF
capacitor.
Now we know all of the component values by using standard values, however, for R2 we
need to work out an exact value to make sure that we don’t destroy our LED by dropping
5V across it and allowing it to draw too much current. LEDs can have different
specifications depending on the color, brightness, and efficiency. The 5mm LED 6 pack is a
well-started pack and lists the max current draw at 20mA and a forward voltage drop of
approx. 2V.
We know that from the 5V supply point to the ground (0V) we will use up 5V of energy. If
we only have an LED there, then the laws of physics dictate that the LED will use all of
that, and they are only rated for 2V. So our resistor needs to use up 3V out of our 5V, and
alse limit the current through that section of the circuit to 20mA.
Using ohms law we can work out the value of R2 by changing V=IR to R=V/I. I = 20mA
(0.02A), V = 3V so we substitute those values in to get R = 3/0.02 = 150.
This means that the smallest value resistor we can use is 150 Ohms. We can of course use
a larger value resistor as it will simply reduce the current further (decreasing brightness),
however, a smaller value resistor will allow too much current to flow. Fortunately, 150
Ohms (150R) is a standard value. If we had gotten a result like 149.3 we would simply
round up to the nearest standard resistor value.
Great! Our finished schematic is complete with all required component values.
Theoretical knowledge is all well and good, but let’s actually build the circuit on a
breadboard to see what’s happening.
This is what your breadboard should look like with all of the connections. Make sure that
the flat side of your BC547 is the side with the ‘N’ in the picture. Connect a 5V supply to
your board and try pushing the button. What happens when you disconnect the power
supply while holding the button? The LED should stay on for a little while.
You can use a higher voltage power supply, however, you will need to alter the value of R2
to account for it. Simply redo the calculation using Ohm’s law as such:
R = V(x – 2)/0.02 where ‘x’ is the voltage of your power supply.
Hopefully, the weird and wonderful world of electronics has started to make some sense,
but don’t worry if you didn’t quite understand everything that was going on. The very best
way to learn is by building things yourself, finding out what happens when you change a
component, or something goes wrong. Pair this knowledge with the microcontroller
platform of your choice, and you’ve got all the tools to build your first robotics project.
MSCS3008
A Crash Course All about LEDs
A Crash Course All about LEDs
(442) A Crash Course All About LEDs (Light Emitting Diodes) – YouTubeLinks to an
external site.
Welcome to our tutorial where we a look at all things LED. Now first of all, what is an LED?
LED stands for Light Emitting Diode and is an electronic component used to convert
electrical energy to light energy. This process is called electroluminescence. LED
technology is all around us, indicators on consumer electronics, automotive brake lights,
TV screens, and almost every electronic product will utilize LEDs in some shape, or form.
The wider usage of LED technology is due to the power efficiency, compact form,
robustness, and ease of use compared to traditional forms of lighting. So now that we
know they’re useful, how do they actually work?
In this article, we’ll be using basic electronics theory and terms, so if you’re not familiar
with Ohms law, voltage, current, and other such terms, take a quick read of our Analogue
Electronics Crash Course first.
Working Principle of LEDs
A LED, as the name implies, is a special type of diode, one that emits electromagnetic
energy (light) when activated. We won’t be going right down to the nitty-gritty physics
behind semiconductor technology but a diode consists of a P-N junction. A P-N junction is
two semiconducting materials, one which is processed (‘doped’) to have a great number of
electrons (N for negative as electrons are negatively charged particles), and the other
which is doped to have fewer electrons, or ‘holes’ where the electrons are missing (P for
positive as an absence of electrons creates a positive charge). When a current passes
through this junction, electrons jump from the N side to the P side to fill the holes as
electrons move around the circuit and as the electrons cross this gap, energy is given off
(in the case of LEDs, light energy). The lower-level physics is a little more complicated than
that, but suffice to say that you can control the wavelength of the energy emitted
(wavelength corresponds to a color of visible light) by altering the construction of the LED
and the materials used to create the P-N junction.
By User: S-kei – File:PnJunction-LED-E.PNG, CC BY-SA 2.5Links to an external site.
Speaking of colors, LEDs are available in a wide variety of colors, shapes, sizes, and
intensities (brightness), however, something that often confuses people is why Blue LEDs
are usually more expensive than other colors of LEDs. It’s because of the fact that whilst
colors such as Red, Green, and infrared LEDs have been around for almost half a century,
blue LEDs have only been around for a decade or two because they require a different
material and process for construction (Gallium nitride GaN). Now you can get almost any
color of LED including non-visible spectrum LEDs such as infrared (as used in remote
controls) and ultraviolet.
Construction of an LED
An LED is a fairly simple device, it consists of an epoxy body (either clear or colored) with
the semiconductor die in the middle attached to two leads. The two leads on a diode are
known as the Anode and Cathode. The Anode of the LED is the positive lead, and the
cathode is the negative lead. On standard through-hole LEDs, the body will have a
flattened edge on one side, the lead on this side is the cathode and is usually also the
shorter lead. LEDs, like diodes, are polarised devices which means they will only allow
current to flow in one direction. If you insert an LED into your circuit incorrectly, it won’t
break, it just won’t light up.
By Inductiveload – Own work by uploader, drawn in Solid Edge and Inkscape., Public DomainLinks to an external site.
So that’s nice to know and all, but how do you actually go about using LEDs? Let’s take a
look.
Using LED
s
Whilst there are many different types of LEDs for different applications including
automotive and home lighting, today we’re going to focus specifically on the standard LED
types used in electronics. These LEDs are available in various forms such as 10mm-3mm
through-hole packages, and SMD packages, however, the principle is the same. When
using LEDs, there are 2 important characteristics that need to be considered in order for
them to work properly. As LEDs are just a special type of diode, many of the principles
discussed here also apply to diodes.
By Afrank99 – Own work, CC BY-SA 2.0Links to an external site.
Forward Voltage:
In order for an LED to emit light, a certain voltage needs to be applied across the LED. This
is known as the ‘forward voltage’, or to put it another way, the LED will cause a loss of a
fixed voltage across it, and this is required for light to be produced. For most LEDs, this is
between 1.7V-3.3V depending on the color of light emitted (a Blue LED requires a higher
forward voltage than a Red LED).
Forward Current:
As with any electronic component, an LED is a load on a circuit and when a circuit is
completed, current flows. The forward current of an LED refers to the amount of current
it will consume when operating at its intended brightness. For most LEDs, it’s between
15mA-20mA and it’s important to take note of this as allowing an LED to draw too much
current will dramatically shorten its life (a Blue LED hooked up directly to a 12V supply
without any current limiting will be destroyed in a few seconds). Because of the extremely
low current draw vs. brightness, LEDs are replacing traditional forms of lighting in almost
every area due to their efficiency.
Protecting LEDs with a Current Limiting Resistor:
So the forward current and voltage are important, so how do we ensure that our LEDs are
being powered safely and efficiently? Well since most power supplies are going to be
greater than the forward voltage, and be cable of supplying more than the forward
current, we need to create an additional load on our circuit, so we use a resistor.
If you’ve read our Analogue Electronics Crash Course, you’ll have a fair idea of how
resistors work, but let’s recap quickly.
A resistor’s job is to (you guessed it) resist the flow of electrons (current), and any
resistive load will cause a voltage drop across it. So we can use a resistor to limit the
current being supplied to our LED and calculating the resistance required is a simple
matter of applying Ohms law: V=IR (Voltage = Current x Resistance). So let’s dig in!
Let’s take the following characteristics of a typical Red LED with a forward voltage of 1.8V
and a forward current of 20mA. For the simulation, we’ll be using a 9V power supply.
So we will be using Ohms law to find the resistance value we need so we re-arrange the
formula to be R=V/I, we just need to find the voltage drop across the resistor and the
current to give us the resistance. If the LED drops 1.8V across it, another 7.2V is going to
drop across the rest of the circuit (or resistor), so V=7.8. Seeing as we want to limit the
current through the circuit to 20mA, I=0.02 (Amps). So now we can divide 7.2 by 0.02 to
give us: 360. Therefore we need a current limiting resistor of 360 Ohms.
And that’s all there is to it, now you can work out the resistor value required to drive any
LED. Try solving another problem using V=IR where the LED has a forward voltage of
2.2V, a forward current of 18mA, and the power supply is a 12V supply, and post your
answers in the comments below!
Controlling the Brightness
If you want to adjust the brightness of an LED, you can increase the current limiting
resistor to reduce the current to the LED and reduce the brightness, however, make sure
that you don’t go below the calculated resistor value. This is fine to permanently fix the
brightness, however, unlike incandescent bulbs (traditional style light globes using a
stranded filament) you can’t adjust the brightness just by changing the voltage to the LED.
You’ll get a weird response and it won’t be a nice smooth change.
Using Multiple LEDs: Series vs. Parallel
Using one LED is fine, but what about if we want to connect more than one LED up to a
power supply and have them all light up? You’d think that we could simply connect the one
after the other with a resistor at the end, this is known as connecting them in Series.
However, if we did this, each LED has a voltage drop, which means that each consecutive
LED has less and less voltage available, which means the LEDs will get dimmer and
dimmer as you go down the circuit. What we need to do is connect them in Parallel as
shown:
This way, every LED is in its own loop of the circuit, and no LED is receiving more power
than another. But be warned, say you need a 360 Ohm resistor for a single LED, as shown
above, you can’t use a single 360 Ohm resistor for all of the LEDs because that value is
designed to limit the current to only 20mA, but if you have multiple LEDs connected up in
parallel, the current draw for them adds up, so we need to recalculate for a current draw
of all the LEDs combined.
RGB and Digital LEDs
As exciting and all as a single color LED is, a big upside of LEDs is that because of their
small size, you can combine multiple LEDs into a single package to create an RGB (Red
Blue Green) LED which creates colors across the visible spectrum thanks to additive light.
Using these LEDs is simple, they have a common lead (either the Cathode or the Anode)
and a separate lead for each color which you can use to control each color channel
independently. These are great, but imagine using a lot of them and the number of pins it
would take to control them. In recent years we’ve seen the development of digitally
addressable LEDs which pack an RGB LED plus a tiny controller chip into a standard
package and allow you to control huge strips of them with a single microcontroller pin.
Purchase answer to see full
attachment