Free tools Windows power users keep installed
One-click scans. No signup required.
A DIY capacitive rotary encoder can use etched PCB electrodes, a rotating FR-4 disk and a 555 timer to turn shaft angle into a signal an ESP32 can measure. In Jan Mrázek’s 2017 proof of concept, the ESP32 detected roughly 140 discrete positions at an oscillator frequency near 100 kHz. That result demonstrates a compact, potentially fast sensor—not a production-ready encoder: the tested geometry covered only 0–180°, and the proposed continuous-rotation design was not tested.
How the FR-4 capacitive encoder works
The sensing element is a variable capacitor. Two conductive plates are etched into a PCB, and a semicircular FR-4 disk rotates between them. As the disk changes how much of the electrode area is covered, the effective capacitance changes. FR-4 was chosen because it is readily available and has a dielectric constant about four times that of air, according to Mrázek’s project description.
A 555 timer is wired as an astable oscillator, so it repeatedly charges and discharges its timing network. The changing sensor capacitance alters the oscillator period. An ESP32 timer then measures that period using input capture, turning the change into a position reading. This is an indirect measurement: the MCU reads timing, not capacitance directly.
What the prototypes showed
First version: simple electrodes, unstable readings
The first prototype used two etched half-circle plates separated by transparent tape. Its active diameter was 15 mm, and Mrázek estimated its capacitance at about 8 pF. The small spacing made the sensor vulnerable to tiny physical changes: touch or mechanical pressure could shift the readings. The setup also appeared sensitive to humidity and temperature, and its wire connection prevented continuous rotation.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute#1 Best Overall
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Support LWIP protocol, Freertos
- SupportThree Modes: AP, STA, and AP+STA
- Ultra-Low power consumption, Compatible with Arduino IDE
- ESP32 is a safe, reliable, and scalable to a variety of applications
Second version: move the dielectric, not the electrodes
The revised design kept the electrodes fixed and rotated the semicircular FR-4 disk between them. A two-555 compensation arrangement introduced interference, so the reported final test used one 555 timer and a ground plane. The author estimated the plate capacitance at roughly 10 pF.
For that test, the ESP32 timer ran at 80 MHz and the oscillator near 100 kHz. Mrázek reported roughly 140 discrete positions, noise stable to about ±1 timer tick, and no drift during a two-hour run. Hackaday’s Donald Papp independently summarized the result in November 2017 as an ESP32 reliably reading 140 positions at 100 kHz. These are reports of a hobbyist prototype, not independent laboratory validation or production qualification.
Rank #2
- Dual-Core Performance Up to 240 MHz: Run sensor processing, wireless communication, automation logic and connected-device tasks on a 32-bit dual-core ESP32 platform designed for responsive embedded and IoT projects
- Built-in Wi-Fi and Bluetooth 4.2: Connect to 2.4 GHz Wi-Fi networks or use Bluetooth Classic and BLE for wireless sensors, smart devices, remote controls, home automation and other connected projects
- Flexible Power-Saving Modes: ESP32 power-management features support dynamic clock scaling and low-power operating modes, helping developers reduce energy use in compatible sensing, monitoring and connected-device applications, suitable for battery-powered Internet of Things (IoT) devices.
- USB-C Programming with CP2102: Connect through USB-C for power, sketch uploads and serial monitoring, while GPIO, UART, SPI and I2C interfaces support sensors, displays, motor drivers and other modules (USB-C cable not included)
- Over-the-Air Update Support: Configure OTA functionality through a compatible ESP-32 software framework to update deployed firmware over Wi-Fi without reconnecting the board by USB for every revision
What you need to build the basic version
The design’s appeal is that the sensing pattern can occupy PCB area rather than requiring a separate encoder package. The stated low-cost bill of materials is:
- PCB space for the etched electrodes
- One 555 timer for the reported final test; the author’s alternative compensation arrangement used two
- Four resistors and four capacitors
- An MCU with a fast timer, such as the ESP32 used in the demonstration
- A rotating FR-4 semicircular dielectric element and a mechanical arrangement that holds it between the electrodes
The component list is not a complete fabrication specification: the project description does not establish a universal PCB stack-up, electrode spacing, calibration procedure or production-ready mechanical tolerance. Mrázek called the work a “proof-of-concept” and noted that a magnetic encoder IC may be cheaper once engineering time is included.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
- Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
- Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
- Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
- Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.
Resolution, speed and angle range
The reported 140 positions were achieved with the oscillator near 100 kHz and the ESP32 timer clocked at 80 MHz. They should be understood as the discrete positions observed in that prototype, not as a guaranteed accuracy, linearity or resolution specification for other layouts.
Mrázek’s design explanation identifies a speed-versus-resolution tradeoff: lowering the oscillator frequency can increase the measured positional resolution, but reduces update speed. The 100 kHz result therefore should not be read as a promise that the design can improve resolution without affecting response rate.
Rank #4
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Support LWIP protocol, Freertos;ESP32 is a safe, reliable, and scalable to a variety of applications
- SupportThree Modes: AP, STA, and AP+STA
- Ultra-Low power consumption, Compatible with Arduino IDE
- 1PCS 30Pin ESP32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters
The tested semicircular arrangement measures only 0–180°. Capacitance decreases symmetrically after the midpoint, so the same reading can correspond to angles on either side; the signal alone does not distinguish the direction. Mrázek proposed a two-electrode pattern with a dielectric disk covering two-thirds of a circle as a way to recover direction, but explicitly did not test that configuration. Continuous rotation and directional operation remain unverified for this project.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.How it compares with optical and magnetic encoders
The following is a qualitative comparison based on Mrázek’s characterization of the alternatives and the reported prototype. It is not a controlled head-to-head test; no shared speed, accuracy, price or size measurements were published.
Best Value
- 2.4GHz Dual Mode WiFi + Bluetooth Development Board
- Ultra-Low power consumption, works perfectly with the Arduino IDE
- Support LWIP protocol, Freertos
- SupportThree Modes: AP, STA, and AP+STA
- ESP32 is a safe, reliable, and scalable to a variety of applications
| Approach | Update speed and resolution | Size and integration | Environment and rotation | Electronics and total effort |
|---|---|---|---|---|
| FR-4 capacitive prototype | Potentially very fast; about 140 discrete positions were reported near 100 kHz. Resolution trades off against oscillator speed. | Can use PCB-integrated electrodes; the prototype’s sensing diameter was 15 mm in its first version. | First version was sensitive to touch, pressure, humidity and temperature. Tested geometry covers 0–180°; continuous rotation was not demonstrated. | Requires electrodes, a 555 timing circuit and an MCU timer. Low parts cost is possible, but development and calibration effort can outweigh savings. |
| Optical encoder | Mrázek describes traditional optical encoders as precise and fast; no specific measurements are supplied. | Characterized as larger than this PCB-integrated approach; no dimensions are supplied. | Continuous-rotation capability and environmental behavior are not specified in the project comparison. | Comparative electronics complexity and total cost are not quantified. |
| Magnetic encoder | Characterized as offering excellent resolution but operating more slowly than the capacitive approach; no figures are supplied. | Characterized as small; no dimensions are supplied. | Continuous-rotation capability and environmental behavior are not specified in the project comparison. | Characterized as more expensive as a component, though Mrázek cautions that it may be cheaper overall when engineering time is counted. |
When this approach makes sense—and when it does not
A PCB capacitive encoder is most compelling when integration into a board and experimentation with a low-cost sensing element matter more than a proven, drop-in angle measurement. The prototype indicates that a fast timer can extract many discrete positions from a small capacitance change.
Choose a different approach if the project requires documented accuracy, environmental robustness, qualified lifetime, guaranteed continuous rotation or a low-effort implementation. The 2017 project supplies no independent laboratory testing, long-term reliability results, current price survey or verified retail availability, so those properties cannot be inferred from the demonstration.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

