0% found this document useful (0 votes)
15 views51 pages

2 Getting Start

The document provides a comprehensive guide on getting started with the Arduino IDE, highlighting its beginner-friendly interface, extensive community support, and compatibility with multiple operating systems. It details the installation process, introduces the Arduino UNO R4 Wi-Fi board and various sensors, including the DHT11, BMP280, and MPU6050, explaining their functionalities and applications. Overall, it serves as a valuable resource for beginners looking to engage with microcontroller-based projects using Arduino.

Uploaded by

ALL ENERGY
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views51 pages

2 Getting Start

The document provides a comprehensive guide on getting started with the Arduino IDE, highlighting its beginner-friendly interface, extensive community support, and compatibility with multiple operating systems. It details the installation process, introduces the Arduino UNO R4 Wi-Fi board and various sensors, including the DHT11, BMP280, and MPU6050, explaining their functionalities and applications. Overall, it serves as a valuable resource for beginners looking to engage with microcontroller-based projects using Arduino.

Uploaded by

ALL ENERGY
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Getting Start with Arduino IDE

Difficult Level:

Why should you use Arduino IDE for programing?

Using the Arduino IDE (Integrated Development Environment) for programming has several
advantages:

⚫ Beginner-Friendly: Arduino IDE is designed with beginners in mind. Its simple interface
and easy-to-understand language make it accessible even to those with little to no
programming experience.
⚫ Extensive Community Support: Arduino has a large and active community of users and
developers. This means you can easily find tutorials, examples, and help online if you
encounter any issues or need guidance.
⚫ Cross-Platform Compatibility: Arduino IDE is available for Windows, Mac, and Linux,
making it accessible regardless of your operating system.
⚫ Built-in Libraries: Arduino IDE comes with a variety of libraries that provide pre-written
code for interfacing with various sensors, modules, and devices. This can save you time
and effort when working on projects.
⚫ Supports Multiple Boards: Arduino IDE supports a wide range of Arduino boards as
well as other compatible boards like ESP8266 and ESP32. This versatility allows you to
choose the right hardware for your project.
⚫ Open Source: Arduino IDE is open-source software, which means you can modify it to
suit your needs or contribute to its development.
⚫ Integration with Arduino Ecosystem: Using Arduino IDE gives you access to the entire
Arduino ecosystem, including official and third-party hardware, software, and
accessories.

Overall, Arduino IDE provides a user-friendly environment for programming microcontroller-


based projects and is a great choice for hobbyists, educators, and professionals alike.

Preparation

Download Arduino IDE Software

Download Arduino Ide installation package from official web site:


https://www.arduino.cc/en/software Or find the installation package in the microSD card
which is coming with the kit.

If you want to use the latest package, please download it from official web site.
and select the OS plaMicroSDorm that you are using, for example: windows, Linux or Mac OS.
Here, we will take windows operating system example.

Select Windows MSI installer.

and then click “JUST DOWNLOAD”, if you want to contribute and download please click the
button above the button “JUST DOWNLOAD” .
If you want to find inspiring projects and learn about cutting-edge Arduino products through
weekly newsletter, you can input your email address into the blank and check the two boxes
under the email entry blank. here we click just download button to download Arduino Ide
installer.
Install Arduino IDE

Install Arduino IDE by double clicking the package:

Read License agreement and click “I Agree”.


Select destination folder that you want to install it to, and then click install icon to finish it.

Click Finish icon.


Congratulations!
You have already make a big progress to install arduino IDE, next step is to know about this
kit.

What about the kit?

The kit contains Arduino UNO R4 WiFi board and some electronic components that for
beginners.

Arduino UNO R4 WIFI

The Arduino UNO R4 Wi-Fi is designed around the 32-bit microcontroller RA4M1
from Renesas while also featuring an ESP32 module for Wi-Fi® and Bluetooth® connectivity.
Its distinctive 12x8 LED matrix makes it possible to prototype visuals directly on the board,
and with a Qwiic connector, you can create projects plug-and-play style.
The MCU on the board is the high performance Renesas RA4M1 (Arm® Cortex®-M4) with a
48 MHz clock speed, 32 kB SRAM and 256 kB flash memory. This MCU features an RTC, a
DAC and a CAN bus and has support for HID via USB.
The UNO R4 Wi-Fi also features an ESP32-S3 for Wi-Fi®/Bluetooth® connectivity, which can
also be separately programmed via a specific header.
Temperature & Humidity Sensor

The DHT11 is a low-cost digital temperature and humidity sensor. It consists of a capacitive
humidity sensor and a thermistor to measure the surrounding air, and it provides a digital
output signal on a single data pin.

Here's how it works:

⚫ Humidity Sensing: The humidity sensing component measures the relative humidity of
the air. It does this by detecting changes in capacitance caused by the absorption or
desorption of moisture by a polymer dielectric material. The sensor's output is
proportional to the relative humidity.
⚫ Temperature Sensing: The temperature sensing component uses a thermistor, a type
of resistor whose resistance changes with temperature. The resistance of the thermistor
decreases as the temperature increases and vice versa. By measuring this change in
resistance, the sensor can determine the temperature of the environment.
⚫ Digital Output: The DHT11 communicates with a microcontroller using a simple serial
protocol over a single data pin. It sends data packets containing the temperature and
humidity readings at regular intervals. These readings are encoded in a specific format,
which the microcontroller can decode to obtain the temperature and humidity values.
⚫ Accuracy and Calibration: While the DHT11 is a convenient and inexpensive sensor, it's
important to note that it may not offer the same level of accuracy as more expensive
sensors. Calibration may be necessary to improve accuracy, especially if precise
measurements are required for a particular application.
⚫ Limitations: The DHT11 has some limitations, including relatively slow response times
and a narrow operating range compared to more advanced sensors. It's also not suitable
for high-precision applications due to its lower accuracy compared to more expensive
sensors.

The module have three Pins: VCC, GND, and DATA.


The communication process begins with the host sending start signals to the DHT11
temperature and humidity sensor.
Pinout

⚫ GND/- -Connect to Ground


⚫ VCC/+ -Connect to 3.3V/5V power supply
⚫ DATA -Data output

BMP280 Air Pressure meter

The BMP280 is an absolute barometric pressure sensor, which is especially feasible for mobile
applications. Its small dimensions and its low power consumption allow for the
implementation in battery powered devices such as mobile phones, GPS modules or watches.
The BMP280 is based on Bosch’s proven piezo resistive pressure sensor technology featuring
high accuracy and linearity as well as long-term stability and high EMC robustness. Numerous
device operation options guarantee for highest flexibility. The device is optimized in terms of
power consumption, resolution and filter performance.

Pinout

⚫ VCC
⚫ GND
⚫ SCL
⚫ SDA
⚫ CSB
⚫ SDO

Explanations

⚫ VCC: This pin is the power supply voltage input. It typically connects to a 3.3V or 5V
power source, depending on the module's voltage requirements.
⚫ GND: This pin is the ground connection, providing the reference voltage for the module's
operation. It completes the electrical circuit.
⚫ SCL: Stands for Serial Clock. This pin is used for the I2C serial clock signal, which
synchronizes data transfer between the BMP280 module and the microcontroller.
⚫ SDA: Stands for Serial Data. This pin is used for the I2C serial data signal, which carries
data between the BMP280 module and the microcontroller.
⚫ CSB: Stands for Chip Select Bar. This pin is used to select the BMP280 module in SPI
communication mode. It is typically connected to either VCC or GND to set the module's
address.
⚫ SDO: Stands for Serial Data Out. This pin is used to output data in SPI communication
mode. It allows the BMP280 module to communicate data to the microcontroller when
using the SPI protocol.

9g servo

Servos are small devices used in a variety of applications, from robotics to remote-controlled
vehicles to industrial automation. The fundamental principle behind how servos work involves
converting an electrical signal into precise mechanical motion. Here's a breakdown of the key
components and their functions:

⚫ DC Motor: At the heart of a servo is a DC motor. This motor typically consists of a


