• EUR€
  • £GBP
  • $USD
TUTORIALS ArduinoGravity

Starter Kit for Arduino/Genuino-101 Tutorial Lesson 1: What Makes Our Devices “Alive”?

DFRobot May 10 2017 245

Interactive Devices

In the following chapters, we will be building interactive kits that either can light on an LED when the button is pushed, or show measurements from a temperature sensor. Those Arduino kits can all be categorized as “interactive devices”. To help you better understand their mechanism, we need first understand how they are made up.

The simplest interactive device must be consist of 3 parts:

-Input units for command receiving or data collection.
-Control units for data processing and signal transition.
-Output units for sending out data or executing a real action.

So what do all these units do? Take ourselves as example, we collect information through our eyes, ears, nose and skin in the form of light, sound, smell and force, the information will then go to our brain to be decided what reaction to take. Finally, we take actual actions to make change to the physical environment based on the information. To be more specific, in the case that your friend says “hello”, and you returns in “hi”, your ear is acting as the input unit, your brain as the control unit and your mouth as the output unit.

Likewise, for Genuino 101 based projects, we use different sensors as input units, 101 as control unit and actuators as output units.

Input Units - Sensors

A sensor (also known as transducer) is a physical unit to sense or detect the characteristics of environment (such as light, temperature or moisture) and transmit data as signal. In this tutorial, we will be using sensors such as buttons, sound sensors and temperature sensors.

Control Unit – Genuino/Arduino 101

Here, 101 will be acting as the control unit by building connections between input units and output units through its signal pins, and process data on its computing module.

Output Unit - Actuators

An actuator is a type of device that is responsible for moving or controlling a system or mechanism. It converts energy into motion, sound or light. In this tutorial, we use actuators such as LED light, buzzer and servo.

IO Pin

IO pins are signal pins that provides data transition for both input and output components. They are also where components are connected to the board. There are 3 types of IO pins on Genuino 101.

- DigitalPin
- AnalogPin
- ProtocolPin(Digital)

Digital pins can either send digital signal (some of them support pulse-width modulation signal) or receive digital signal, which means it supports both sensors and actuators. However, analog pins only receive analog signals, which only support analog sensors.

A protocol pin is also a kind of digital pin. I2C, Serial and SPI are frequently used digital pins.

The Relation between Code and Hardware

The input unit, control unit and output unit mentioned above are all hardware. In the context of our human being analogy, hardware is the body of our device. However, the brain is much more important as it produces ideas and then controls actions every human being takes. Code here functions as our mind. Both body and mind are indispensable to a human being.

Digital Signal & Analog Signal

The input unit, the Arduino controller and the output unit communicate by signals, which in turn are processed by code. How do input units and controllers communicate with each other? How do controllers communicate with the output units? To answer the above questions, we first need to understand two concepts: digital signal and analog signal.

Differences between Digital Signal & Analog Signal

Digital Signal:

Digital signal has two states: “HIGH” or “LOW”. “HIGH” is a 5V signal and represents “1” (or on). “LOW” is a 0V signal and represents 0 (or off).

Analog Signal:
The analog signal can have any value in a certain range.

In Arduino’s analog pins, any value between 0V and 5V is mapped to a range between 0 and 1023. For instance, 0 is mapped as 0V; 1023 is mapped as 5V and 512 is mapped as 2.5V.

“Digital” & “Analog” in DFRobot Kit

To use a component, we should always be clear what type of signal it supports. In our kit, you can use following ways to quick identify digital and analog components.

(1) Digital modules has a letter “D” printed on the corner; Analog modules has a letter “A” printed on the corner.

(2) Cables for digital modules are marked in green; Cables for analog modules are marked in blue.

IO Expansion shield

IO (Input and Output) expansion shield is one of the most popular peripheral hardware for Arduino based projects. A standard IO expansion shield is equipped with extended headers including signal and power pins, extended buttons and switches, external power port and sockets for other modules. Different from a bread board, the IO expansion shield allows for direct connections of modules, which makes the circuit connection simpler and saves time.

The IO expansion shield developed by DFRobot is compatible with most Arduino UNO lay-out boards, which means it can also be used for 101.

Let’s first take a look of how the expansion shield looks like.

To know how to use the board, we need to understand what those signs printed on the board stand for.

The Letter “D” and “A” on the right side of the board stands for “Digital” and “Analog” respectively.

Also, different types of pins are marked in different colors:

Green = Digital pin

Blue = Analog pin

Red = VCC (Power)

Black = GND (ground)

VCC pins on the board supports both 5V and 3.3V power output. This voltage can be switched by either connecting the 5V or 3V3 pin to the middle pin using a jumper head. As components in our tutorial are all 5V compatible, we want the jumper head always on the 5V side. Need to notice that 5V power may damage 3.3V compatible components, so choose with care!
Moreover, you can also find an extended D13 LED light and a reset button on the shield. You may check our wiki page of the expansion shield for more information.