{"id":1834,"date":"2025-06-18T15:37:16","date_gmt":"2025-06-18T15:37:16","guid":{"rendered":"https:\/\/learnbydoing.dev\/?p=1834"},"modified":"2026-01-10T22:45:57","modified_gmt":"2026-01-10T22:45:57","slug":"how-to-use-a-potentiometer-with-arduino","status":"publish","type":"post","link":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/","title":{"rendered":"How to use a Potentiometer with Arduino"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"1834\" class=\"elementor elementor-1834\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e28ab35 e-flex e-con-boxed e-con e-parent\" data-id=\"e28ab35\" data-element_type=\"container\" data-e-type=\"container\" id=\"content\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-62ab6e3 e-con-full e-flex e-con e-child\" data-id=\"62ab6e3\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-62ab203 elementor-align-center elementor-widget elementor-widget-post-info\" data-id=\"62ab203\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-2c98363 elementor-inline-item\" itemprop=\"about\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-terms\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-post-info__terms-list\">\n\t\t\t\t<span class=\"elementor-post-info__terms-list-item\">Arduino<\/span>, <span class=\"elementor-post-info__terms-list-item\">Electronics<\/span>, <span class=\"elementor-post-info__terms-list-item\">Tutoriales<\/span>\t\t\t\t<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-0650e10 e-con-full e-flex e-con e-child\" data-id=\"0650e10\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ac19582 elementor-view-default elementor-widget elementor-widget-icon\" data-id=\"ac19582\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"75\" height=\"75\" viewbox=\"0 0 75 75\" fill=\"none\"><path d=\"M74.9999 75H13.1889V73.0002H71.5859L0.460938 1.87521L1.87515 0.460999L73.0001 71.586V13.1889H74.9999V75Z\" fill=\"white\"><\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-47aa245d e-flex e-con-boxed e-con e-parent\" data-id=\"47aa245d\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-206a001 elementor-widget elementor-widget-image\" data-id=\"206a001\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1920\" height=\"1080\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp\" class=\"attachment-full size-full wp-image-2046\" alt=\"\" srcset=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp 1920w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1-300x169.webp 300w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1-1024x576.webp 1024w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1-768x432.webp 768w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1-1536x864.webp 1536w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1-18x10.webp 18w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4bc31ca3 elementor-widget elementor-widget-text-editor\" data-id=\"4bc31ca3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In the world of robotics and electronics, sensors and input devices play a crucial role in allowing machines to interact with their environment. Among the simplest and most versatile components is the <strong data-start=\"459\" data-end=\"476\">potentiometer<\/strong> \u2014 an inexpensive and reliable device that allows manual voltage adjustment.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-12a4ca0 elementor-widget elementor-widget-text-editor\" data-id=\"12a4ca0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\">\ud83d\udd0d What is a Potentiometer?<\/h3><p data-start=\"547\" data-end=\"1045\">A <strong data-start=\"934\" data-end=\"951\">potentiometer<\/strong> is a variable resistor with three terminals, whose resistance value can be adjusted by rotating a knob or sliding a control. It\u2019s one of the most common input devices, often used in volume controls, light dimmers, joysticks, and various adjustment systems.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c983314 elementor-widget elementor-widget-text-editor\" data-id=\"c983314\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\">\ud83d\udcd1 How it Works<\/h3><p data-start=\"1231\" data-end=\"1502\">Inside a potentiometer is a <strong data-start=\"1259\" data-end=\"1278\">resistive track<\/strong> and a <strong data-start=\"1285\" data-end=\"1294\">wiper<\/strong> (a movable contact). By connecting the two outer pins to a reference voltage (typically 0V and 5V) and taking the signal from the center pin, you can get a variable voltage depending on the wiper\u2019s position.<\/p><p data-start=\"1504\" data-end=\"1656\">This voltage is read by the Arduino via an analog input pin and converted into a digital value using its built-in <strong data-start=\"1618\" data-end=\"1655\">ADC (Analog to Digital Converter)<\/strong>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e625dc8 elementor-widget elementor-widget-image\" data-id=\"e625dc8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"1152\" height=\"648\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione.gif\" class=\"attachment-full size-full wp-image-2025\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-324d52d elementor-widget elementor-widget-text-editor\" data-id=\"324d52d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\">\u00a0\ud83d\udcdd Required Components<\/h3><ul><li data-start=\"1737\" data-end=\"1780\"><p data-start=\"1739\" data-end=\"1780\">1 x <strong data-start=\"1743\" data-end=\"1758\">Arduino Uno<\/strong> (or compatible board)<br \/><br \/><\/p><\/li><li data-start=\"1781\" data-end=\"1823\"><p data-start=\"1783\" data-end=\"1823\">1 x <strong data-start=\"1787\" data-end=\"1804\">potentiometer<\/strong> (10k\u03a9 recommended)<br \/><br \/><\/p><\/li><li data-start=\"1824\" data-end=\"1838\"><p data-start=\"1826\" data-end=\"1838\">Breadboard<br \/><br \/><\/p><\/li><li data-start=\"1839\" data-end=\"1855\"><p data-start=\"1841\" data-end=\"1855\">Jumper wires<br \/><br \/><\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fe69a81 elementor-widget elementor-widget-text-editor\" data-id=\"fe69a81\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2 data-start=\"2039\" data-end=\"2065\">\ud83d\udd0c Wiring Diagram<\/h2><table class=\"w-fit min-w-(--thread-content-width)\" data-start=\"1987\" data-end=\"2129\"><thead data-start=\"1987\" data-end=\"2014\"><tr data-start=\"1987\" data-end=\"2014\"><th data-start=\"1987\" data-end=\"2003\" data-col-size=\"sm\">Potentiometer<\/th><th data-start=\"2003\" data-end=\"2014\" data-col-size=\"sm\">Arduino<\/th><\/tr><\/thead><tbody data-start=\"2043\" data-end=\"2129\"><tr data-start=\"2043\" data-end=\"2071\"><td data-start=\"2043\" data-end=\"2060\" data-col-size=\"sm\">Pin 1 (VCC)<\/td><td data-col-size=\"sm\" data-start=\"2060\" data-end=\"2071\">5V<\/td><\/tr><tr data-start=\"2072\" data-end=\"2100\"><td data-start=\"2072\" data-end=\"2089\" data-col-size=\"sm\">Pin 2 (OUT)<\/td><td data-col-size=\"sm\" data-start=\"2089\" data-end=\"2100\">A0<\/td><\/tr><tr data-start=\"2101\" data-end=\"2129\"><td data-start=\"2101\" data-end=\"2118\" data-col-size=\"sm\">Pin 3 (GND)<\/td><td data-col-size=\"sm\" data-start=\"2118\" data-end=\"2129\">GND<\/td><\/tr><\/tbody><\/table>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1bda844 elementor-widget elementor-widget-image\" data-id=\"1bda844\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-1024x576.webp\" class=\"attachment-large size-large wp-image-2614\" alt=\"\" srcset=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-1024x576.webp 1024w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-300x169.webp 300w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-768x432.webp 768w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-1536x864.webp 1536w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-18x10.webp 18w, https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro.webp 1920w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e1ef5c9 elementor-widget elementor-widget-text-editor\" data-id=\"e1ef5c9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3 data-start=\"1857\" data-end=\"1885\">\ud83d\udce6 Complete Arduino Code<\/h3><p data-start=\"1922\" data-end=\"2017\">Here\u2019s the code to read the potentiometer\u2019s value and display it in the Serial Monitor:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1ba2cef elementor-widget elementor-widget-code-highlight\" data-id=\"1ba2cef\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>\/\/ Define the pin connected to the potentiometer\r\nconst int potPin = A0;\r\n\r\n\/\/ Variable to store the analog reading\r\nint potValue = 0;\r\n\r\nvoid setup() {\r\n  \/\/ Initialize serial communication\r\n  Serial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ Read the analog value from the potentiometer\r\n  potValue = analogRead(potPin);\r\n  \r\n  \/\/ Print the value to the Serial Monitor\r\n  Serial.print(\"Potentiometer Value: \");\r\n  Serial.println(potValue);\r\n  \r\n  \/\/ Wait 200 milliseconds before the next reading\r\n  delay(200);\r\n}\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7a888ec elementor-widget elementor-widget-text-editor\" data-id=\"7a888ec\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3><b>\ud83d\udd0e\u00a0<\/b><b>Breaking down the Code<\/b><\/h3><p>Let\u2019s review the code section by section:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-455a2f8 elementor-widget elementor-widget-text-editor\" data-id=\"455a2f8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h5 data-start=\"1857\" data-end=\"1885\">Variable Declarations<\/h5><p data-start=\"3014\" data-end=\"3024\">We define:<\/p><ul data-start=\"3025\" data-end=\"3131\"><li data-start=\"3025\" data-end=\"3084\"><p data-start=\"3027\" data-end=\"3084\"><code data-start=\"3027\" data-end=\"3035\">potPin<\/code> \u2192 the analog pin connected to the potentiometer.<\/p><\/li><li data-start=\"3085\" data-end=\"3131\"><p data-start=\"3087\" data-end=\"3131\"><code data-start=\"3087\" data-end=\"3097\">potValue<\/code> \u2192 a variable to hold the reading.<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-01f8801 elementor-widget elementor-widget-code-highlight\" data-id=\"01f8801\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>const int potPin = A0;\r\nint potValue = 0;\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8141c6a elementor-widget elementor-widget-text-editor\" data-id=\"8141c6a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h5 data-start=\"1857\" data-end=\"1885\">Setup Function<\/h5>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6503883 elementor-widget elementor-widget-code-highlight\" data-id=\"6503883\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>void setup() {\r\n  Serial.begin(9600);\r\n}\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2547d99 elementor-widget elementor-widget-text-editor\" data-id=\"2547d99\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3215\" data-end=\"3287\">In the <code data-start=\"3222\" data-end=\"3231\">setup()<\/code> function, which runs once when the board is powered on:<\/p><ul data-start=\"3288\" data-end=\"3439\"><li data-start=\"3288\" data-end=\"3439\"><p data-start=\"3290\" data-end=\"3439\">We initialize serial communication at <strong data-start=\"3328\" data-end=\"3341\">9600 baud<\/strong>, necessary for sending data to the computer and viewing it in the <strong data-start=\"3408\" data-end=\"3438\">Arduino IDE Serial Monitor<\/strong>.<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bdbed67 elementor-widget elementor-widget-text-editor\" data-id=\"bdbed67\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h5 data-start=\"1857\" data-end=\"1885\">Main Loop<\/h5>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d361b1c elementor-widget elementor-widget-code-highlight\" data-id=\"d361b1c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>potValue = analogRead(potPin);<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b51cf90 elementor-widget elementor-widget-text-editor\" data-id=\"b51cf90\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-start=\"3514\" data-end=\"3644\">This reads the voltage from the analog pin <code data-start=\"3557\" data-end=\"3561\">A0<\/code>. The <code data-start=\"3567\" data-end=\"3581\">analogRead()<\/code> function returns an integer between <strong data-start=\"3618\" data-end=\"3623\">0<\/strong> and <strong data-start=\"3628\" data-end=\"3636\">1023<\/strong>, where:<\/p><ul data-start=\"3645\" data-end=\"3691\"><li data-start=\"3645\" data-end=\"3666\"><p data-start=\"3647\" data-end=\"3666\"><strong data-start=\"3647\" data-end=\"3652\">0<\/strong> represents 0V<\/p><\/li><li data-start=\"3667\" data-end=\"3691\"><p data-start=\"3669\" data-end=\"3691\"><strong data-start=\"3669\" data-end=\"3677\">1023<\/strong> represents 5V<\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-85beade elementor-widget elementor-widget-code-highlight\" data-id=\"85beade\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>Serial.print(\"Potentiometer Value: \");\r\nSerial.println(potValue);\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8c151f2 elementor-widget elementor-widget-text-editor\" data-id=\"8c151f2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Sends the value to the <strong data-start=\"3797\" data-end=\"3815\">Serial Monitor<\/strong>, preceded by a descriptive label.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b11d22b elementor-widget elementor-widget-code-highlight\" data-id=\"b11d22b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard\">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-cpp line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-cpp\">\n\t\t\t\t\t<xmp>delay(200);\r\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e7a0dfa elementor-widget elementor-widget-text-editor\" data-id=\"e7a0dfa\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Pauses the program for <strong data-start=\"3902\" data-end=\"3922\">200 milliseconds<\/strong> before the next reading, making the data stream easier to follow.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c92ae44 elementor-widget elementor-widget-text-editor\" data-id=\"c92ae44\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>\ud83d\udda5\ufe0f Viewing the Data<\/h3><p data-start=\"4020\" data-end=\"4055\">To monitor the values in real-time:<br \/><br \/><\/p><ol data-start=\"4056\" data-end=\"4296\"><li data-start=\"4056\" data-end=\"4097\"><p data-start=\"4059\" data-end=\"4097\">Upload the code to your Arduino board.<br \/><br \/><\/p><\/li><li data-start=\"4098\" data-end=\"4179\"><p data-start=\"4101\" data-end=\"4179\">Open the <strong data-start=\"4110\" data-end=\"4128\">Serial Monitor<\/strong> from the Arduino IDE (<strong data-start=\"4151\" data-end=\"4177\">Tools &gt; Serial Monitor<\/strong>).<br \/><br \/><\/p><\/li><li data-start=\"4180\" data-end=\"4213\"><p data-start=\"4183\" data-end=\"4213\">Set the baud rate to <strong data-start=\"4204\" data-end=\"4212\">9600<\/strong>.<br \/><br \/><\/p><\/li><li data-start=\"4214\" data-end=\"4296\"><p data-start=\"4217\" data-end=\"4296\">Turn the potentiometer knob and watch the values change from <strong data-start=\"4278\" data-end=\"4283\">0<\/strong> to <strong data-start=\"4287\" data-end=\"4295\">1023<\/strong>.<br \/><br \/><\/p><\/li><\/ol>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>In the world of robotics and electronics, sensors and input devices play a crucial role in allowing machines to interact with their environment. Among the simplest and most versatile components is the potentiometer \u2014 an inexpensive and reliable device that allows manual voltage adjustment. \ud83d\udd0d What is a Potentiometer? A potentiometer is a variable resistor [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2046,"comment_status":"closed","ping_status":"open","sticky":false,"template":"elementor_header_footer","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[68,69,43],"tags":[95,94,59,84,67,83,87,82,66,91,93,92,64],"class_list":["post-1834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-electronics","category-tutorials","tag-adc","tag-analog","tag-arduino","tag-c","tag-complete","tag-cpp","tag-guide","tag-ide","tag-learn-by-doing","tag-potentiometer","tag-resistance","tag-resistor","tag-tutorial"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to use a Potentiometer with Arduino - Learn by Doing!<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Installing ROS 2 Jazzy on Ubuntu 24.04: Step-by-Step Tutorial\" \/>\n<meta property=\"og:description\" content=\"In the world of robotics and electronics, sensors and input devices play a crucial role in allowing machines to interact with their environment. Among the simplest and most versatile components is the potentiometer \u2014 an inexpensive and reliable device that allows manual voltage adjustment. \ud83d\udd0d What is a Potentiometer? A potentiometer is a variable resistor [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn by Doing!\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-18T15:37:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-10T22:45:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Progetto-senza-titolo-14.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"How to use a Potentiometer with Arduino\",\"datePublished\":\"2025-06-18T15:37:16+00:00\",\"dateModified\":\"2026-01-10T22:45:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/\"},\"wordCount\":381,\"publisher\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp\",\"keywords\":[\"adc\",\"analog\",\"Arduino\",\"c++\",\"complete\",\"cpp\",\"Guide\",\"ide\",\"learn by doing\",\"potentiometer\",\"resistance\",\"resistor\",\"tutorial\"],\"articleSection\":[\"Arduino\",\"Electronics\",\"Tutorials\"],\"inLanguage\":\"es\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/\",\"url\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/\",\"name\":\"How to use a Potentiometer with Arduino - Learn by Doing!\",\"isPartOf\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp\",\"datePublished\":\"2025-06-18T15:37:16+00:00\",\"dateModified\":\"2026-01-10T22:45:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage\",\"url\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp\",\"contentUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learnbydoing.dev\/es\/learn-by-doing-es\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use a Potentiometer with Arduino\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#website\",\"url\":\"https:\/\/learnbydoing.dev\/es\/\",\"name\":\"Learn by Doing!\",\"description\":\"Learn Robotics the fun way\",\"publisher\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnbydoing.dev\/es\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#organization\",\"name\":\"Learn by Doing!\",\"url\":\"https:\/\/learnbydoing.dev\/es\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png\",\"contentUrl\":\"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png\",\"width\":512,\"height\":512,\"caption\":\"Learn by Doing!\"},\"image\":{\"@id\":\"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/antonio-brandi-512166bb\/\"]},{\"@type\":\"Person\",\"@id\":\"\",\"url\":\"https:\/\/learnbydoing.dev\/es\/author\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use a Potentiometer with Arduino - Learn by Doing!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino\/","og_locale":"es_ES","og_type":"article","og_title":"Installing ROS 2 Jazzy on Ubuntu 24.04: Step-by-Step Tutorial","og_description":"In the world of robotics and electronics, sensors and input devices play a crucial role in allowing machines to interact with their environment. Among the simplest and most versatile components is the potentiometer \u2014 an inexpensive and reliable device that allows manual voltage adjustment. \ud83d\udd0d What is a Potentiometer? A potentiometer is a variable resistor [&hellip;]","og_url":"https:\/\/learnbydoing.dev\/es\/how-to-use-a-potentiometer-with-arduino\/","og_site_name":"Learn by Doing!","article_published_time":"2025-06-18T15:37:16+00:00","article_modified_time":"2026-01-10T22:45:57+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Progetto-senza-titolo-14.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"","Tiempo de lectura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#article","isPartOf":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/"},"author":{"name":"","@id":""},"headline":"How to use a Potentiometer with Arduino","datePublished":"2025-06-18T15:37:16+00:00","dateModified":"2026-01-10T22:45:57+00:00","mainEntityOfPage":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/"},"wordCount":381,"publisher":{"@id":"https:\/\/learnbydoing.dev\/es\/#organization"},"image":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage"},"thumbnailUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp","keywords":["adc","analog","Arduino","c++","complete","cpp","Guide","ide","learn by doing","potentiometer","resistance","resistor","tutorial"],"articleSection":["Arduino","Electronics","Tutorials"],"inLanguage":"es"},{"@type":"WebPage","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/","url":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/","name":"How to use a Potentiometer with Arduino - Learn by Doing!","isPartOf":{"@id":"https:\/\/learnbydoing.dev\/es\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage"},"image":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage"},"thumbnailUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp","datePublished":"2025-06-18T15:37:16+00:00","dateModified":"2026-01-10T22:45:57+00:00","breadcrumb":{"@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#primaryimage","url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp","contentUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/Potenziometro-Animazione-1.webp","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/learnbydoing.dev\/how-to-use-a-potentiometer-with-arduino\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learnbydoing.dev\/es\/learn-by-doing-es\/"},{"@type":"ListItem","position":2,"name":"How to use a Potentiometer with Arduino"}]},{"@type":"WebSite","@id":"https:\/\/learnbydoing.dev\/es\/#website","url":"https:\/\/learnbydoing.dev\/es\/","name":"Learn by Doing!","description":"Learn Robotics the fun way","publisher":{"@id":"https:\/\/learnbydoing.dev\/es\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnbydoing.dev\/es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/learnbydoing.dev\/es\/#organization","name":"Learn by Doing!","url":"https:\/\/learnbydoing.dev\/es\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/","url":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png","contentUrl":"https:\/\/learnbydoing.dev\/wp-content\/uploads\/2025\/06\/cropped-cropped-cropped-Progetto-senza-titolo-6-1.png","width":512,"height":512,"caption":"Learn by Doing!"},"image":{"@id":"https:\/\/learnbydoing.dev\/es\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/antonio-brandi-512166bb\/"]},{"@type":"Person","@id":"","url":"https:\/\/learnbydoing.dev\/es\/author\/"}]}},"_links":{"self":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/1834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/comments?post=1834"}],"version-history":[{"count":25,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/1834\/revisions"}],"predecessor-version":[{"id":5628,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/posts\/1834\/revisions\/5628"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/media\/2046"}],"wp:attachment":[{"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/media?parent=1834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/categories?post=1834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnbydoing.dev\/es\/wp-json\/wp\/v2\/tags?post=1834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}