permanent magnet rotor and a wound wire coil (the armature) within a magnetic field.
When an electrical current flows through the coil, it interacts with the magnetic field,
causing the armature to rotate.
⚫ Gear Train: Servos often employ a gear train to reduce the speed of the motor's rotation
while increasing its torque. This gearing mechanism allows the servo to exert greater
force while maintaining precise control over its movement.
⚫ Potentiometer (Feedback Device): Most servos incorporate a potentiometer, also
known as a variable resistor, as a feedback device. This potentiometer is mechanically
coupled to the output shaft of the servo. As the shaft rotates, it changes the resistance
of the potentiometer. This change in resistance provides feedback to the servo control
circuitry, allowing it to accurately determine the position of the shaft.
⚫ Control Circuitry: The control circuitry is the brains of the servo. It interprets incoming
electrical signals (typically pulse-width modulation signals) and generates the
appropriate output to drive the motor. The control circuitry compares the desired
position (as indicated by the incoming signal) with the actual position (as determined by
the feedback from the potentiometer) and adjusts the motor's speed and direction
accordingly to minimize the error.
⚫ Feedback Loop: The feedback loop is crucial for ensuring the servo reaches and
maintains the desired position accurately. The control circuitry continuously monitors the
feedback from the potentiometer and adjusts the motor's output to minimize any
discrepancy between the desired and actual positions.

Overall, the combination of a DC motor, gear train, feedback device (potentiometer), and
control circuitry allows servos to precisely control the position of their output shafts in
response to incoming electrical signals, making them invaluable for various applications
requiring accurate and controllable motion.

Pinout

⚫ VCC
⚫ GND
⚫ Signal pin

Explanations

In a standard servo motor with three wires, typically the red, yellow (or white), and brown (or
black) wires serve different functions:

⚫ Red Wire: The red wire is usually connected to the positive terminal of the power source.
It supplies the servo motor with the necessary voltage, typically around 4.8 to 6 volts DC,
depending on the specific servo's specifications. This wire provides the electrical power
needed to operate the servo.
⚫ Yellow (or White) Wire: The yellow (or white) wire is the signal wire. It carries the control
signal from the external device, such as a microcontroller or receiver, to the servo's
internal control circuitry. The control signal is usually in the form of pulse-width
modulation (PWM), where the width of the pulses determines the desired position or
speed of the servo motor. The range of the pulses typically corresponds to the range of
motion of the servo.
⚫ Brown (or Black) Wire: The brown (or black) wire is typically connected to the negative
terminal of the power source. It serves as the ground wire, completing the electrical
circuit and providing the return path for the current flowing through the servo motor.
This wire ensures proper electrical grounding and completes the power circuit required
for the servo to operate.
In summary, the red wire supplies power to the servo, the yellow (or white) wire carries the
control signal, and the brown (or black) wire provides the ground connection. Together, these
wires allow the servo motor to receive power, receive control signals, and complete the
necessary electrical circuit to operate.
Ultrasonic sensor

The HC-SR04 ultrasonic sensor is a popular sensor module for measuring distance. Its
operation is based on the principle of sound waves. Here's how it works:

⚫ Trigger Signal: To start a measurement, the sensor needs a trigger signal. You send a
short pulse (typically around 10 microseconds) to the trigger pin of the sensor.
⚫ Ultrasonic Pulse Transmission: Once triggered, the sensor emits a burst of ultrasonic
sound waves. These sound waves travel through the air at a speed of about 343 meters
per second (at room temperature).
⚫ Reflection: When these sound waves encounter an object in their path, they bounce
back from the object's surface. This bounce-back is called an echo.
⚫ Echo Reception: The sensor has a receiver component that listens for the echoes. When
an echo is received, the sensor generates a pulse on its echo pin. The length of this pulse
corresponds to the time it took for the ultrasonic waves to travel to the object and back.
⚫ Calculating Distance: By measuring the time between the trigger pulse and the echo
pulse, you can calculate the distance to the object. Since you know the speed of sound
and you measured the time it took for the sound waves to travel, you can use the formula:
Distance = (Time * Speed of Sound) / 2The "divide by 2" factor is because the sound
wave travels to the object and back, so the total distance is twice the distance to the
object.
⚫ Output: The calculated distance can be read from the sensor's output pins. Typically, this
distance is given in centimeters or inches.

Overall, the HC-SR04 ultrasonic sensor provides a simple and effective way to measure
distances using sound waves, making it useful in a wide range of applications such as robotics,
automation, and proximity sensing.

Pinout

⚫ VCC
⚫ Trig (Trigger)
⚫ Echo
⚫ GND

Explanations

The pins on the HC-SR04 ultrasonic sensor module serve different functions and are
connected to your microcontroller or other electronics to facilitate communication and power
supply. Here's what each pin typically represents:

⚫ VCC: This pin is used to supply power to the sensor. It's typically connected to the positive
terminal of your power source, providing the required voltage for the sensor to operate.
The HC-SR04 usually operates at 5 volts, but some variants might support a range of
voltages.
⚫ Trig (Trigger): The trigger pin is used to initiate a distance measurement. When you
provide a short pulse (usually around 10 microseconds) to this pin, the sensor sends out
an ultrasonic pulse to measure distance.
⚫ Echo: The echo pin is used to receive the echo signal back from the object being
measured. When the ultrasonic pulse sent out by the sensor reflects off an object and
returns, it generates a pulse on this pin. The duration of this pulse is proportional to the
time it took for the ultrasonic waves to travel to the object and back.
⚫ GND: This pin is the ground connection for the sensor. It completes the circuit and
provides the reference voltage for the sensor's operation. It's typically connected to the
negative terminal of your power source or ground.

In summary, VCC and GND provide power to the sensor, Trig is used to trigger distance
measurements, and Echo receives the echo signal for calculating distance.
MPU6050 Gyroscope & accelerate

The MPU6050 is a popular motion-tracking device that combines a 3-axis gyroscope and a
3-axis accelerometer on a single chip. Its working principle involves the utilization of these
sensors to measure motion, orientation, and vibration.

⚫ Accelerometer: This part of the MPU6050 measures acceleration along the X, Y, and Z
axes. It works based on the principle of capacitance change due to acceleration. Inside
the accelerometer, there are tiny structures called MEMS (Micro-Electro-Mechanical
Systems) that move in response to acceleration, causing a change in capacitance which
is then measured. By measuring these changes, the MPU6050 can determine the
acceleration along each axis.
⚫ Gyroscope: The gyroscope measures the rate of rotation around the X, Y, and Z axes. It
employs the principle of Coriolis force, where a vibrating element experiences a force
perpendicular to its motion when it's in motion and the motion is changed. This force
can be detected and measured to determine the rate of rotation.
⚫ Sensor Fusion: To get accurate motion data, the MPU6050 uses a technique called
sensor fusion. This involves combining data from both the accelerometer and the
gyroscope to obtain a more accurate measurement of orientation and motion. One
common method for sensor fusion is the complementary filter, which combines
accelerometer and gyroscope data to estimate orientation.
⚫ Data Processing: The MPU6050 contains an internal processor that performs
calculations on the raw data from the accelerometer and gyroscope to obtain useful
information such as orientation, tilt, rotation, etc. These processed data can be accessed
by a microcontroller through interfaces like I2C or SPI.
⚫ Calibration: To ensure accurate measurements, the MPU6050 may need calibration. This
involves determining and compensating for any biases or errors in the sensor readings.
Calibration typically involves measuring the sensor outputs under known conditions and
applying correction factors to the raw data.
Overall, the MPU6050 works by combining the measurements from its accelerometer and
gyroscope sensors, processing the data, and providing accurate motion tracking information
to the host microcontroller or system. It's commonly used in applications such as motion
tracking, gesture recognition, robotics, and gaming.

Pinout

⚫ VCC
⚫ GND
⚫ SCL
⚫ SDA
⚫ XDA
⚫ XCL
⚫ AD0
⚫ INT

Explanations

