https://github.com/asathiskumar98-byte/esp8266-variable-resistor-potentiometer-adc-reading-micropython
This project demonstrates how to read **analog voltage values** from a **variable resistor (potentiometer)** using the **ADC (Analog-to-Digital Converter)** on the **ESP8266** board with **MicroPython**. The sensor’s analog output is connected to the **A0** pin, and the digital value (0–1024) is printed on the Thonny IDE console.
https://github.com/asathiskumar98-byte/esp8266-variable-resistor-potentiometer-adc-reading-micropython
embedded-systems esp8266-projects micropython micropython-esp8266 potentiometer thonny-ide variable-resistor
Last synced: 19 days ago
JSON representation
This project demonstrates how to read **analog voltage values** from a **variable resistor (potentiometer)** using the **ADC (Analog-to-Digital Converter)** on the **ESP8266** board with **MicroPython**. The sensor’s analog output is connected to the **A0** pin, and the digital value (0–1024) is printed on the Thonny IDE console.
- Host: GitHub
- URL: https://github.com/asathiskumar98-byte/esp8266-variable-resistor-potentiometer-adc-reading-micropython
- Owner: asathiskumar98-byte
- Created: 2025-10-29T03:20:43.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-10-29T03:23:48.000Z (7 months ago)
- Last Synced: 2025-10-29T05:36:15.054Z (7 months ago)
- Topics: embedded-systems, esp8266-projects, micropython, micropython-esp8266, potentiometer, thonny-ide, variable-resistor
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🎛️ ESP8266 Variable Resistor (Potentiometer) ADC Reading — MicroPython
## 🧠 Overview
This project demonstrates how to read **analog voltage values** from a **variable resistor (potentiometer)** using the **ADC (Analog-to-Digital Converter)** on the **ESP8266** board with **MicroPython**.
The sensor’s analog output is connected to the **A0** pin, and the digital value (0–1024) is printed on the Thonny IDE console.
---
## ⚙️ Hardware Setup
| Component | ESP8266 Pin | Description |
|----------------------|-------------|--------------|
| Variable Resistor | A0 | Analog Input |
| Power (VCC) | 3.3V | +3.3 V Supply |
| Ground (GND) | GND | Common Ground |
🔹 Connect the **middle pin** of the potentiometer to **A0**.
🔹 Connect one side to **3.3 V** and the other side to **GND**.
---
## 🧩 Code
```python
import machine
from machine import ADC
import utime
# A0 = Variable resistor middle pin (Sensor Output)
# ADC 10-bit resolution = 0–1024
variable_resistor = machine.ADC(0)
while True:
adc_value = variable_resistor.read()
print('step_value:', adc_value)
utime.sleep_ms(200)