Components Required

Image Component Quantity Available in Kit
evive 1
USB A-B Cable 1


Under the Magic Lid of evive there are 28 Digital 5V Input and Output (I/O) pins. By digital, we mean that there will be only 2 states the digital pin can have, either HIGH (5V or 3.3V) or LOW (0V/GND).

A digital output allows you to control a voltage with evive. If evive instructs the output to be high, the output will produce a voltage (generally about 5 or 3.3 volts). If evive instructs the output to be low, it is connected to ground and produces no voltage.

Let us consider an example, evive has a LED (named Pin 13) whose positive terminal is connected internally to digital pin 13 and negative terminal is connected to GND. There is a resistor also present between the digital pin 13 and positive terminal of LED to prevent excess current flow through LED (Excess current makes LED faulty).

Light-Emitting Diodes (LEDs)

LEDs are like tiny lightbulbs. However, LEDs require a lot less power to light up by comparison. They’re also more energy efficient, so they don’t tend to get hot like conventional lightbulbs do.

Using LED

  • Polarity Matters: In electronics, polarity indicates whether a circuit component is symmetric or not. LEDs only allows current to flow in one direction. And when there’s no current-flow, there’s no light.

The positive side of the LED is called the “anode” and is marked by having a longer “lead,” or leg. The other, negative side of the LED is called the “cathode.” Current flows from the anode to the cathode and never the opposite direction. A reversed LED can keep an entire circuit from operating properly by blocking current flow.

  • More current equals more light: The brightness of an LED is directly dependent on how much current it draws. That means two things. The first being that super bright LEDs drain batteries more quickly, because the extra brightness comes from the extra power being used. The second is that you can control the brightness of an LED by controlling the amount of current through it.
  • If you connect an LED directly to a current source it will try to dissipate as much power as it’s allowed to draw, and it will destroy itself. That’s why it’s important to limit the amount of current flowing across the LED. Resistors limit the flow of electrons in the circuit and protect the LED from trying to draw too much current.

Now when digital pin 13 is HIGH, current passes though LED and it starts glowing. When digital pin 13 is LOW, there is no current passing through LED. Hence, it does not glow. Now all you have to do to control the LED is simply control the digital pin 13.

Configuring a digital pin as OUTPUT

Every digital pin you use should be configured as OUTPUT inside the setup() loop. This is done using the following statement:

pinMode(pin, OUTPUT);

where the pin is the digital pin number you want to initialise as output.

Note: These pins are also in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can source (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This is enough current to brightly light up an LED.

Using digitalWrite() function in Arduino IDE, you can write a digital pin, to a HIGH or LOW value.

LED Blinking Example

Now you know, how to use digital pin as OUTPUT, let us write LED blinking sketch in Arduino IDE. In this sketch, we will turn ON the LED for 1 second, then turn it OFF for another 1 second and repeat. Given below is the Arduino sketch: