Build an Arduino Data Diary

Simulate an Arduino potentiometer and document live analog data in Markdown.

Introduction

30 Second Summary

Sensor readings often arrive as a stream of numbers with no obvious meaning. Without a record of what changed, useful experiments are easy to forget.

In this project, you will build a browser-based Arduino data reader in Wokwi that turns analog input into live output. You will also create a Markdown diary that preserves each test as part of your learning journey.

What You'll Build

Turn a virtual knob to watch raw readings become clear voltage values in the Serial Monitor while your local diary preserves the experiment.

By the end of this project, you'll have:

  • Turn a virtual knob to see the raw sensor reading respond immediately in the Serial Monitor.
  • Interpret the same input as a voltage from approximately 0.00 to 5.00 V.
  • Run a three-position test that preserves low, middle, and high results in arduino-data-diary.md.
  • Secret Mission: add a 10-sample running average that reveals the difference between responsive raw data and smoother output.

Are there any prerequisites?

You need a Windows computer with an internet connection. You do not need physical Arduino hardware or previous Arduino setup.

Before We Start

This is your moment to lock in what you are building before the hands-on work begins. You will connect the data you plan to read with the reason you want to document it.

Set Up the Simulator and Data Diary

A first Arduino experiment can stall during physical board setup. Wokwi moves the circuit into your browser so you can focus on the data.

Each experiment also needs a permanent record. A Markdown diary in Windows Notepad gives your observations a place to grow.

In this step, get ready to:
  • Create an Arduino Uno Rev3 project in Wokwi.
  • Connect a Wokwi Potentiometer to the simulated board.
  • Save a blank data diary in Windows Notepad.
Start the Wokwi project

The Wokwi launcher in Microsoft Edge lists boards that run in your browser.

  • Press the Windows key to open Windows search.

You should see the Windows search panel.

  • Type Microsoft Edge into the search box.
  • Press Enter to open Microsoft Edge.
  • Enter https://wokwi.com/projects/new in the address bar.
  • Press Enter to load the Wokwi project launcher.
  • Select Arduino Uno Rev3 under the Arduino projects.

Good start. Your simulator now has the board that drives every reading in this project.

The unchanged sketch.ino starter file should appear beside the canvas.

Why Use Wokwi Here?

A physical Arduino setup depends on hardware before the first reading.

Wokwi keeps the circuit-to-sketch workflow in your browser. That puts your attention on the data pipeline.

Project Page Not Loading?

  • Confirm that your internet connection is active.
  • Reload https://wokwi.com/projects/new in Microsoft Edge.

If the launcher still does not appear, help me diagnose why the Wokwi project page is not loading.

Wire the potentiometer

A potentiometer turns knob position into an analog input. Its signal changes as you rotate the virtual knob.

  • Click the add-part control above the Wokwi diagram editor.

You should see a list of available parts.

  • Search the parts list for Wokwi Potentiometer.
  • Select Wokwi Potentiometer from the results.

You should see the Wokwi Potentiometer beside the Arduino Uno Rev3.

What Do the Pins Do?

  • The SIG pin carries the changing signal to A0.
  • The VCC pin connects the potentiometer to 5V.
  • The GND pin completes the circuit's ground connection.

The board labels are small, so this wiring can feel fiddly on the first pass.

  • Click the potentiometer's SIG pin.
  • Click the Arduino Uno Rev3 A0 pin.

You should see one wire between SIG and A0.

  • Click the potentiometer's VCC pin.
  • Click the Arduino Uno Rev3 5V pin.

You should see a second wire between VCC and 5V.

  • Click the potentiometer's GND pin.
  • Click a GND pin on the Arduino Uno Rev3.

That's the wiring complete. The canvas should now show three wires.

Wire Connected to the Wrong Pin?

  • Select the misplaced wire.
  • Press the Delete key.
  • Reconnect the affected pair of pins.

If a connection still looks wrong, help me check my Wokwi potentiometer wiring.

Save the data diary

The diary is a blank Markdown file at this stage. Its filename gives later observations a stable home.

  • Press the Windows key to open Windows search.

You should see the Windows search panel.

  • Type Notepad into the search box.
  • Select Notepad from the results.

