Skip to content
LSLab

Overview of Digital Signals and Pulses

  • Starter
  • Article
  • Ages 10+
  • 4 min read
An oscilloscope display shows a square-wave pulse switching clearly between two levels.

In the conceptual model, an analog signal can take infinitely many values within a range, while a digital signal uses discrete levels; a binary example uses high and low. A train of digital pulses can carry information through pulse width, as in PWM, or be counted by its edges. Knowing this helps you read the articles about IO pins and communication.

Contents
An analog signal is modeled as varying continuously; a digital signal has discrete levels.
  • Analog signal
  • Digital signal

What you will learn

Before you start

No prior knowledge needed.

How do analog and digital signals differ?

In the conceptual model, an analog signal can take infinitely many values within a range. Digital signals use discrete values; a binary example uses only two levels. Most microprocessors and logic blocks process information using digital logic; real systems can still contain analog parts.

The analog model allows any value in a range; a digital signal uses a discrete set.
  • Analog: continuous
  • Digital: jumps levels
  • Discrete levels

What is a logic level?

A logic level is a signal state interpreted using voltage thresholds. The binary example here has two levels, HIGH and LOW in Arduino; these correspond to voltage ranges, not necessarily one exact value. Which level turns a device on depends on the circuit. Before connecting signals, check voltage compatibility between devices; a voltage that is too high can damage an input not rated to tolerate it.

Binary logic example: HIGH and LOW; real circuits interpret them using voltage thresholds.
  • Digital signal
  • High level (HIGH)
  • Low level (LOW)

How are pulses made and counted?

Pulse width modulation (PWM) is a digital signal that switches between HIGH and LOW. At a fixed period, changing how long the signal stays HIGH changes its duty cycle — the fraction of the whole cycle spent high, often expressed as a percentage.

The ESP32 pulse-counter peripheral (PCNT) can record incoming edges. Each counter unit has multiple channels, and each channel can increment or decrement the count on a rising or falling edge.

At a fixed period, wider pulses increase the fraction of time spent high.
  • Narrow pulses, low duty cycle
  • Wide pulses, high duty cycle
  • Illustrative average level

Real-world example

With an adult, look at an LED dimmed by PWM. A longer on-time can make it appear brighter, provided the frequency is high enough for the intended perceived dimming effect. A rotation sensor can send pulses for a counter to record.

Common misunderstandings

A digital signal can take any value. A digital signal uses discrete levels; a binary example has two levels.

PWM is an analog signal. PWM is a type of digital signal.

Frequently asked questions

What is a logic level?

A signal state interpreted using voltage thresholds; HIGH and LOW are acceptable ranges, with an undefined region possible between them.

What are HIGH and LOW in Arduino?

The high and low logic levels; which level turns a device on depends on the circuit.

What is duty cycle?

The fraction of one cycle for which a signal is high; it may be written as a ratio or percentage.

What is an edge?

The moment a signal changes between low and high, recorded by a pulse counter on a rising or falling edge.

Summary

  • The analog model allows infinitely many values; a digital signal uses discrete levels.
  • The binary logic example distinguishes HIGH and LOW; real devices interpret them using voltage thresholds.
  • PWM changes the time spent HIGH; ESP32 PCNT records pulse edges.

Terms in this article

English and Vietnamese terms, with the meanings used here. Hover, tap or Tab to a term with a dotted underline for an explanation as you read.

Analog signalTín hiệu tương tự
In the conceptual model, an analog signal can take infinitely many values within a range.
Digital signalTín hiệu số
A signal using discrete values; a binary example has two levels.
Logic levelMức logic
A signal state interpreted using a circuit’s voltage thresholds; HIGH and LOW need not mean one exact voltage.
Pulse width modulationĐiều chế độ rộng xung
A digital signal that varies its time at the high level to give an analog-like effect.
Duty cycleChu kỳ làm việc
The fraction of one cycle for which a signal is high, often expressed as a percentage.
Pulse counterBộ đếm xung
A hardware block that counts rising or falling edges of a signal.
EdgeSườn xung
The moment a signal goes from low to high (rising edge) or high to low (falling edge).

This article is not marked as viewed

Spotted something wrong or unsafe?

Tell the administrator by email. The message already has the article title and address.

Report this article
  • An industrial controller is cabled to a DIN-rail measurement meter on a test bench.
    Starter

    Overview of UART, RS-485 and Modbus RTU

    An overview of three layers of serial communication: UART frames the data, RS-485 carries differential signals far, and Modbus RTU asks by address.

    Internet of Things (IoT)4 min read
  • Two microcontroller boards connect through breadboard jumpers, with an oscilloscope behind them.
    Basic

    How Does UART Transmit a Byte?

    UART sends serial data without an external clock. See the TX and RX pins, the frame of start, data and stop bits, and what the baud rate means.

    Internet of Things (IoT)4 min read
  • Three measurement modules connect along one shared red-and-black twisted-pair cable.
    Basic

    How Does RS-485 Transmit Differential Signals?

    RS-485 sends signals over two wires and compares the voltage between them, so it resists noise, reaches far and lets many devices share one line.

    Internet of Things (IoT)4 min read
  • An industrial controller and a DIN-rail digital meter are connected by cable on a test bench.
    Basic

    How Does Modbus RTU Exchange Data?

    Modbus RTU works by request and response between a master and slaves. See addresses, function codes, error checks and how frames are split by silent gaps.

    Internet of Things (IoT)4 min read
See all articles of the topic

Sources

These sources are written for older readers. If they feel hard, read them with an adult.