|Fan controller with DS1621 and PWM output|
|In this example we have connected the LCD display to PORTB using PINS 0 to 5, and PINS 6 and 7 to two switches. The switch should be connected from the PIN to GND. Important: Connect the LCD R/W to GND. Included is the PWM, I2C and Text LCD libraryies.
PWM output is generated with Timer1 and outputs is on PORTD.5. This can be directly connected through a 100 Ohm resitor to an FET driving a lamp, motor, fan etc.
Temperature is read from an Dallas DS1621 coded with address 0.
The duty cycle will rise with higher temperatures. At 70°C or higher the duty cycle is 100%.
This was tested on a ATmega16, but all AVR with an Timer1 (PWM) should be able to do the work... Code will use about 4.5k so no AT90S2313 :-\
And the code can freely be downloaded. No copyrights !
Click here to download the latest version (10 kb)
direct lender payday loans