Hi, I am trying to vary the PWM duty cycle to control a small heat sink temperature. I don't want the user input to control duty cycle, but:
When uC is powered up, PWM duty cycle starts 0
If heat sink temperature > limit, PWM duty cycle ++
If heat sink temperature < limit, PWM duty cycle --
I am using UNO ATMEGA328, and I am trying to find examples for my experiment. Could someone provide me examples so that I can start?
Thank you.
For starters, PWM complexity is hidden by the analogWrite() function. Once you know how temperature is acquired, you simple follow the logic you have already given above.
gpop1
August 7, 2015, 3:27pm
3
how are you bringing in the temperature signal.
Most pre-written programs of this type will involve a pid library which may be what you are looking for.
gpop1
August 8, 2015, 12:31am
5
coldic1:
By AnalogRead(Pin)
prewritten examples can be found by googling arduino pid temp control
personally if you are learning or want to learn I think you can start with a temp reading code then just add the extra code.