You should see a blank Notepad document.

  • Click File in the Notepad menu.
  • Select Save As.

The Save As window lets you choose the diary's location.

  • Select Desktop as the save location.
  • Enter arduino-data-diary.md in the File name box.

The filename should end with .md.

  • Select All files (*.*) from Save as type.
  • Click Save.

Your blank diary is saved. You should see arduino-data-diary.md in the Notepad title bar.

✔️ Awesome, I've got everything!

Great. Keep arduino-data-diary.md blank for this setup step.

ⓧ I'd like to double check the full code

The arduino-data-diary.md file contains no text in this step. A blank file is the exact target state.

The unchanged sketch.ino file should match this starter sketch.

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

The comments mark the two places where later code will run. Keeping both functions unchanged preserves the starting point for the next step.

Filename Ends with .txt?

A title bar showing arduino-data-diary.md.txt means Notepad added its default file extension.

  • Click File in the Notepad menu.
  • Select Save As.
  • Select All files (*.*) from Save as type.
  • Save the file again as arduino-data-diary.md.

If the extension still changes, help me save the Markdown file with its exact name.

Before you check, picture the three wires that should be on the canvas. Picture the filename that should appear in Notepad.

  • Switch back to Microsoft Edge from earlier.
  • Inspect the Wokwi canvas.

You should see an Arduino Uno Rev3 beside a Wokwi Potentiometer. The three wires should match the connections you checked above.

  • Switch back to Windows Notepad.
  • Inspect the Notepad title bar.

You should see arduino-data-diary.md as the filename.

Your simulator workspace and data diary are ready. Next, you'll make the potentiometer produce live readings in the Serial Monitor.

Read Your First Live Data

Your Wokwi circuit from the previous step can now deliver a changing signal to A0. The Arduino sketch still contains only starter code, so the circuit cannot report what it reads.

In this step, you'll sample the analog input every 100 milliseconds through Serial communication.

A changing stream of raw values proves the input pipeline works. Their meaning remains unexplained until you add context in the next step.

In this step, get ready to:
  • Replace the starter sketch with an analog-reading loop.
  • Run the simulation to produce raw readings in the Serial Monitor.
  • Turn the virtual potentiometer to test the full input range.
Create the raw data sketch

The setup() function prepares serial output once. The loop() function repeatedly reads the potentiometer.

  • Switch back to Microsoft Edge with Wokwi from the previous step.
  • Select sketch.ino in the project file list.
  • Click inside the code editor.
  • Select the starter code by pressing Ctrl+A.
  • Replace the selected code by pasting this sketch:
void setup() {
  Serial.begin(9600);
}

void loop() {
  int rawValue = analogRead(A0);
  Serial.println(rawValue);

  delay(100);
}

What does this sketch do?

  • The setup() function runs once when the simulation starts.
  • The Serial.begin(9600); line prepares the serial connection.
  • The rawValue variable holds the integer returned by analogRead(A0).
  • The Serial.println(rawValue); line sends each reading to the Serial Monitor on a new line.
  • The delay(100); line leaves a short gap between samples so the stream remains readable.

Before you start the simulation, do you expect to see one reading or a continuing stream of readings?

  • Start the simulation with the play control above the circuit canvas.

You'll see the Serial Monitor open after the first output. It shows the current potentiometer reading repeatedly.

That repeated output is your first visible win. Your loop() function is running continuously.

No readings in the Serial Monitor?

  • Confirm that the simulation is still running.
  • Check that sketch.ino contains the complete sketch shown above.
  • Check that each opening brace has a matching closing brace.

Help me find why my Wokwi Serial Monitor is not showing raw values.

✔️ Awesome, I've got everything!

Your sketch.ino file now reads A0 and prints each result.

ⓧ I'd like to double check the full code

  • Compare your complete sketch.ino file with this reference:
void setup() {
  Serial.begin(9600);
}

void loop() {
  int rawValue = analogRead(A0);
  Serial.println(rawValue);

  delay(100);
}
Test the potentiometer range

The Arduino Uno Rev3 uses analog-to-digital conversion with a 10-bit result. This produces integer readings from 0 to 1023.

