You are on page 1of 10

PRACTICAL

ACTIVITIES
Introduction
In this session we will study a very interesting technology called PWM. What is this
technology?
In the digital ports of the Arduino we can only have two states, either on or off, as shown
in the diagram. When the pin is off it has the value 0 and when it is on it has the value 1. The
analog signal has several values over time.
For us to work with this PWM technology in the Arduino we have to take into account the
analogWrite() instruction, it means that it writes an analog value. Only the outputs that are
represented by ~ are analog outputs. This technology allows the use of RGB LEDs.
Through STEAM methodology, in this activity it was possible to apply pedagogies that
use Science, Technology, Engineering and Mathematics.

Goals

In this example it is shown how we can obtain other colours by mixing different values of
voltage that will be given to each of the pins. The first value is ren, the second is green and the
third is blue. To obtain green we will have to put the others with the value 0. The value of 255
represents the voltage of 5V and the value of 0V. To get the other colours we will have to mix
them.

2
Development

1. Open the Tinkercad application and create a new project.

2. Change the project name to " RGB LED".

3
3. In the components area select the breadboard small and place it on the desktop.

4. Then select the arduino Uno and place it on the desktop as well.

4
5. We use an arduino and an RGB led.

5
6. Select the RGB LED component and place it on the breadboard

7. For each of the pins with the exception of the ground pin put an electrical resistance of
100 ohm.

6
8. Regarding the code we define the pin for red as 9, for green as 10 and for blue as 11. The
connections should be made according to the picture.

7
9. RGB:The concept is usually used in reference to a chromatic model that consists of
representing different colours from the mixture of these three primary colours.
The RGB model is based on what is known as additive colour synthesis. Using the
brightness of red, green and blue in different proportions, the remaining colours are
produced. Computer monitors use additive colour synthesis to represent colours.

8
10. The following programming code allows a sequence of three colours, red, blue and green
to be represented. By giving other programming values it is possible to represent other
colours.

9
11. Appearance of the final circuit. Run the simulation.

10

You might also like