Tutorial 12 - Read the value of a potentiometer using the Arduino's built-in ADC - ADA031-V5.0
Adeept · Uploaded · 2:22 · Watch on YouTube
Adeept's lesson explains how rotary potentiometers work as voltage dividers and how the Arduino's ADC turns them into digital readings. It walks through an example program that prints the five potentiometer values to the serial monitor and an OLED screen, as groundwork for arm control.
Transcript
Captions as a .vtt fileEmbed with the transcript
- 0:04This lesson introduces rotary potentiometers and demonstrates how to use them with an example
- 0:10program. Required components, robotic arm control board, USB cable, OLED screen.
- 0:21A potentiometer is essentially a variable resistor working based on the voltage divider
- 0:26principle. Turning the knob or sliding the wiper changes the resistance in the circuit
- 0:32and outputs different voltages. The built-in ADC of Arduino converts the sampled voltage into a
- 0:39digital value. The ADC on Arduino Uno is normally 10-bit, so the value ranges from 0 to 1023.
- 0:47Five rotary potentiometers are integrated on our Adeept robotic arm control board.
- 0:52They are connected to microcontroller pins A0, A1, A2, A3, and A6 respectively.
- 1:00Let's start the demonstration. First, plug the OLED into the controller board,
- 1:12then connect the controller board to your computer with a USB cable.
- 1:17Next, open the example code. Select the board type and serial port,
- 1:27then upload the program to the control board. After successful upload, open the serial monitor
- 1:43and observe the OLED screen. When you turn any potentiometer, you will see its value change
- 1:49between 0 and 1023. Code principle, initialize the OLED screen. Inside the loop, read the position
- 2:03values of the five rotary potentiometers in real-time, then print the data via serial port
- 2:09and output it to the OLED screen. Mastering the control principle of potentiometers will help you
- 2:15learn the later lesson about controlling the robotic arm with potentiometers.
การสนทนา
อีเมลแจ้งเมื่อมีคนแสดงความคิดเห็น ไม่ต้องมีบัญชี
จดหมายข่าว
สมัครรับจดหมายข่าวฟรีของเรา พร้อมหุ่นยนต์รุ่นใหม่ ราคา และข่าวสารด้านหุ่นยนต์