I am working on a simple Arduino based project where I will use PID to modulate the PWM signal of an Arduino microcontroller, so the PWM values will vary from 0 to 255, as that is the resolution. I will be using AnalogWrite ( PWM voltage ) to out varied voltages. So my question is this, suppose I need a 12 V power supply that is connected to a resistive heating element, how would I control the amount of current flowing through a heating element. Note that I have already developed a on/off system that supplies maximial current, when I set the PWM to 100 % duty cycle and zero current, when I set the PWM to 0 % duty cycle.
I talked to my supervisor and he told me to connect the PWM to a mosfet and vary the PWM which will allow a varying current to flow through the heating element ( resistive).
Is this a good idea and will this work?