Before you turn the knob, what do you expect the reading to do as you move from minimum to maximum?

  • Turn the virtual potentiometer near its minimum position.

You should see readings at or near 0.

  • Move the virtual potentiometer to its midpoint.

You should see the readings settle around the middle of the available range.

  • Turn the virtual potentiometer near its maximum position.

You should see readings at or near 1023.

  • Sweep the virtual potentiometer through several positions.

The Serial Monitor should show changing integer readings across the 0 to 1023 range. The values update as you move the knob.

Readings not changing?

  • Confirm that the simulation is running while you move the potentiometer.
  • Check that the potentiometer's SIG connection ends at A0.
  • Check that analogRead(A0) uses the same pin as the circuit.

Help me debug a fixed potentiometer reading in Wokwi.

The live stream contains bare integers with no label or unit. That shortfall is intentional because it shows exactly what the data still needs.

You have live sensor data flowing from the potentiometer into the Serial Monitor. Next, you'll label those readings and convert them into voltage.

Convert Readings to Voltage

The potentiometer now drives a live stream of raw readings in the Wokwi Serial Monitor. That working stream proves your analog input pipeline is reading every knob movement.

Those raw numbers have no unit. The Arduino Uno Rev3 uses an analog-to-digital converter to map its input across 0 to 1023.

In this step, you'll convert each reading into volts. Clear labels will make every line easier to interpret.

In this step, get ready to:
  • Define the constants used by the voltage conversion.
  • Calculate voltage from each raw reading.
  • Display labeled raw readings with calculated voltage.
Define the conversion constants

Named constants give each conversion value a clear purpose. They also keep hardware assumptions in one place.

  • In the Wokwi project already open in Microsoft Edge, stop the running simulation with the control above the diagram.
  • Add the conversion constants above void setup() in sketch.ino by pasting this code:
const int sensorPin = A0;
const float referenceVoltage = 5.0;
const float adcMaximum = 1023.0;
const int sampleDelayMs = 500;

What Do These Constants Control?

  • sensorPin identifies A0 as the source of each analog reading.
  • referenceVoltage stores the simulated 5.0 volt reference used by the conversion.
  • adcMaximum stores the highest value produced by the 10-bit converter.
  • sampleDelayMs sets a 500 millisecond pause. This produces two readings per second.
  • Use the save control above the Wokwi editor to save sketch.ino.
  • Restart the simulation with the control above the diagram.

You'll see raw integer readings resume in the Serial Monitor.

Good progress. Your sketch now compiles with reusable conversion settings.

Raw Readings Not Resuming?

Confirm that all four constants sit above void setup(). Compare every value against the code block before restarting the simulation.

Check that the previous setup() function still starts serial communication at 9600.

Help me check why the sketch stopped producing raw readings.

Convert each reading to labeled voltage

The conversion multiplies the raw reading by the voltage represented by one ADC step. The output can then show the original reading beside its voltage.

  • Stop the current simulation with the control above the diagram.
  • Replace the existing loop() function in sketch.ino by pasting this code over it:
void loop() {
  int rawValue = analogRead(sensorPin);
  float voltage = rawValue * (referenceVoltage / adcMaximum);

  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage);
  Serial.println(" V");

  delay(sampleDelayMs);
}

What Does This Code Do?

  • analogRead(sensorPin) collects the current 10-bit sample from A0.
  • voltage scales the raw sample using the reference voltage divided by the ADC maximum.
  • Serial.print() keeps the labels plus values on one line. Serial.println() finishes that line after the voltage unit.
  • delay(sampleDelayMs) pauses for 500 milliseconds before the next sample.
  • Use the save control above the Wokwi editor to save sketch.ino.
  • Restart the simulation with the control above the diagram.

You'll see each line begin with Raw:. The calculated result appears after Voltage:.

That completes the conversion path. Your Serial Monitor now explains what each potentiometer reading represents.

Missing Labels or Voltage?

Confirm that you replaced the entire previous loop() function. A leftover Serial.println(rawValue) line can produce an extra unlabeled value.

Check that the calculation uses referenceVoltage divided by adcMaximum inside parentheses.