⚫ VCC: This pin is the power supply voltage input. It typically connects to a 3.3V or 5V
power source, depending on the module's voltage requirements.
⚫ GND: This pin is the ground connection, providing the reference voltage for the module's
operation. It completes the electrical circuit.
⚫ SCL: Stands for Serial Clock. This pin is used for the I2C serial clock signal, which
synchronizes data transfer between the MPU6050 module and the microcontroller.
⚫ SDA: Stands for Serial Data. This pin is used for the I2C serial data signal, which carries
data between the MPU6050 module and the microcontroller.
⚫ XDA: This pin is used for auxiliary serial data transmission in some specific configurations
of the MPU6050 module.
⚫ XCL: This pin is used for auxiliary serial clock transmission in some specific configurations
of the MPU6050 module.
⚫ AD0: This pin is the address input/output selection pin. It is used to set the I2C address
of the MPU6050 module. By connecting it to either VCC or GND, you can change the
device's address to avoid address conflicts in I2C communication.
⚫ INT: Stands for Interrupt. This pin is used to indicate when data is ready to be read from
the MPU6050 module. It can be connected to an interrupt pin on the microcontroller to
trigger interrupts when new data is available for processing.
2 channel relay

Dual-channel relays typically refer to relay modules that consist of two separate relay circuits
on the same board or module. These relays are commonly used in various applications where
multiple control channels are required, such as home automation, industrial control systems,
and robotics.

The working principle of a dual-channel relay is similar to that of a single-channel relay, but
with the added complexity of managing two independent circuits. Here's a basic overview of
how they work:

⚫ Relay Basics: A relay is an electromechanical switch operated by an electrical current. It


consists of a coil and one or more sets of contacts. When current flows through the coil,
it generates a magnetic field that causes the contacts to move, either making or breaking
the electrical connection between them.
⚫ Dual Channels: In a dual-channel relay, there are two separate relay circuits, each with
its own set of contacts controlled by its own coil.
⚫ Control Signals: Each channel typically has its own set of input terminals for connecting
control signals. These control signals can come from microcontrollers, sensors, switches,
or any other device capable of providing the necessary electrical signals.
⚫ Isolation: Dual-channel relays often provide isolation between the control circuit and the
load circuit. This isolation helps protect the control circuit from voltage spikes or other
disturbances in the load circuit.
⚫ Switching Loads: Each channel of the relay can be used to switch a separate electrical
load, such as lights, motors, solenoids, or other devices. When the relay is activated by
applying the appropriate control signal, the contacts for that channel will either close
(turning the load on) or open (turning the load off), depending on the relay's
configuration.
⚫ Common Applications: Dual-channel relays are commonly used in scenarios where
multiple electrical devices need to be controlled independently or in synchronization with
each other. For example, in home automation, one channel might control the lights while
the other controls a fan, or in industrial applications, one channel might control a
conveyor belt while the other controls a sorting mechanism.
Overall, dual-channel relays offer flexibility and convenience in managing multiple electrical
loads, making them a popular choice in a wide range of applications.
Pinout

⚫ JD-VCC
⚫ VCC
⚫ GND
⚫ GND
⚫ IN1
⚫ IN2
⚫ VCC

Explanations

These descriptions are likely referring to the pin labels on a dual-channel relay module. Let's
break down what each term means:

⚫ JD-VCC: This is the input for an isolated power supply specifically designed to power the
relay coils. The term "isolated" here means that this power supply is separate from the
power supply used for other components on the relay module. Isolating the power
supply for the relay coils helps prevent interference or voltage spikes from affecting other
parts of the circuit.
⚫ VCC: This is the input for directly powering the relay coils. Unlike JD-VCC, this input
doesn't necessarily imply isolation. It provides power directly to the coils without any
additional isolation circuitry.
⚫ GND: These are the ground reference points for the circuit. Both JD-VCC and VCC likely
have corresponding ground connections to complete the circuit and provide a return
path for the current.
⚫ IN1 and IN2: These are the inputs used to activate the relays. Applying a signal (such as
a voltage or current) to IN1 will activate the first relay, while applying a signal to IN2 will
activate the second relay. These signals typically come from a microcontroller, sensor,
switch, or other control device.
⚫ VCC (second occurrence): This VCC pin is likely intended to power the optocoupler, coil
drivers, and any associated circuitry on the relay module. The optocoupler is a
component used for electrical isolation between the control signal and the relay coil. Coil
drivers are the circuitry responsible for controlling the relay coils based on the input
signals received at IN1 and IN2.

In summary, these pin labels describe the various input and power connections on the dual-
channel relay module, including inputs for activating the relays, power supplies for the relay
coils and associated circuitry, and ground connections for completing the circuits.
52Pi experiment platform

An experiment platform.

USB-C Programing Cable

A USB-C Programing Cable for Arduino UNO WiFi due to this board has an USB-C Port.

MicroSD card Reader Module

A MicroSD card read module is a hardware component that facilitates the reading of data
from MicroSD (Secure Digital) memory cards. These modules are commonly used in various
electronic devices such as smartphones, digital cameras, GPS devices, and microcontroller-
based projects.

The module typically consists of a slot where the MicroSD card is inserted and circuitry that
interfaces with the card and the host system. Here's a basic overview of how it works:

⚫ Physical Connection: The MicroSD card is inserted into the slot provided by the module.
The card contains flash memory chips where data is stored.
⚫ Interface Protocol: The MicroSD card read module communicates with the host system
using a standard communication protocol such as SPI (Serial Peripheral Interface) or
SDIO (Secure Digital Input Output). This protocol allows the host system to send
commands to the module to read or write data to the MicroSD card.
⚫ Data Transfer: When the host system requests data from the MicroSD card, the module
sends commands to the card to initiate data transfer. The card then reads the requested
data from its flash memory chips and sends it back to the module.
⚫ Data Formatting: The module typically formats the data received from the MicroSD card
into a format that is suitable for the host system. This may involve converting the data
into a specific file system format such as FAT32 or exFAT.
⚫ Data Output: Once the data is retrieved and formatted, the module transfers it to the
host system through its communication interface. The host system can then process the
data as needed, such as displaying it on a screen, saving it to internal memory, or
transmitting it over a network.

Overall, a MicroSD card read module serves as an intermediary between MicroSD cards and
host systems, enabling seamless access to data stored on these cards in a variety of electronic
devices and projects.

Pinout

⚫ VCC
⚫ GND
⚫ MISO
⚫ MOSI
⚫ CLK
⚫ CS

Explanations

⚫ VCC: This pin is connected to the power supply's positive terminal, typically 3.3V or 5V.
It provides the operating voltage for the MicroSD card read module.
⚫ GND: This pin is connected to the power supply's ground terminal. It serves as the
reference point for the electrical circuit and completes the circuit's path.
⚫ MISO: Stands for Master In Slave Out. This pin is used in SPI communication to transfer
data from the MicroSD card to the master device (e.g., Arduino). The MicroSD card acts
as the slave device, and this pin carries data from the slave to the master.
⚫ MOSI: Stands for Master Out Slave In. This pin is also used in SPI communication but for
transferring data from the master device (e.g., Arduino) to the slave device (MicroSD
card). The master sends data to the slave through this pin.
⚫ CLK: Stands for Clock. This pin provides the clock signal for synchronizing data transfer
between the master and slave devices in SPI communication. It ensures that both devices
are synchronized and ready to send or receive data at the same time.
⚫ CS: Stands for Chip Select. This pin is used to select the MicroSD card read module as
the target device for communication in SPI. When this pin is pulled low, it indicates to
the MicroSD card that the master device (e.g., Arduino) wants to communicate with it.

32GB MICROSD Card

Please take care of this card, we have preload plenty of materials in the MicroSD card, for
example: the installer package of Arduino IDE, demo codes and documentations.

USB Card Reader

USB Card Reader is for reading the components inside the MicroSD card by connecting to
your PC or Laptop.

LCD1602

The LCD1602 display, also known as a 16x2 character LCD (Liquid Crystal Display), works on
the principle of liquid crystal modulation to display characters. Here's a basic breakdown of
its working principle:

⚫ Liquid Crystal Layer: The display consists of a layer of liquid crystal material sandwiched
between two transparent electrodes. These electrodes are patterned to form characters
or segments.
⚫ Polarizing Filters: Two polarizing filters are placed on either side of the liquid crystal
layer. These filters help control the passage of light through the liquid crystal layer.
⚫ Backlight: Most LCD displays include a backlight to illuminate the characters for better
visibility. The backlight can be LED or fluorescent.
⚫ Control Circuitry: The control circuitry, usually driven by a microcontroller or dedicated
LCD driver, sends electrical signals to the electrodes to control the alignment of liquid
crystals. By controlling the alignment, segments of the display can be made visible or
invisible.
⚫ Character Generation: The LCD1602 display is capable of displaying 16 characters per
row and has 2 rows, hence the name 16x2. Characters are generated using a character
generator ROM or through custom character generation.
⚫ Communication: The display is typically connected to a microcontroller or other control
circuitry through a communication interface like I2C or parallel interface. This allows the
microcontroller to send commands and data to the display for controlling what is
displayed.
⚫ Driving: To display characters or graphics, the microcontroller sends commands and
data to the display, specifying which characters to display and their positions. The display
then modulates the liquid crystals accordingly to form the desired characters or graphics.

Overall, the LCD1602 display works by modulating the alignment of liquid crystals to create
characters or graphics, which are then illuminated by the backlight for visibility. Its simplicity,
low power consumption, and ease of interfacing make it a popular choice for displaying
information in various electronic devices.

Pinout

⚫ GND
⚫ VCC
⚫ SDA
⚫ SCL

The pins you mentioned are typically associated with an I2C (Inter-Integrated Circuit) interface,
which is a serial communication protocol commonly used to connect peripherals, such as
sensors, displays, and other integrated circuits, to microcontrollers or other devices. Here's
what each pin generally represents:

⚫ GND (Ground): This pin is connected to the ground of the power supply. It serves as the
reference point for all other voltages in the system.
⚫ VCC: This pin is connected to the positive supply voltage. It provides power to the device.
⚫ SDA (Serial Data): SDA is the data line for the I2C communication. It is used for sending
and receiving data between the microcontroller and the device (in this case, the LCD1602
display).
⚫ SCL (Serial Clock): SCL is the clock line for the I2C communication. It provides the timing
for data transfer between the microcontroller and the device. Data is synchronized with
the rising and falling edges of this clock signal.
In the context of connecting an LCD1602 display to a microcontroller via I2C, you would
typically connect the GND pin to the ground of your power supply, the VCC pin to the positive
supply voltage (usually 5V or 3.3V depending on the requirements of your specific display),
and then connect the SDA and SCL pins to the corresponding SDA and SCL pins of your
microcontroller. Additionally, you may need pull-up resistors on the SDA and SCL lines to
ensure proper communication.
Backlight can be enabled by jumper cap, unplug the jumper cap to disable the backlight. The
blue potentiometer on the back is used to adjust the contrast (the ratio of brightness between
the brightest white and the darkest black).
Shorting Cap: Backlight can be enabled by this cap,unplug this cap to disable the backlight.
Potentiometer: It is used to adjust the contrast (the clarity of the displayed text), which is
increased in the clockwise direction and decreased in the counterclockwise direction.

Long breadboard

A breadboard is a fundamental tool in electronics prototyping. It's a rectangular plastic board


with numerous holes arranged in a grid pattern. These holes are used to insert electronic
components and wires to quickly build and test circuits without the need for soldering.

Here's what a breadboard allows you to do:

⚫ Prototype Circuits: Breadboards provide a platform for quickly assembling electronic


circuits. Components such as resistors, capacitors, integrated circuits (ICs), and wires can
be inserted into the breadboard's holes, allowing you to easily create and modify circuits.
⚫ Temporary Connections: Breadboards allow you to make temporary electrical
connections without soldering. Components and wires are held in place by friction in the
holes, making it easy to reconfigure or disassemble circuits as needed.
⚫ Experimentation: Breadboards facilitate experimentation and rapid prototyping. You
can try different component configurations and circuit designs without committing to a
permanent layout. This flexibility is particularly useful when designing and testing new
circuits or troubleshooting existing ones.
⚫ Education and Learning: Breadboards are commonly used in educational settings to
teach electronics and circuitry concepts. They provide a hands-on way for students to
learn about circuit design, component behavior, and electrical principles.
⚫ Low Risk: Because breadboard connections are temporary and non-destructive, there's
minimal risk of damaging components or creating irreversible mistakes. This makes
breadboards ideal for beginners and professionals alike to test ideas and explore new
concepts without worrying about damaging expensive components.
Overall, breadboards are versatile tools that enable rapid prototyping, experimentation, and
learning in electronics. They're an essential part of any electronics enthusiast's toolkit.

Jumper wire box

A jumper wire box typically contains a collection of pre-cut wires with connectors at each end,
commonly used for making temporary electrical connections on breadboards or other
prototyping platforms. Here's what a jumper wire box enables you to do:

⚫ Convenient Connectivity: Jumper wires provide a convenient way to create connections


between components and points on a breadboard without the need for stripping, cutting,
or soldering wires manually. This saves time and effort during circuit prototyping and
experimentation.
⚫ Flexible Routing: Jumper wires allow you to route signals or power from one point to
another on the breadboard in any desired configuration. You can easily change the
routing by repositioning or replacing the jumper wires as needed.
⚫ Versatile Usage: Jumper wire boxes typically contain wires of various lengths and colors,
allowing you to select the appropriate wire for your specific needs. Different lengths and
colors help in organizing and visually distinguishing connections in complex circuits.
⚫ Compatibility: Jumper wires are designed to fit snugly into the holes of breadboards,
making reliable electrical connections without the need for soldering. They usually come
with connectors such as male-to-male, male-to-female, and female-to-female,
providing versatility in connecting different types of components.
⚫ Temporary Connections: Jumper wires facilitate temporary connections during
prototyping and testing phases of circuit development. They allow you to quickly iterate
on circuit designs, make modifications, and troubleshoot issues without permanently
committing to a wiring configuration.

In summary, a jumper wire box is a convenient and versatile accessory for electronics
enthusiasts, hobbyists, and professionals alike, providing a hassle-free way to create
temporary electrical connections during circuit prototyping and experimentation.

Male-to-male breadboard Jumper wire

20 x Male-to-male breadboard Jumper wire.

Female-to-male Jumper wire

40 x Female-to-male Jumper wire.

Male-to-male Jumper wire

20 x Male-to-male Jumper wire.


3Ω Speaker module

A 3W speaker is a type of audio transducer designed to convert electrical signals into sound
waves with a maximum power output of approximately 3 watts. Here's what a 3W speaker
does:

⚫ Sound Reproduction: The primary function of a 3W speaker is to reproduce sound.


When an electrical audio signal is supplied to the speaker, it vibrates according to the
variations in the signal, producing sound waves that correspond to the original audio
content.
⚫ Amplification: The 3W rating indicates the maximum power the speaker can handle
without risking damage. This power is typically achieved through an amplifier circuit that
increases the amplitude of the audio signal to drive the speaker effectively.
⚫ Applications: 3W speakers find applications in various electronic devices where audio
output is required but space or power constraints limit the size and wattage of the
speaker. Common applications include portable electronic devices like smartphones,
tablets, portable radios, Bluetooth speakers, small amplifiers, and IoT devices.
⚫ Audio Quality: While the wattage rating gives an indication of the speaker's maximum
power handling capability, it doesn't necessarily correlate directly with audio quality.
Factors such as speaker design, frequency response, impedance matching, and enclosure
design also play crucial roles in determining the overall sound quality.
⚫ Compatibility: 3W speakers are often compatible with audio amplifiers and other audio
processing circuits designed to drive speakers of similar power ratings. They can be
connected directly to audio output circuits or through audio amplifiers to achieve the
desired volume and clarity.

Overall, a 3W speaker is a compact yet capable audio transducer suitable for a wide range of
applications where moderate audio output is required within space and power constraints.

Pinout

⚫ GND (The black)


⚫ VCC (The Red)
Speaker Amplifier (XY-SP5W)

The Speaker Amplifier XY-SP5W is a specific model of amplifier designed to drive speakers,
typically with a power output of up to 5 watts. Here's what the XY-SP5W amplifier does:

