Arduino Project

Arduino LED Chaser with Push Buttons V2

Kit purchase

Looking for parts? Check out our all-in-one kits below — packed with components, beginner-friendly guides, and tons of fun.

2.webp__PID:7d088a16-8752-49fb-8b1f-f9bba7297987

Name

Includes Arduino board

PURCHASE LINK

Elite Explorer Kit

Arduino Uno R4 WiFi

3 in 1 Ultimate Starter Kit

Arduino Uno R4 Minima

Ultimate Sensor Kit

Arduino Uno R4 Minima

Universal Maker Sensor Kit

×

Course Introduction

In this lesson, you will use Arduino together with two Ultrasonic Sensor Modules and a row of LEDs to create an automatic directional light-flow effect. When the left sensor detects an object, the LEDs light up in a forward flowing pattern.

When the right sensor is triggered, the LEDs flow in the opposite direction.

Each sensor controls one direction of the animation, allowing the LEDs to respond dynamically based on which side an obstacle is detected.

Note

If this is your first time working with an Arduino project, we recommend downloading and reviewing the basic materials first.

1.1 Install Arduino IDE(Important)
1.2 Introduction of Arduino IDE

Required Components

In this project, we need the following components:

SN

COMPONENT INTRODUCTION

QUANTITY

PURCHASE LINK

1

Arduino UNO R4 Minima

1

2

USB Type-C cable

1

×

3

Breadboard

1

4

Wires

Several

5

1kΩ resistor

Several

6

IR Obstacle Avoidance Sensor Module

2

7

LED

Several

Wiring

10.png__PID:5e9335cc-c2a1-4a78-8e63-c910f0090915

Common Connections:

LED
Connect the LEDs cathode to the negative power bus on the breadboard, and the LEDs anode to 1kΩ resistor then to 5 to 10 on the Arduino.

Ultrasonic Sensor Module Right
Trig:
Connect to 11 on the Arduino.
Echo: Connect to 12 on the Arduino.
GND: Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.

Ultrasonic Sensor Module Left

Trig: Connect to 3 on the Arduino.
Echo: Connect to 4 on the Arduino.
GND: Connect to breadboard’s negative power bus.
VCC: Connect to breadboard’s red power bus.

Writing the Code

Note
You can copy this code into Arduino IDE.
Don’t forget to select the board(Arduino UNO R4 Minima) and the correct port before clicking the Upload button.