NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Temperature controlled fan using PWM

November 10, 2010
by 430fed
430fed's Avatar

I was viewing the Motors and Microcontrollers 101 video and I saw at the end of the video that a fan was being controlled by temperature sensor. As the temperature increased the speed of the fan increased. I want to know if the source code for that project is available. I want to build a similiar project. If you have the code for that project please post it.

November 11, 2010
by carlhako
carlhako's Avatar

Hi 430fed

I dont have code for you but pretty much the nerdkit guys have it all there. The temp display and motor controlling. I have just spent the last couple of days messing around with different PWM configuration and leds. Its great having a good understanding of how it all works and fits together. I suggest starting with something simple like just controlling the fan to begin with and work out how to control the speeds. Then from there its easy to take a temp reading and feed that into your PWM to control the speed.

I do have code that takes ADC readings from a pot and adjusts the duty cycle of my PWM output to change the led brightness which is pretty similar to what you want to do.

HTH Carl

November 12, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi 430fed,

The source code for that project is provided on the Motors and Microcontrollers page, just scroll down to the Source Code section.

However, carlhako's suggestion even better. You will learn alot more if you put it together yourself piece by piece. Start with something small like just controlling a motor with PWM, and then add more functionality to it slowly.

Humberto

December 22, 2010
by VictorsNerdery
VictorsNerdery's Avatar

Hey Carlhako Were should I start if I want to make a PWM program. Really I could use some explaining on how to use the information the ADC reads for other parts of my program.

Post a Reply

Please log in to post a reply.

Did you know that the microcontroller's crystal oscillator can be used to keep accurate time? Learn more...