⚫ Amplification: The primary function of the XY-SP5W amplifier is to amplify audio signals.
It takes low-level audio signals from an input source, such as a smartphone, computer,
or audio player, and boosts their power to a level sufficient to drive speakers.
⚫ Power Output: The XY-SP5W amplifier is capable of providing up to 5 watts of power
output. This makes it suitable for driving speakers with a power rating of up to 5 watts,
such as small to medium-sized speakers used in portable audio devices, DIY speaker
projects, or small amplification setups.
⚫ Compact Design: The XY-SP5W amplifier is typically compact and lightweight, making
it suitable for integration into various audio systems where space is limited. Its small form
factor allows it to be easily mounted or installed alongside speakers or other audio
components.
⚫ Compatibility: The amplifier is compatible with a wide range of audio input sources,
including smartphones, tablets, computers, MP3 players, and other audio devices. It
typically accepts audio input via a standard 3.5mm audio jack or RCA connectors.
⚫ Power Supply: The amplifier requires a power supply to operate. Depending on the
model, it may operate on DC power from batteries or an external power adapter. Some
models may also support USB power for added convenience.
⚫ Volume Control: Many amplifiers, including the XY-SP5W, feature built-in volume
control knobs or buttons. This allows users to adjust the volume level of the amplified
audio output to suit their preferences or the requirements of the audio system.

Overall, the XY-SP5W Speaker Amplifier is designed to provide amplification for audio signals,
enabling them to drive speakers with a power output of up to 5 watts. It's suitable for a variety
of applications where moderate audio amplification is needed, such as DIY audio projects,
portable speaker systems, or small amplification setups.
Pinout

⚫ Audio output+
⚫ Audio output-
⚫ MUTE
⚫ AGND
⚫ Audio input
⚫ Power +5V

Explanations

⚫ Audio output+: This refers to the positive terminal of the audio output. It is where the
amplified audio signal is outputted.
⚫ Audio output-: This refers to the negative terminal of the audio output. It completes the
audio output circuit.
⚫ MUTE: This is a control input that mutes or unmutes the audio output. When activated,
it suppresses the audio signal, and when deactivated, it allows the audio signal to pass
through.
⚫ AGND: This stands for Analog Ground. It is the ground reference for analog signals in
the circuit. It helps maintain a stable reference voltage for analog components.
⚫ Audio input: This is the input terminal for the audio signal that needs to be amplified. It
is where the external audio source is connected.
⚫ Power +5V: This is the positive terminal of the power supply, typically connected to a
5V power source. It provides the operating voltage for the module.

LED indicator pack

20 x LED (Five red, yellow, blue and white).

A LED indicator pack typically consists of one or more light-emitting diodes (LEDs) along with
associated resistors and connectors, packaged together for easy integration into electronic
circuits. Here's what a LED indicator pack can do:

⚫ Visual Indication: LEDs in the pack serve as visual indicators, providing feedback or
status information to users about the operation of the electronic device or circuit. When
powered, the LEDs emit light, which can be used to indicate various states such as power
on/off, activity, error conditions, or specific functions.
⚫ Low Power Consumption: LEDs are energy-efficient light sources with low power
consumption. They can be illuminated continuously without significantly impacting the
overall power consumption of the device or circuit in which they are used.
⚫ Compact and Durable: LEDs are compact and durable, making them suitable for
integration into various electronic devices and environments. They have a long
operational life compared to traditional incandescent bulbs and are resistant to shocks
and vibrations.
⚫ Easy Integration: LED indicator packs often come with pre-wired connectors or leads,
making them easy to integrate into electronic circuits without the need for soldering or
additional assembly. They can be directly connected to power sources and control
circuits using standard electrical connections.
⚫ Multiple Colors and Configurations: LED indicator packs are available in various colors
(such as red, green, blue, yellow) and configurations (such as single-color, bi-color, or
multi-color). This allows designers to choose the appropriate LED color and
configuration to suit the specific requirements and aesthetics of their application.
⚫ Customization: Some LED indicator packs may offer options for customization, allowing
users to select specific LED colors, brightness levels, viewing angles, or packaging
configurations to meet their unique needs.

Overall, a LED indicator pack provides a convenient and versatile solution for incorporating
visual indicators into electronic circuits and devices, offering low power consumption,
durability, ease of integration, and customization options to suit a wide range of applications.

Press button

6 x Press button.

A push button pack typically consists of one or more push buttons along with associated
resistors, connectors, and mounting hardware, packaged together for easy integration into
electronic circuits. Here's what a push button pack can do:

⚫ Manual Input: Push buttons serve as manual input devices, allowing users to trigger
specific actions or functions within electronic circuits or devices by pressing the buttons.
When a button is pressed, it creates a momentary electrical connection, which can be
detected by the circuitry connected to the button.
⚫ User Interaction: Push buttons enable user interaction with electronic devices, providing
tactile feedback and control over various functions such as power on/off, mode selection,
parameter adjustment, menu navigation, or initiating actions.
⚫ Switching Signals: Push buttons can be used to switch electrical signals within a circuit,
either by directly connecting or disconnecting circuits when pressed or by triggering
logic-level changes that control the behavior of connected components or systems.
⚫ Interrupts and Events: In microcontroller-based systems, push buttons are often used
to generate interrupts or trigger events that initiate specific actions or interrupt ongoing
processes. This allows for responsive and interactive behavior in embedded systems.
⚫ Reset and Emergency Stop: Push buttons are commonly used for reset functions or
emergency stop mechanisms in electronic systems. Pressing a designated button can
reset the device to a default state or immediately halt operation in case of emergencies.
⚫ Easy Integration: Push button packs come with pre-wired connectors or leads, making
them easy to integrate into electronic circuits without the need for soldering or additional
assembly. They can be directly connected to input pins of microcontrollers, digital logic
circuits, or other control circuitry.
⚫ Multiple Configurations: Push button packs may offer various configurations such as
momentary or latching buttons, normally open or normally closed contacts, and different
sizes or shapes to suit the specific requirements and preferences of the application.

Overall, a push button pack provides a convenient and versatile solution for incorporating
manual input and user interaction into electronic circuits and devices, enabling control,
switching, event triggering, and emergency functionality in a wide range of applications.

Button cap

6 x Button cap.

Buzzer

A buzzer or beeper is an audio signaling device that can be mechanical, electromechanical,


or piezoelectric (piezo for short). Buzzers and beepers are commonly used in various
applications, including alarm systems, timers, and as auditory feedback to confirm user input,
such as a mouse click or keystroke.

Pinout

⚫ + Positive
⚫ - negative

Explanations

The plus (+) and minus (-) signs on a buzzer denote the polarity of the electrical connections.
Here's what they typically mean:

⚫ Positive (+): The positive terminal of the buzzer is the connection point for the positive
voltage supply. This terminal should be connected to the positive (+) side of the power
source or electrical circuit.
⚫ Negative (-): The negative terminal of the buzzer is the connection point for the negative
voltage supply or ground. This terminal should be connected to the negative (-) side of
the power source or electrical circuit.

Correctly connecting the positive and negative terminals ensures that the buzzer operates as
intended, producing sound when powered. If the polarity is reversed, the buzzer may not
function properly or may not produce any sound at all. Additionally, reversing the polarity
could potentially damage the buzzer, so it's important to ensure correct polarity when
connecting it to a power source or circuit.

Battery cap

A 9V battery cap.
Sound sensor

The sound sensor, as the name implies, detects sound. It responds to sound input by
producing a digital trigger signal, adjustable with a variable trigger level. LED indicators show
the power status and signal output. With this device, you can determine whether sound has
surpassed a set threshold, giving you flexibility in its applications.

Sound sensors are commonly used to detect sound intensity. They find applications in
switches, security systems, and monitoring setups. Adjusting the sensor's accuracy enhances
usability.

This sensor consists of a microphone, buffer, peak detector, and amplifier. It detects sound,
processes it into an output voltage signal, and sends it to a microcontroller for further
processing.

Capable of measuring noise levels in decibels at frequencies around 3 kHz to 6 kHz, which
are within the range of human hearing sensitivity, the sound sensor operates by converting
sound waves into electrical signals. When sound waves hit the microphone, they cause the
diaphragm to vibrate, generating an electrical signal proportional to the sound wave's
amplitude.

Pinout

⚫ VCC
⚫ GND
⚫ OUT

Explanations

The pins on a sound sensor typically serve the following purposes:


⚫ VCC: This pin is used to connect the sound sensor to a power supply. It usually requires
a DC voltage within a specified range (commonly 3.3V or 5V) to power the sensor.
⚫ GND (Ground): This pin is connected to the ground of the power supply. It serves as the
reference point for all other voltages in the system and completes the circuit.
⚫ OUT: The OUT pin is the output signal of the sound sensor. It provides a digital or analog
signal that corresponds to the level of sound detected by the sensor.
- Digital Output: In some sound sensors, the OUT pin provides a digital signal that
indicates the presence or absence of sound above a certain threshold. For example,
it might output a high voltage (logical 1) when sound is detected and a low voltage
(logical 0) when no sound is detected.
- Analog Output: Other sound sensors may provide an analog signal that varies in
voltage depending on the intensity or frequency of the sound detected. The voltage
level might increase with louder sounds and decrease with quieter sounds.

These pins allow the sound sensor to be powered, grounded, and connected to other
components in a circuit, enabling it to detect sound and provide corresponding output signals
for further processing or triggering actions in a system.

Capacitive touch module

A capacitive touch module is a type of sensor module that detects touch or proximity by
measuring changes in capacitance. Here's what a capacitive touch module can do:

⚫ Touch Sensing: Capacitive touch modules can detect when a conductive object, such as
a finger or stylus, comes into proximity with the sensor surface. When touched, the
capacitance of the sensor changes, allowing the module to detect the touch event.
⚫ No Mechanical Parts: Unlike mechanical buttons or switches, capacitive touch modules
have no moving parts. This makes them more durable and reliable since there are no
components that can wear out over time.
⚫ Multi-Touch Capability: Some capacitive touch modules support multi-touch
functionality, allowing them to detect multiple touch points simultaneously. This feature
is useful in applications such as touchscreens where users may need to perform multi-
finger gestures.
⚫ Proximity Sensing: Capacitive touch modules can also be used for proximity sensing,
where the module detects the presence of a conductive object without direct contact.
This can be useful for applications such as proximity switches or detecting the presence
of a hand near a display.
⚫ Customizable Sensitivity: Many capacitive touch modules allow for adjustable sensitivity
settings, allowing developers to fine-tune the module's response to touch or proximity
according to the requirements of the application.
⚫ Easy Integration: Capacitive touch modules typically come with standardized interfaces
such as digital or analog outputs, making them easy to integrate into various electronic
projects or systems. They can be connected to microcontrollers, development boards, or
other digital systems.
⚫ Low Power Consumption: Capacitive touch modules generally consume low power,
making them suitable for battery-powered devices or applications where power
efficiency is important.

Overall, a capacitive touch module provides a reliable and versatile solution for detecting
touch or proximity in electronic devices and projects, offering features such as multi-touch
capability, customizable sensitivity, and easy integration. They are commonly used in
consumer electronics, industrial controls, interactive displays, and many other applications.

Pinout

⚫ VCC
⚫ GND
⚫ IO

Explanations

The pins you listed are commonly found on capacitive touch modules and serve the following
purposes:

⚫ VCC (Voltage Supply): The VCC pin is used to connect the module to a positive voltage
supply. This pin typically requires a DC voltage within a specified range (commonly 3.3V
or 5V) to power the module.
⚫ GND (Ground): The GND pin is connected to the ground of the power supply. It serves
as the reference point for all other voltages in the system and completes the circuit.
⚫ IO (Input/Output): The IO pin is used for communication between the capacitive touch
module and an external microcontroller or other digital device. It typically functions as
both an input and output pin, allowing the module to receive commands or configuration
data from the microcontroller and transmit touch or proximity detection information
back to the microcontroller.
⚫ Input Mode: In input mode, the IO pin receives signals from an external microcontroller
to configure the module or request touch/proximity data.
⚫ Output Mode: In output mode, the IO pin transmits touch or proximity detection data
from the module to the microcontroller, indicating the presence or absence of
touch/proximity events.
These pins allow the capacitive touch module to be powered, grounded, and connected to
external devices for communication, enabling it to detect touch or proximity events and
transmit the corresponding data for further processing or control in a system.

CAN BUS Module

High-speed CAN transceivers with up to 8 Mbit/s transmission speed for automotive and
many other applications.
Initially, the CAN technology was invented to offer robust and scalable networks in the car.
With faster data rates it turned out to be more difficult to keep this robustness. Developing
complex networks with low data rates e.g., 500 Kbit/s or 1 Mbit/s had been comparably easy.
Faster networks using 2 Mbit/s or 5 Mbit/s data rate could be only realized in smaller and less
complex networks.

Pinout

⚫ CANH
⚫ CANL
⚫ VCC
⚫ TX
⚫ RX
⚫ GND

Explanations

The pins you listed are commonly found on CAN bus modules and serve the following
purposes:

⚫ CANH and CANL (CAN High and CAN Low): These two pins are used for the differential
signaling of the CAN bus. CANH carries the CAN high signal, while CANL carries the CAN
low signal. Together, they form a differential pair that allows for robust communication
over long distances in noisy environments.
⚫ VCC (Voltage Supply): The VCC pin is used to connect the module to a positive voltage
supply. This pin typically requires a DC voltage within a specified range (commonly 3.3V
or 5V) to power the module.
⚫ TX (Transmit): The TX pin is used for transmitting data from the module to another
device on the CAN bus. Messages sent by the module are transmitted on this pin.
⚫ RX (Receive): The RX pin is used for receiving data from other devices on the CAN bus.
Messages received by the module are received on this pin.
⚫ GND (Ground): The GND pin is connected to the ground of the power supply. It serves
as the reference point for all other voltages in the system and completes the circuit.
These pins allow the CAN bus module to be powered, grounded, and connected to the CAN
bus network for communication, enabling it to transmit and receive data according to the
CAN protocol. The CANH and CANL pins are particularly important for the proper operation
of the CAN bus, as they facilitate the differential signaling that ensures reliable communication.

Rain Drop Sensor

A raindrop sensor, also known as a rain sensor or rain detector, is a device that detects the
presence of rain or water droplets. Here's what a raindrop sensor can do:

⚫ Rain Detection: The primary function of a raindrop sensor is to detect the presence of
rain or water droplets. When rain falls on the sensor surface, it changes the electrical
conductivity or capacitance of the sensor, triggering a detection mechanism.
⚫ Output Signal: Raindrop sensors typically provide an output signal that indicates the
presence or intensity of rainfall. This signal can be analog or digital, depending on the
design of the sensor.
⚫ Analog Output: Some raindrop sensors provide an analog output voltage or current
that varies proportionally with the amount of rainfall detected. This allows for continuous
monitoring of rainfall intensity.
⚫ Digital Output: Other raindrop sensors provide a digital output signal that indicates the
presence or absence of rainfall. This signal may be in the form of a logic level (e.g., high
or low) that changes state when rain is detected.
⚫ Interface with Microcontrollers: Raindrop sensors are often designed to interface with
microcontrollers or other digital devices for data processing and analysis. They can be
connected to input pins of microcontrollers to monitor the output signal and trigger
actions or alerts based on rainfall detection.
⚫ Weather Monitoring: Raindrop sensors are commonly used in weather monitoring
systems to measure and record rainfall data. They can be deployed in outdoor
environments such as gardens, agricultural fields, or meteorological stations to provide
real-time information about rainfall patterns and trends.
⚫ Automated Systems: Raindrop sensors can be integrated into automated systems for
various applications, such as automatic irrigation systems, smart home automation, and
vehicle rain detection systems. They enable these systems to respond dynamically to
changing weather conditions, conserving resources and enhancing efficiency.

Overall, a raindrop sensor provides a reliable and cost-effective solution for detecting rainfall
and monitoring weather conditions in a wide range of applications, from agriculture and
environmental monitoring to smart infrastructure and urban planning.

Pinout

⚫ VCC
⚫ GND
⚫ AO
⚫ DO

Explanations

The pins you listed are commonly found on raindrop sensors and serve the following
purposes:

