Arduino Project

Arduino IoT Cloud Traffic Light Project

Course Introduction

This Arduino project uses Arduino IoT Remote to control Traffic Light.

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

Please follow the steps in the tutorial below to complete the binding and setup of Arduino Cloud and the Arduino WiFi board.
1.4 Arduino IoT Cloud

Required Components

In this project, we need the following components:

SN

COMPONENT INTRODUCTION

QUANTITY

PURCHASE LINK

1

Arduino UNO R4 Wifi

1

BUY

2

USB Type-C cable

1

×

3

Breadboard

1

4

Wires

Several

5

Traffic Light LED

1

Wiring

traffic_light_iot.webp__PID:3689f4c9-cb81-4823-956c-66e7ad84e364

Common Connections:

Traffic light LED
R: Connect to 3 on the Arduino.
Y: Connect to 5 on the Arduino.
G: Connect to 6 on the Arduino.
GND: Connect to breadboard’s negative power bus.

Create a New IoT Project
After configuring the Arduino Cloud and the Arduino WiFi board, follow the steps below to complete the Arduino Cloud project setup

1.webp__PID:c6495e14-62b1-495b-81b6-ce255495c34a

Edit Value (4Variables:cmdGreen,cmdYellow,cmdRed,currentState)

2.png__PID:489957fa-8ebf-4459-9eb4-b5d689d5910a12.webp__PID:78413679-5f4c-4cb5-9a61-8c30e2329d0c

Follow the steps below to configure the dashboard.
1.Create New Dashboard

6.webp__PID:da293eac-eee8-44a0-a339-f878cbcacd32

2.Add Widgets

13.png__PID:ec450f9c-d030-40d3-92ed-6e86b09ab63b

3.Link Variable

13.webp__PID:cedf2463-7e32-4de4-8424-6390fb2bac6e14.png__PID:659fe758-1c2d-4f16-b517-61a5a6978678

4.Remember to click Done

15.png__PID:1591ea39-f699-4aa3-b874-fdc850f4a762

After completing the above configuration, return to the Things page and open the sketch.

15.webp__PID:8a4132d0-c32b-4089-af88-a78b2bd36a5c

When you have completed the configuration of the Things and Dashboard, as well as the connection and network setup of the Arduino WiFi board, the thingProperties.h and Sketch Secrets files will be generated automatically. If Sketch Secrets is not generated, please manually enter the connected SSID and OPTIONAL_PASS

Copy this code into Arduino Cloud.

111.webp__PID:95140091-b504-439c-9203-f7078c4d2368

Don’t forget to select the board(Arduino UNO R4 WIFI) and the correct port before clicking the Upload button.