Learn Electronics With Arduino - Lesson #4

by lucascreator in Circuits > Arduino

10 Views, 1 Favorites, 0 Comments

Learn Electronics With Arduino - Lesson #4

lesson-4-article-thumbnail.png

Grasp the basic concepts of electronics, like what's electricity and how voltage, current, and resistance are related.

Supplies

For this project, you'll need:

  1. Arduino board
  2. Breadboard
  3. 8 blue LEDs
  4. 8 resistors (220Ω)
  5. Jumper wires

We'll also use Arduino IDE and Mind+ to program our boards.

YouTube Tutorial

Learn Electronics With Arduino - Lesson #4

I've recently posted a video on YouTube explaining everything you can read in this article. You can watch it right above.

Introduction

Have you ever wondered how electricity actually works? Or why we need resistors when working with LEDs?

In this beginner-friendly tutorial, we’ll break down the fundamentals of electronics and walk you through building your very first LED circuit using Arduino.

By the end of this guide, you'll not only understand key concepts like voltage, current, and resistance, but you'll also build a fun ripple LED pattern project using a breadboard, jumper wires, and resistors.

This is lesson 4 in my Arduino for Beginners course, a 24-part series designed to take you from zero to confident maker.

What Is Electricity?

Everything around you is made of atoms - tiny building blocks made up of protons, neutrons, and electrons.In electronics, we care mostly about electrons, because they can move. And when electrons move from one atom to another, it creates something we call electric current.

But electrons don’t just move on their own - they need a push. That push is called voltage, which is the force that moves electrons through a circuit.

Different materials allow electrons to flow differently:

  1. Conductors (like copper or aluminum) allow easy flow.
  2. Insulators (like plastic or rubber) resist that flow.

The resistance of a material tells us how much it opposes the flow of electricity.

Ohm’s Law

In the 1800s, physicist Georg Ohm discovered a simple relationship between Voltage (V), Current (I), and Resistance (R):

V = I × R

This means:

  1. Increase voltage → more current
  2. Increase resistance → less current

You can think of voltage as water pressure, current as the flow of water, and resistance as a narrow pipe that restricts the flow. That’s the core of electronics.

Sponsor

20250726_192041.jpg
20250726_192105.jpg
20250726_192126.jpg
20250726_192132.jpg
20250726_192206.jpg

Now before we go further, a quick thank you to our sponsor: DFRobot. They provided us with the MindPlus Arduino Coding Kit, which we’ll be using throughout this course.

This kit includes sensors, buttons, LEDs, and everything else we need to build awesome projects. It’s perfect for beginners, and I highly recommend it.

Components

22-1.png
22-2.png
22-3.png

Let’s take a look at some of the basic electronic components we’ll be using today:

1. LED: A Light Emitting Diode. It lights up when current flows through it in the correct direction. LEDs are polarized - meaning they have a positive (anode) and negative (cathode) side. The longer leg is the positive one.

2. Jumper Wires: Small wires used to connect components on a breadboard. You’ll find male-to-male, male-to-female, and female-to-female types.

3. Resistor: Resistors limit current and control voltage in a circuit. They protect components like LEDs from receiving too much current.

4. Breadboard: A solderless prototyping board. You insert components and wires into holes that are electrically connected inside.

  1. Rows in the middle are connected vertically.
  2. Power rails on the sides are connected horizontally.

Now you may be wondering why we will discuss some components that do Let’s now take a closer look at resistors.

Understanding Resistors

27-1.png
28-1.png

Resistors are essential components that help us control current flow. They have two important characteristics:

1.Resistance value (in Ohms): This tells you how much the resistor resists current.

2.Tolerance: Indicates how accurate the resistance value is. For example, a 220Ω resistor with 5% tolerance could actually measure anywhere between 209Ω and 231Ω.

Most resistors use a color code to indicate their value. The colored bands represent digits, a multiplier, and sometimes tolerance. There are two common types: 4-band and 5-band resistors.

Four band-resistors:

  1. 1st band: 1st digit
  2. 2nd band: 2nd digit
  3. 3rd band: multiplier
  4. 4th band: tolerance

For example, a resistor with Red-Red-Brown-Gold means:

  1. Red = 2
  2. Red = 2
  3. Brown = x10
  4. Gold = ±5%

This is a 220Ω resistor with 5% tolerance.Now the five band-resistors:

  1. 1st band: 1st digit
  2. 2nd band: 2nd digit
  3. 3rd band: 3rd digit
  4. 4th band: Multiplier
  5. 5th band: Tolerance