⚫ VCC (Voltage Supply): The VCC pin is used to connect the raindrop sensor to a positive
voltage supply. This pin typically requires a DC voltage within a specified range
(commonly 3.3V or 5V) to power the sensor.
⚫ GND (Ground): The GND pin is connected to the ground of the power supply. It serves
as the reference point for all other voltages in the system and completes the circuit.
⚫ AO (Analog Output): The AO pin provides an analog output signal that varies
proportionally with the amount of rainfall detected by the sensor. The voltage or current
level on this pin changes depending on the intensity of the rain.
⚫ Analog Output: Some raindrop sensors provide an analog output voltage or current on
the AO pin that corresponds to the moisture level detected by the sensor. This allows for
continuous monitoring of rainfall intensity.
⚫ DO (Digital Output): The DO pin provides a digital output signal that indicates the
presence or absence of rainfall above a certain threshold.
⚫ Digital Output: Some raindrop sensors provide a digital output signal on the DO pin
that changes state (e.g., from low to high) when rain is detected above a predefined
threshold. This signal can be interfaced directly with digital input pins of microcontrollers
or other digital devices for rain detection.
These pins allow the raindrop sensor to be powered, grounded, and connected to external
devices for communication and data processing, enabling it to detect rainfall and provide
corresponding output signals for further analysis or control in a system. The analog and digital
output pins provide flexibility for interfacing with different types of microcontrollers or other
digital systems, depending on the application requirements.

Soil moisture sensor

A moisture sensor, also known as a soil moisture sensor or humidity sensor, is a device that
measures the moisture content or relative humidity of its surrounding environment. Here's
what a moisture sensor can do:

⚫ Moisture Detection: The primary function of a moisture sensor is to detect the presence
and level of moisture in its immediate environment, such as soil, air, or other materials.
It measures the electrical conductivity or capacitance of the medium to determine its
moisture content.
⚫ Soil Moisture Monitoring: Moisture sensors designed for soil moisture monitoring are
commonly used in agriculture, gardening, and landscaping applications. They measure
the moisture level of the soil, allowing users to determine when and how much to water
plants based on their moisture requirements.
⚫ Watering Control: Moisture sensors can be integrated into automated watering systems
to control irrigation based on real-time soil moisture data. When the soil moisture falls
below a certain threshold, the sensor triggers the irrigation system to water the plants,
ensuring optimal soil moisture levels for plant growth.
⚫ Environmental Monitoring: Moisture sensors can also be used for environmental
monitoring in various applications such as weather stations, greenhouses, and indoor
plant cultivation. They provide valuable data on humidity levels, allowing users to monitor
and maintain optimal environmental conditions for plants, crops, or sensitive equipment.
⚫ Leak Detection: Moisture sensors can detect water leaks or excess moisture in indoor
environments such as basements, bathrooms, and kitchens. They trigger alarms or
notifications when moisture levels exceed predefined thresholds, helping to prevent
water damage and mold growth.
⚫ Drying Process Control: In industrial or manufacturing settings, moisture sensors are
used to monitor and control drying processes in materials such as grains, wood, paper,
and textiles. They ensure that materials are dried to the desired moisture level, optimizing
product quality and production efficiency.
⚫ Humidity Sensing: Moisture sensors designed for humidity sensing applications
measure the relative humidity of the air. They are used in HVAC systems, weather stations,
and environmental monitoring systems to maintain comfortable indoor conditions and
prevent mold growth.

Overall, a moisture sensor provides a valuable tool for monitoring and controlling moisture
levels in various environments, enabling efficient water management, environmental
monitoring, and process control in a wide range of applications.

Pinout

⚫ VCC
⚫ GND
⚫ AO
⚫ DO
Explanations

⚫ VCC (Voltage Supply): The VCC pin is used to connect the moisture sensor to a positive
voltage supply. This pin typically requires a DC voltage within a specified range
(commonly 3.3V or 5V) to power the sensor.
⚫ GND (Ground): The GND pin is connected to the ground of the power supply. It serves
as the reference point for all other voltages in the system and completes the circuit.
⚫ AO (Analog Output): The AO pin provides an analog output signal that varies
proportionally with the moisture level detected by the sensor. The voltage or current
level on this pin changes depending on the moisture content of the environment being
sensed.
⚫ Analog Output: Some moisture sensors provide an analog output voltage or current on
the AO pin that corresponds to the moisture level detected by the sensor. This allows for
continuous monitoring of moisture levels.
⚫ DO (Digital Output): The DO pin provides a digital output signal that indicates the
presence or absence of moisture above a certain threshold.
⚫ Digital Output: Some moisture sensors provide a digital output signal on the DO pin
that changes state (e.g., from low to high) when moisture is detected above a predefined
threshold. This signal can be interfaced directly with digital input pins of microcontrollers
or other digital devices for moisture detection.
These pins allow the moisture sensor to be powered, grounded, and connected to external
devices for communication and data processing, enabling it to detect moisture levels and
provide corresponding output signals for further analysis or control in a system. The analog
and digital output pins provide flexibility for interfacing with different types of
microcontrollers or other digital systems, depending on the application requirements.

Here we have finished introducing all the modules. Now, let's start with some basic operations
of Arduino UNO WiFi and do a few small experiments to practice, shall we?

Basic Experiment

Lighting up LED matrix onboard the Arduino UNO R4 WIFI

Steps

Step 1: Use the USB-C Programming Cable to connect the PC and the Arduino UNO R4 WIFI.
Step 2: Open the Arduino IDE, create a new sketch, and clear all existing code.
Click Arduino IDE Icon on desktop.

Click File on menu bar and click New Sketch:

Input the demo code as following, or just try to find it out in MicroSD card’s democodes folder.
Here is the demo code:
#include "Arduino_LED_Matrix.h" // Include the LED_Matrix
library
#include "frames.h" // Include a header file
containing frame data

ArduinoLEDMatrix matrix; // Create an instance of the


ArduinoLEDMatrix class

void setup() {
Serial.begin(115200); // Initialize serial
communication at a baud rate of 115200
matrix.begin(); // Initialize the LED matrix
}

void loop() {
// Load and display the "fullOn" frame on the LED matrix
matrix.loadFrame(fullOn);
delay(500);

// Load and display the "fulloff" frame on the LED matrix


matrix.loadFrame(fulloff);
delay(500);

// Print the current value of millis() to the serial monitor


Serial.println(millis());
}

This code is for controlling an LED matrix display using an Arduino microcontroller. Let me
break it down step by step:

⚫ #include "Arduino_LED_Matrix.h" and #include "frames.h": These lines include two


header files. The first one likely contains the necessary definitions and functions for
controlling the LED matrix, while the second one seems to include a header file
containing frame data.
⚫ ArduinoLEDMatrix matrix;: This line declares an object named matrix of type
ArduinoLEDMatrix. This object will be used to interact with the LED matrix.
⚫ void setup() { ... }: This is the setup function, which runs once when the Arduino is
powered up or reset. Inside this function:
⚫ Serial.begin(115200);: This initializes serial communication with a baud rate of 115200
bits per second. This allows communication between the Arduino and an external device
(like a computer) through the serial port.
⚫ matrix.begin();: This initializes the LED matrix.
⚫ void loop() { ... }: This is the loop function, which runs repeatedly as long as the Arduino
has power. Inside this function:
⚫ matrix.loadFrame(fullOn);: This loads and displays the "fullOn" frame on the LED matrix.
It seems like there's a function called loadFrame() in the ArduinoLEDMatrix class that
accepts a frame as an argument.
⚫ delay(500);: This causes the Arduino to pause execution for 500 milliseconds (half a
second).
⚫ matrix.loadFrame(fulloff);: This loads and displays the "fulloff" frame on the LED matrix.
⚫ delay(500);: Another delay of 500 milliseconds.
⚫ Serial.println(millis());: This prints the current value of the millis() function to the serial
monitor. The millis() function returns the number of milliseconds since the Arduino board
began running the current program.

Overall, this code initializes the LED matrix, repeatedly displays two frames alternately (with a
delay between them), and prints the current time to the serial monitor.

The frames.h header file is the hex code we should create by using other tool. it will generate
the pattern to lights up the LED matrix.

Then click three dots icon on right corner of Arduino IDE to add a new file, name it as frames.h.
create a new Tab

Then write down the frames.h and copy the code then fill in it.

const uint32_t fullOn[] = { //turn on the LED matrix


0xffffffff,
0xffffffff,
0xffffffff
};

