I'm designing a custom PCB using an STM32F103 microcontroller to control a triac-based light dimmer. The firing angle for the triac is determined by reading the voltage from the potentiometer.
The potentiometer output is routed through a header and then directly to an analog input pin (PA0) of the STM32, which uses the built-in ADC to read the value. For power supply filtering, I'm using an LC network to separate the analog supply (VDDA) from the digital supply (VDD), with the usual decoupling capacitors.
This project is part of my effort to learn how to build custom PCBs and improve my practical electronics design skills.
My main question:
Should I add an RC low-pass filter right at the analog input pin (PA0) for improved ADC readings?
- The potentiometer wires might be picking up noise.
- I want smooth, stable ADC readings to avoid flicker or erratic dimming.
- Does the STM32 ADC have any internal filtering/signal conditioning?
- If I should add an RC filter, what typical resistor and capacitor values do you recommend for this application?
- Any suggestions for good PCB layout practices for analog signals?