For example, a resistor with Brown–Black–Black–Red– Brown means:

  1. Brown = 1
  2. Black = 0
  3. Black = 0
  4. Red = ×100
  5. Brown = ±1%

This is a 10000Ω (10kΩ) resistor with 1% tolerance.Now that you understand a lot of resistors, let's discuss why they are important for any circuit.

Why Use a Resistor With a LED?

Resistors are essential in electronics because they regulate the flow of electrical current, protecting sensitive components from damage. But their role goes beyond just limiting current - they’re also used to divide voltage, control signal levels, and safely dissipate excess power.

In almost any circuit that includes LEDs, resistors are essential. That’s because LEDs have very low internal resistance and are sensitive to high current. If you connect an LED directly to a battery, it may draw too much current and burn out almost instantly.

To prevent this, we place a resistor in series with the LED, usually on the positive (anode) side, to limit the amount of current flowing through it.

Let’s look at an example to calculate the appropriate resistor value. Suppose we’re connecting an LED to a 9V battery, and the manufacturer says the LED operates best at 50mA (0.05A).

Using Ohm’s Law:

V = I * R

9 = 0.05 * R

R = 180Ω

So we need a resistor of about 180 ohms. If that exact value isn’t available, we use the closest standard resistor, like 220Ω. That’s why we’ll use a 220Ω resistor in our project. It still limits the current enough to protect the LED while allowing it to shine properly.

Project

20250726_190919(0).jpg
20250726_190916.jpg
20250726_190920.jpg
20250726_190919.jpg

Now that we went through all this theory, let's get our hands dirty.We’re going to build a light sequence using 8 LEDs connected to the Arduino. These LEDs will blink in pairs, starting from the center and moving toward the edges, then back to the center - like a ripple effect going out and in.

Here’s how the sequence will look:

  1. First, LEDs on pins 5 and 6 turn on.
  2. Then pins 4 and 7.
  3. Then 3 and 8.
  4. Finally 2 and 9.

After that, it reverses: 3 and 8, 4 and 7, and finally back to 5 and 6.

Only two LEDs will be on at a time, and each pair will stay lit for a quarter of a second. After that, they’ll turn off and move to the next step in the sequence. And the process repeats forever.

Materials

20250726_191559.jpg
20250726_191512.jpg
20250726_191211.jpg
20250726_191457.jpg
20250726_191114.jpg

For this project, you'll need:

  1. Arduino board
  2. Breadboard
  3. 8 blue LEDs
  4. 8 resistors (220Ω)
  5. Jumper wires

How to Build the Circuit

20250726_190209.jpg
20250726_190239.jpg
20250726_190301.jpg
20250726_190333.jpg
20250726_190341.jpg
37.png

After you get the components, assemble them like this:

1. Insert 8 LEDs into the breadboard in a row. Make sure the long legs (anodes) are all on the same side.

2. Connect a 220Ω resistor to the anode (long leg) of each LED.

3. Use jumper wires to connect the other side of each resistor to pins 2 through 9 on the Arduino. Each pin should connect to one LED.

4. Use jumper wires to connect the other side of each resistor to pins 2 through 9 on the Arduino. Each pin should connect to one LED.

5. Connect the cathodes (short legs) of all LEDs to the GND (ground) rail on the breadboard.

6. Finally, connect the GND rail of the breadboard to one of the GND pins on the Arduino.

Double-check your wiring according to the schematics above.

Code

Screenshot (124).png

Arduino IDE

When you upload the code, you’ll see the LEDs blink in a mirrored pattern - starting from the middle (LEDs on pins 5 and 6), moving outward to the edges (pins 2 and 9), and then reversing back to the center. This ripple-like effect repeats continuously, with only two LEDs turned on at a time for 250 milliseconds each.

If you’d like to download the code, it’s available on the GitHub repository for this Arduino for Beginners series.

Mind+

If you're using Mind+, you can create the exact same light pattern using visual blocks.

Here’s how to build it.

In the Setup (initialization) section:

  1. Use the “digital pin OUTPUT” block and repeat it for pins 2 through 9.
  2. Put them in the forever loop with wait 0.25.
  3. Add the “when clicked” command.

After you select your board and click on the green flag, you should see the LEDs blinking on the breadboard.

The full coding-block is available here.

Conclusion

This lesson wraps up Module 1 of the Arduino for Beginners course. You've now got the essential foundation to understand any Arduino circuit.

Up next in Module 2, we’ll dive into inputs - working with buttons and sensors to control your circuits interactively.

See you in the next lesson!