0Pricing
Arduino & IoT Academy · Lesson

Digital vs Analog Signals

The difference between on/off and a smooth range.

Digital vs Analog Signals is a free Arduino & IoT Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Two Kinds of Signal

Electronics speak in two languages. A digital signal is simple on or off, while an analog one varies smoothly. Both matter in your projects.

Digital Means On or Off

A digital signal has only two states: HIGH or LOW, like a light switch. There is nothing in between, just yes or no.

Analog Means a Range

An analog signal can be any value across a range, like a dimmer slowly fading a lamp from off to full brightness.

The Real World Is Analog

Temperature, light, and sound never jump between two values. They flow smoothly, so the real world is mostly analog by nature.

Voltage Carries the Value

On an Arduino, an analog reading is really a voltage between 0V and 5V. A higher voltage simply means a higher value.

A Button Is Digital

A push button is the perfect digital input. It is either pressed or not, so you read it as HIGH or LOW with digitalRead.

A Knob Is Analog

A turning potentiometer sends a smoothly changing voltage. Turn it slowly and the value glides, so you read it as analog.

Different Pins for Each

The Uno keeps them separate. Digital pins are labeled D0 to D13, while the analog input pins are labeled A0 to A5.

Two Functions to Read

You match the function to the signal: digitalRead for on or off pins, and analogRead for the smooth analog inputs.

int btn = digitalRead(2);
int knob = analogRead(A0);

Analog Gets Digitized

Your chip cannot truly feel a smooth voltage. An ADC converts that analog voltage into a number the code can use.

Why the Difference Matters

Choosing the right type avoids bugs. Read a sensor with analogRead and a switch with digitalRead, and your data stays correct.

Quick Check

Which input belongs to the analog world?

Recap: Digital vs Analog

You learned that digital is on or off while analog is a smooth range. Buttons are digital, knobs are analog. Match the read function to each.

Frequently asked questions

Is the “Digital vs Analog Signals” lesson free?

Yes — the full text of “Digital vs Analog Signals” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.

What will I learn in “Digital vs Analog Signals”?

The difference between on/off and a smooth range. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Arduino & IoT Academy?

No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Digital vs Analog Signals” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Arduino & IoT Academy lesson?

Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Digital vs Analog Signals
  2. analogRead Returns 0–1023
  3. Read a Potentiometer Knob
  4. map() Values to a New Range
← Back to Arduino & IoT Academy