Help me debug my labeled raw and voltage output.

✔️ Awesome, I've got everything!

Your saved sketch.ino now contains the conversion constants plus the labeled output logic.

ⓧ I'd like to double check the full code

  • Compare sketch.ino with this complete reference:
const int sensorPin = A0;
const float referenceVoltage = 5.0;
const float adcMaximum = 1023.0;
const int sampleDelayMs = 500;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int rawValue = analogRead(sensorPin);
  float voltage = rawValue * (referenceVoltage / adcMaximum);

  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage);
  Serial.println(" V");

  delay(sampleDelayMs);
}

How the Full Sketch Fits Together

The constants describe the simulated analog environment. The two functions use those settings to sample the potentiometer.

Each loop cycle converts one raw reading. It prints the labeled result before waiting for the next sample.

Sweep the potentiometer

A full sweep tests both ends of the conversion. It also reveals whether the raw reading tracks the calculated voltage.

Before you move the knob, how should both values behave across the sweep?

  • Restart the simulation with the control above the diagram if it has stopped.
  • Turn the virtual potentiometer near its minimum position.
  • Sweep the virtual potentiometer slowly to its maximum position.

Near minimum, you'll see Raw: near 0 with Voltage: near 0.00 V.

Near maximum, you'll see Raw: near 1023 with Voltage: near 5.00 V. A new labeled line appears about twice per second.

You've turned an unexplained stream into readable measurements. Your simulation now reports both the source reading and its physical meaning.

Your live sensor data now has units plus clear labels. Next, you'll preserve a three-position test in arduino-data-diary.md.

Test and Document the Data

Your Wokwi simulation now turns each potentiometer position into a labeled Serial Monitor line. Those live values prove your Arduino Uno Rev3 data pipeline works.

A deliberate three-point test turns a quick demo into evidence. A Markdown diary preserves that evidence for your next experiment.

In this step, get ready to:
  • Capture readings at three potentiometer positions.
  • Build a reusable Arduino data diary.
  • Confirm the saved trend against the live output.
Test three potentiometer positions

An analog-to-digital converter maps the potentiometer input onto the Arduino Uno Rev3 range. Testing three positions reveals the direction of that relationship.

  • Switch back to Microsoft Edge from earlier.
  • Move the virtual potentiometer knob near its minimum position.
  • Read the next complete line in the Serial Monitor.
  • Record the low raw value here: your low raw reading.
  • Record the low voltage here: your low voltage.

Why use three positions?

Three positions expose the direction of the data trend. They also show whether the voltage conversion remains believable across the input range.

  • Move the virtual potentiometer knob near its midpoint.
  • Read the next complete line in the Serial Monitor.
  • Record the middle raw value here: your middle raw reading.
  • Record the middle voltage here: your middle voltage.

The midpoint gives you a comparison between the two ends of the input range.

  • Move the virtual potentiometer knob near its maximum position.
  • Read the next complete line in the Serial Monitor.
  • Record the high raw value here: your high raw reading.
  • Record the high voltage here: your high voltage.

Your raw readings should rise from low to high. The voltage values should follow the same trend.

Build the experiment diary

A reusable diary needs enough context for someone to understand the experiment later. The first sections capture the goal of the test.

  • Switch back to Windows Notepad from earlier.
  • Select the blank editing area in arduino-data-diary.md.
  • Add the experiment context by pasting this block into arduino-data-diary.md:
# Arduino Data Diary

## Experiment

Read a virtual potentiometer with an Arduino Uno Rev3 and interpret the result as voltage.

## Circuit

- Potentiometer SIG to Arduino A0
- Potentiometer VCC to Arduino 5V
- Potentiometer GND to Arduino GND

## Prediction

Turning the potentiometer upward should increase both the raw reading and calculated voltage.

What does this diary section capture?

  • The main heading gives future experiments a consistent home.
  • The experiment section states the goal in one sentence.
  • The circuit section preserves the three wire connections.
  • The prediction records the expected trend before the results are added.
  • Save arduino-data-diary.md by pressing Ctrl+S.
  • Confirm that ## Prediction appears below the circuit list.

