pwm control with voltage sensor

Hello I'm new here on the forum and I know a little about electronics and arduino.
I would like to know if anyone has any idea how to do a pwm control by means of a voltage sensor on the arduino. For example, when suffering a small voltage variation, I have an increase in the duty cycle of the pwm. So I can know how many percent I have increased my pwm pulse with the increment of the sensor. Does anyone know if it is possible and how would this implementation be?

Thank you very much :slight_smile:

Do You manage to control and send a PWM signal?
Save the last PWM and compare when a new PWM is ordered.
I can’t find any code to check…
Read Forum guidelines like “How to use this Forum”. It tells how to attach code and other info.

It depends on how you convert the PWM signal into a voltage. Typical RC low pass filters suffer from a permanent ripple that makes it difficult to find real duty cycle changes.

Why don't you measure the pulse width of the PWM signal?

How are you sensing voltage? What is the minimum and maximum voltage? What is the minimum and maximum PWM duty cycle?

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Can you please post your code?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please tell us your electronics, programming, arduino, hardware experience?

What sensor and what model Arduino are you using?

Thanks.. Tom... :slight_smile: