blog · 26 November 2026
Your first Arduino sketch in de:volt: read a knob and print it to the Serial Monitor
A beginner's walkthrough: wire a potentiometer to an Arduino Uno, write a ten-line sketch, upload it in your browser, and watch the readings in the Serial Monitor and Plotter.
de:volt can now compile and run your own Arduino sketches right in the browser. This walkthrough is for anyone who has never written one. By the end you will have an Arduino reading a knob and reporting its position, live, as you turn it.
You need nothing but a browser. No board, no cables, no software to install.
1. Build the circuit
Open sim.devoltapp.com and start a new circuit. From the parts list, drag in:
- an Arduino UNO R3,
- a breadboard,
- a potentiometer (10 kΩ is perfect).
Push the potentiometer into the breadboard and wire it up with three wires:
- One outer leg to the Uno's 5V pin.
- The other outer leg to a GND pin.
- The middle leg (the wiper) to A0.
Turning the knob now moves the voltage on A0 anywhere between 0 V and 5 V.
2. Write the sketch
Click the Uno to select it and open the Sketch tab in the Inspector on the right. Replace whatever is in the editor with this:
void setup() {
Serial.begin(9600);
}
void loop() {
int raw = analogRead(A0);
float volts = raw * 5.0 / 1023.0;
Serial.print("A0 = ");
Serial.print(raw);
Serial.print(" (");
Serial.print(volts, 2);
Serial.println(" V)");
delay(200);
}Line by line: Serial.begin(9600) opens the serial port at 9600 baud. analogRead(A0) returns a number from 0 to 1023 for 0 V to 5 V. The rest converts that to volts and prints both, five times a second.
3. Upload
Press Upload. de:volt compiles the sketch in your browser with the same compiler the Arduino IDE uses, then flashes it onto the simulated Uno. Underneath the editor you will see how much of the chip's memory your program takes up. (Spoiler: not much.)
If you made a typo, the compiler's error message tells you which line to look at. Fix it and press Upload again.
4. Watch the Serial Monitor
Below the editor, the Serial Monitor fills with lines like:
A0 = 510 (2.49 V)
A0 = 510 (2.49 V)
With the knob in the middle you get about half of 1023. Now turn the potentiometer's knob on the canvas: drag around the knob in a circle. The numbers follow your hand, down towards 0 at one end and up towards 1023 at the other.
Turning the knob selects the potentiometer, so the Inspector switches to the knob's settings. Click the Uno again to get back to your sketch and the Serial Monitor. Everything it printed while you were away is still there.
5. See it as a graph
The Plotter draws numbers instead of printing them. It works best when each line holds just a number, so change the printing part of loop() to:
Serial.println(raw);Upload again, switch the Serial panel from Monitor to Plotter, and sweep the knob back and forth. Click the Uno again and you get a line graph of the knob's position, drawn as it moved.

6. Check it with the oscilloscope
Because de:volt simulates the whole circuit, you can measure it too. Put a scope probe on A0 and compare the voltage on the scope with the one your sketch prints. They agree, because the sketch is reading the very same simulated voltage.
Where to go next
- Use the reading to control something:
analogWrite(9, raw / 4);drives an LED on pin 9 brighter or dimmer with the knob. - Pause your sketch mid-loop and inspect
rawwith the debugger. - Read a real sensor: our weather station project uses a BMP280, a DHT22 and an OLED display.
- Switch to 3D and turn the knob there.