Missing the diary heading?

Check that your paste started on the first blank line in Notepad. Undo the paste if it replaced part of another section.

Ask for help if the Markdown structure looks different. Help me check the opening sections of my Arduino data diary.

  • Place the cursor at the end of the prediction sentence.
  • Create one blank line by pressing Enter twice.
  • Add the test table by pasting this block:
## Test Results

| Position | Raw reading | Voltage |
| --- | ---: | ---: |
| Low | Record during testing | Record during testing |
| Middle | Record during testing | Record during testing |
| High | Record during testing | Record during testing |

## What I Changed

1. Read the raw value from A0.
2. Converted the raw value using `rawValue * (5.0 / 1023.0)`.
3. Added labels and a 500 millisecond delay to make the output readable.

How does the table help?

  • The test table keeps each knob position beside its measured values.
  • The right-aligned separators make the numeric columns easier to scan in a Markdown viewer.
  • The change list connects the experiment results to the sketch behavior.
  • Save arduino-data-diary.md by pressing Ctrl+S.
  • Confirm that the High row appears above ## What I Changed.

Does the table look uneven?

Check that every table row starts with a vertical bar. Each row must also finish with a vertical bar.

Use the full diary comparison below if a separator is missing. Help me repair the Markdown table in my Arduino data diary.

  • Place the cursor at the end of the final numbered item.
  • Create one blank line by pressing Enter twice.
  • Add the reflection sections by pasting this block:
## What I Learned

The analog-to-digital converter represents the potentiometer input as a number from 0 to 1023. Converting that number to voltage makes the data easier to interpret.

## Troubleshooting Note

Record one issue you encountered, what caused it, and how you verified the fix.

## Next Experiment

Replace the potentiometer with another analog sensor and reuse the same read, interpret, test, and document workflow.

Why finish with reflection?

  • The learning section explains what the ADC values represent.
  • The troubleshooting section preserves a lesson from the build process.
  • The final section turns this diary into a reusable experiment format.
  • Save arduino-data-diary.md by pressing Ctrl+S.
  • Confirm that the final line begins with Replace the potentiometer.

Missing a reflection section?

Check that the reflection block was pasted below the numbered list. Restore any overwritten heading from the comparison tab.

Ask for help if the section order is unclear. Help me restore the reflection sections in my Arduino data diary.

✔️ Awesome, I've got everything!

Great. Double-check that you saved arduino-data-diary.md before adding your measurements.

ⓧ I'd like to double check the full code

Compare your diary template with the complete arduino-data-diary.md file:

# Arduino Data Diary

## Experiment

Read a virtual potentiometer with an Arduino Uno Rev3 and interpret the result as voltage.

## Circuit

- Potentiometer SIG to Arduino A0
- Potentiometer VCC to Arduino 5V
- Potentiometer GND to Arduino GND

## Prediction

Turning the potentiometer upward should increase both the raw reading and calculated voltage.

## Test Results

| Position | Raw reading | Voltage |
| --- | ---: | ---: |
| Low | Record during testing | Record during testing |
| Middle | Record during testing | Record during testing |
| High | Record during testing | Record during testing |

## What I Changed

1. Read the raw value from A0.
2. Converted the raw value using `rawValue * (5.0 / 1023.0)`.
3. Added labels and a 500 millisecond delay to make the output readable.

## What I Learned

The analog-to-digital converter represents the potentiometer input as a number from 0 to 1023. Converting that number to voltage makes the data easier to interpret.

## Troubleshooting Note

Record one issue you encountered, what caused it, and how you verified the fix.

## Next Experiment

Replace the potentiometer with another analog sensor and reuse the same read, interpret, test, and document workflow.
Record the results and verify the trend

The diary template now has a place for each measurement. Replacing the prompts turns it into evidence from your own simulation run.

  • Replace the Low row placeholder under Raw reading with your low raw reading.
  • Replace the Low row placeholder under Voltage with your low voltage.
  • Replace the Middle row placeholder under Raw reading with your middle raw reading.
  • Replace the Middle row placeholder under Voltage with your middle voltage.
  • Replace the High row placeholder under Raw reading with your high raw reading.
  • Replace the High row placeholder under Voltage with your high voltage.

