RoboBlocky
Sign In
Learning Math/CS/STEAM with Robotics
1.1.1 Introduction to Arduino and the RGB LED Module
Lesson Description

 

1. What is a Digital Output Device?

At the most fundamental level, a digital output device is a device with two states, usually labeled HIGH and LOW. It is like a light switch that can be either on (HIGH state) or off (LOW state).

As an example, the circuit diagram below consists of a 5V battery, a switch, and an RGB LED module.

The RGB (Red-Green-Blue) LED module is a digital output device that acts like a light bulb. It has three separate lights inside that can be turned on or off: a red light, a green light, and a blue light. The circuit above shows that the red ("R") light is connected and the other blue ("B") and green ("G") lights are not. If the circuit's switch is open, no electric current flows through the circuit and the red light will be off (we say that it is "in the off or LOW state"). If the switch is closed, current will flow and the red light will turn on. It is "in the on or HIGH state," that is, it will glow red.

 

2. Microcontrollers, Physical Computing, and Arduino

One drawback of the circuit above is that it is very inflexible: only one of the three RGB lights can be connected at one time. To turn on the green light, for example, we would have to change the wiring. But we can fix this by using a microcontroller board.

A microcontroller board is a circuit board with a microcontroller chip and various other components and sockets (or pins) to connect electronic devices to the board and create circuits to do a wide variety of tasks. The microcontroller also has built-in software so that it can be programmed to fit the task. So instead of changing the circuit to change the task (such as turning on the green light instead of the red light in the LED), we can simply change the program.

In general, the microcontroller board is like a small computer, but designed especially for "physical computing," where we build devices that can sense and respond to the world around them. For example, a microcontroller board with a temperature sensor connected to it can be used to monitor the temperature and turn on a heater if it gets too cold.

The Arduino UNO microcontroller board is a popular, open-source microcontroller board that we can use and control with RoboBlocky. In later lessons we will learn some of the basics of how to do this using Arduinos, LEDs, and electronic devices.

 

3. Arduino with an RGB LED module

A Barobo RGB LED module has four pins coming out of it, as shown below. They are labeled “B”, “G”, “R”, and “-“, standing for blue, green, red, and ground.

The LED module can be plugged directly into an Arduino board. The diagram below shows a circuit with an RGB LED module plugged into an Arduino board:

We see that one side of the Arduino board has a row of sockets labeled D0 through D13 and GND (ground). (On an actual Arduino board these are labeled 0 through 13. The extra "D" in the diagram indicates that they are digital pins. In addition, even though they are sockets, they are usually referred to as pins.)

We plug in the LED module so that its “-“ pin goes in the GND socket, and the R, G, and B pins naturally go in to the 13, 12, and 11 sockets, respectively, as shown below using an image of the Arduino board:

 

The following lessons will guide you through the process of installing needed software and connecting the Arduino to a computer, as shown below. (If you do not have an Arduino, a few "Virtual Arduino" activities are available to get a flavor of how it works.)

 

 

Vocabulary
digital output device, RGB LED Module, microcontroller board, pins, Arduino UNO board