TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139254 times)
  2. FAT32 Library (71751 times)
  3. Network Ethernet Library (57122 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42404 times)
  7. GSM click (29835 times)
  8. mikroSDK (28078 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Example

DC Fan speed control on ATtiny13 and DS18B20

Rating:

5

Author: Roman Toropov

Last Updated: 2016-02-19

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: Motor Control

Downloaded: 1948 times

Followed by: 3 users

License: MIT license  

Control of fan speed depending on the temperature

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "DC Fan speed control on ATtiny13 and DS18B20" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "DC Fan speed control on ATtiny13 and DS18B20" changes.

Do you want to report abuse regarding "DC Fan speed control on ATtiny13 and DS18B20".

  • Information
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

cxema

cxema

scheme

View full image
PCB

PCB

45x35 mm radio part and wiring on one side

View full image

// Roman Toropov
// Termostat source

char duty;
unsigned int temp2write;

void main() {

   DDB0_bit = 1;
   PWM1_Init(_PWM1_FAST_MODE, _PWM1_PRESCALER_1, _PWM1_NON_INVERTED, 0);

  do {
    Ow_Reset(&PORTB, 2);                         // Onewire reset signal
    Ow_Write(&PORTB, 2, 0xCC);                   // Issue command SKIP_ROM
    Ow_Write(&PORTB, 2, 0x44);                   // Issue command CONVERT_T
    Delay_us(120);

    Ow_Reset(&PORTB, 2);
    Ow_Write(&PORTB, 2, 0xCC);                   // Issue command SKIP_ROM
    Ow_Write(&PORTB, 2, 0xBE);                   // Issue command READ_SCRATCHPAD

    temp2write =  Ow_Read(&PORTB, 2);
    temp2write = (Ow_Read(&PORTB, 2) << 8) + temp2write;

  temp2write = temp2write >> 4 ;

// degrees Celsius in decimal form, natural number

  if (temp2write > 37) { duty = (temp2write - 37) * 5 + 20; }

  if (temp2write > 45) { duty = 255; }
  if (temp2write < 38) { duty = 0; }

  PWM1_Set_Duty(duty);

  Delay_ms(3000);

  } while (1);

}

ALSO FROM THIS AUTHOR

16 bit ADC ADS8341 and ATmega

0

Example for the 16 bit ADC ADS8341 + ATmega128 + LCD 2*16

[Learn More]

The 9_2th version of the automatic battery charger - discharger to up 20V, to up 50A

0

direct control switching power supply S-350-15...S-450-15 Based on TL494. ATmega1284 with LCD 4x20, Keypad 4x4, ADC ADS8341, DAC 2*DAC8830 and MCP4921, ACS758LCB-050B, RTC DS3231, DS18B20 and USB UART. Algorithms: IUoU, IUIoU, IUo, IUIo graphs: http://www.jgdarden.com/batteryfaq/carfaq9.htm#algorithms

[Learn More]

Bootloader for ATmega128A 16MHz 19200bps via UART1

5

fast bootloader for ATmega128A (or ATmega128-16AU) 16MHz 19200bps via UART1, programming using the program AVRPROG, press the reset and start the program AvrProg, for two seconds. FUSE bit set boot from address 0xF800, BOOTSZ0 = 1, BOOTSZ1 = 0.

[Learn More]