What should the table show?

The Low row should contain your smallest pair of measurements. The High row should contain your largest pair.

  • Replace the troubleshooting prompt with a note explaining the cause of one issue.
  • Add one sentence explaining how you verified the fix.
  • Save arduino-data-diary.md by pressing Ctrl+S.

Before you rerun the simulation, do you expect the saved low-to-high trend to match the live output?

  • Switch back to Microsoft Edge from earlier.
  • Rerun the Wokwi simulation with the control above the editor.
  • Sweep the virtual potentiometer knob slowly across its full range.

You should see the raw values increase as the knob moves upward. The voltage values should rise in the same direction.

  • Return to arduino-data-diary.md in Notepad.
  • Compare the saved row order with the live trend.

Your Low row should match the smallest live values. Your High row should match the largest live values.

Does the saved trend look wrong?

Check that each measurement was copied from the same Serial Monitor line. Confirm that the three rows follow the physical knob positions.

If a voltage seems unrelated to its raw value, repeat that position before updating the table. Help me compare my Arduino diary readings with the live Serial Monitor trend.

That is a strong finish. Your Arduino data story is now backed by a repeatable experiment.

Secret mission

Smooth the Sensor Data

Raw sensor readings react quickly, which can make the output jump. Add a 10-sample running average so you can compare immediate data with a smoother signal.

Clean Up Your Resources

Clean Up Your Resources

Your simulation and diary can stay available, pause while you step away, or be deleted for a clean slate. Wokwi is free for personal use, so this project's primary path has no ongoing costs.

Resources you used:

  • Wokwi Arduino Uno Rev3 project containing the potentiometer circuit and sketch.ino.
  • Local Markdown diary arduino-data-diary.md saved with Windows Notepad.

Keep everything running

No action is needed. Choose this if you want to continue testing the potentiometer or reuse the project later.

  • Leave the Wokwi project available in the current Microsoft Edge browser for more experiments.
  • Keep arduino-data-diary.md in its saved Windows folder for future Arduino experiments.
  • Return to the Wokwi project using the same Microsoft Edge browser on the same Windows device if you are not signed in.

Pause - I'll come back to this later

Stop the running simulation to free up browser resources. Your project and diary remain available when you return.

  • Stop the running simulation with the same Wokwi simulation control you used earlier.
  • Close the Wokwi project tab in Microsoft Edge.
  • Close the arduino-data-diary.md window in Windows Notepad.

No simulated hardware continues running. Your Wokwi project and local diary stay ready for another session.

Delete - I don't want to use this again

Remove the Wokwi project and local diary to start fresh. This permanently clears the resources created during the project.

  • Stop the running simulation with the Wokwi simulation control.
  • Visit the Wokwi project dashboard in Microsoft Edge to view your saved projects.
  • Find your current Arduino Uno Rev3 project in the saved project list.
  • Use that project's deletion option to remove it.
  • Refresh the Wokwi project dashboard.

You should no longer see the Arduino Uno Rev3 project in the dashboard.

  • Close arduino-data-diary.md in Windows Notepad.
  • Press the Windows key to open Windows search.
  • Type arduino-data-diary.md to locate the saved diary.
  • Right-click the matching search result.
  • Choose the file-location option to reveal its saved folder.
  • Select arduino-data-diary.md in that folder.
  • Press Shift+Delete to remove the diary permanently.
  • Confirm the Windows deletion prompt.

The diary should disappear from its saved folder. Your Wokwi project and local project file are now removed.

Nice Work!

Nice Work!

You did it. Your Arduino data reader in Wokwi now turns a virtual knob into live values you can interpret.

What you learned:

  • Built a simulated Arduino Uno Rev3 circuit with a potentiometer connected to A0. Turning the potentiometer now changes the input immediately.
  • Read live values in the Serial Monitor. Used analog-to-digital conversion to turn 10-bit readings into labeled voltage output.
  • Tested the input at low, middle, and high positions. Preserved the results in a reusable Markdown data diary.
  • Secret Mission: compared responsive raw readings with a smoother 10-sample running average.

Ready to quiz yourself?