const uint32_t fulloff[] = { //off


0x00000000,
0x00000000,
0x00000000
};

Explanations

The frames.h header file likely contains definitions of frame data for the LED matrix display. In
this context, a "frame" refers to a configuration or pattern of LEDs on the matrix.
Here's what the contents of frames.h mean:

⚫ const uint32_t fullOn[] = { ... };: This defines an array named fullOn, which contains three
32-bit unsigned integer values. Each 32-bit value represents a row of LEDs on the LED
matrix. In this case, all LEDs are turned on, as indicated by the hexadecimal value 0xffffffff
for each row. Each '1' bit in the 32-bit value corresponds to an LED that is turned on, and
each '0' bit corresponds to an LED that is turned off.
⚫ const uint32_t fulloff[] = { ... };: This defines another array named fulloff, also containing
three 32-bit unsigned integer values. Each 32-bit value represents a row of LEDs on the
LED matrix. In this case, all LEDs are turned off, as indicated by the hexadecimal value
0x00000000 for each row. Each '0' bit in the 32-bit value corresponds to an LED that is
turned off.

These arrays represent two different states of the LED matrix: one where all LEDs are turned
on (fullOn), and the other where all LEDs are turned off (fulloff). These frames can be loaded
and displayed on the LED matrix using the loadFrame() function, as shown in the main code.

Step 2: select the com port where the Arduino UNO R4 WIFI is located in the software, click
the upload button, you can upload the codes to the Arduino UNO R4 WIFI.

Please select the COM port according to your current COM port.
and then click upload icon as following figure to compile the demo code and upload it to
Arduino UNO WiFi board.
Once it done, you will see the whole LED matrix will light up as following figure.

and then it will blink per second.

If you have achieved this goal, Congratulations!


You have made it, the first experiment on Arduino UNO R4 WiFi!
And then you can try to modify the frames.h file’s const unit32_t fullOn[] variable, for example,
change 0xffffffff to 0x55AA55AA and save it, compile and upload again.

Make an animation and play it on LED Matrix

In the official R4 WIFI new features, there is a section about LED matrix animation. Now let's
upload and run the official animation, then make an animation and play it on LED Matrix. The
Official have developed a tool that is used to generate frames and animations to be rendered
on the LED Matrix in your browser. This tool is part of Arduino labs, and is therefore
considered experimental software.
⚫ Step 1: Firstly, connect the Arduino UNO R4 WIFI with the PC. Open the Arduino IDE.
⚫ Step 2: Find and open the Examples for Arduino UNO R4 WIFI LED_Matrix PlayAnimation.

The same way to upload sketch to Arduino UNO R4 WiFi.

Now let's try to generate our own animation hex code. Open a browser and access this URL:
https://ledmatrix-editor.arduino.cc/ , click the block to draw your own animation frames. Click
+ icon on button to add new frame to draw different frame and make it showing up frame
by frame.

Here you may ask me what is the animation’s work principle?


The principle of animation involves creating the illusion of motion by displaying a sequence
of images or frames in rapid succession. Here's how it typically works:

⚫ Frame Sequencing: Animation begins with the creation of individual frames. Each frame
represents a specific moment in time and contains the visual elements that are meant to
be displayed at that moment. These frames are created either manually by artists or
generated algorithmically.
⚫ Playback Speed: Animation playback speed is determined by the frame rate, which is
the number of frames displayed per second (fps). Higher frame rates result in smoother
motion but require more processing power. Common frame rates for animations range
from 24 to 60 fps, depending on the medium and desired effect.
⚫ Interpolation: In between key frames (frames where significant changes occur), software
can interpolate additional frames to create smoother motion. This process, known as
tweening, generates frames that transition between key frames seamlessly, making the
animation appear more fluid.
⚫ Rendering: Once all frames are created or interpolated, they are rendered together to
form the animation sequence. Rendering involves combining the visual elements of each
frame and outputting them in a format suitable for display.
⚫ Display: Finally, the rendered animation is displayed on a screen, whether it's a computer
monitor, television, movie theater screen, or other display device. The rapid succession
of frames creates the illusion of motion to the viewer's eyes.

Animation can be created using various techniques, including traditional hand-drawn


animation, computer-generated imagery (CGI), stop motion, and motion capture. Each
technique has its own workflow and tools but follows the fundamental principle of displaying
a sequence of images to create the perception of motion.

When you finished the animation, you can follow the steps to upload it to your Arduino UNO
R4 WIFI.
Then save the file to a location where you can find it.

Open this file just by notepad.

Then copy all codes to the Arduino IDE.


Click the animation.h delete all, and paste your own animation codes.

Finally, upload the code.


At last, you can see your animation you make just before, and played in the Arduino UNO R4
WIFI LED Matrix.

how to blink a led by using Arduino UNO R4 WiFi board?

Following Experiment will make your first experiment with Electronic component, the LED
indicator, which is the basic experiment to know about how to communicate with electronic
components via GPIO pin, this is an output control experiment.

To blink an LED using an Arduino UNO R4 WiFi board, you can follow these steps:

⚫ Connect the LED to one of the digital pins on the Arduino board. For example, you can
connect the positive (anode) leg (long leg) of the LED to pin 13 and the negative (cathode)
leg (short leg) to ground (GND).

⚫ Write the Arduino code to control the LED blinking. Here's a simple example code to
blink the LED connected to pin 13:

// Define the pin number for the LED


const int ledPin = 13;

void setup() {
// Initialize the digital pin as an output
pinMode(ledPin, OUTPUT);
}

void loop() {
// Turn the LED on (HIGH)
digitalWrite(ledPin, HIGH);
// Wait for 1 second
delay(1000);
// Turn the LED off (LOW)
digitalWrite(ledPin, LOW);
// Wait for 1 second
delay(1000);
}

Upload it and observe the behavior of the LED indicator.

After uploading, the LED indicator will blink like an angle. LOL.
How to activity with arduino UNO R4 WiFi board with a press
button and a led indicator?

To create an activity with an Arduino UNO R4 WiFi board involving a push button and an LED
indicator, you can implement a simple project where pressing the button toggles the state of
the LED. Here's how you can do it:

Hardware Setup:

⚫ Connect one terminal of the push button to a digital pin on the Arduino UNO R4 WiFi
board (e.g., pin 7).
⚫ Connect the other terminal of the push button to the ground (GND) pin on the Arduino.
⚫ Connect one terminal of the LED to another digital pin (e.g., pin 2) via a current-limiting
resistor (usually 220 ohms).
⚫ Connect the other terminal of the LED to the ground (GND) pin on the Arduino.

Open a new sketch and typing following code:


// Define pin numbers
const int buttonPin = 7; // Pin connected to the push button
const int ledPin = 2; // Pin connected to the LED

// Variable to store the state of the LED


bool ledState = LOW;

void setup() {
// Initialize the digital pins
pinMode(buttonPin, INPUT_PULLUP); // Set the button pin as
input with internal pull-up resistor
pinMode(ledPin, OUTPUT); // Set the LED pin as output
}

void loop() {
// Read the state of the button
bool buttonState = digitalRead(buttonPin);

// Check if the button is pressed (buttonState is LOW because


of the pull-up resistor)
if (buttonState == LOW) {
// Toggle the state of the LED
ledState = !ledState;
// Update the LED
digitalWrite(ledPin, ledState);
// Delay to debounce the button (optional)
delay(200);
}
}

This code sets up the button pin as an input with an internal pull-up resistor, meaning it will
read HIGH when the button is not pressed and LOW when it is pressed. The LED pin is set as
an output. In the loop function, it continuously checks the state of the button. If the button is
pressed, it toggles the state of the LED and waits for a short delay to debounce the button.

Upload the Code:

Upload the code to your Arduino UNO R4 WiFi board using the Arduino IDE or another
compatible programming environment.

Test the Setup:

Once the code is uploaded, press the button, and the LED should toggle on and off with each
press of the button.

This project demonstrates a basic interaction between a push button and an LED using an
Arduino UNO R4 WiFi board. You can expand upon this by adding additional features or
incorporating WiFi functionality for remote control or monitoring.

OK, you have already learned a lot of knowledge about the components in this kit, let’s get
into next chapter and learn more funny projects!

You might also like