吴忠躺衫网络科技有限公司

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

利用Arduino的自動風扇速度控制電路設計

CHANBAEK ? 來源:網絡整理 ? 作者:網絡整理 ? 2024-06-22 16:39 ? 次閱讀

利用Arduino的自動風扇速度控制電路設計(一)

自動風扇速度控制電路Arduino LM35編程非常容易實驗,可用于根據溫度水平通過繼電器控制任何目標設備。對于這里的溫度測量,我們使用 LM35,這是一種精密集成電路溫度器件,其輸出電壓與攝氏度溫度成線性比例。由于其輸出特性,我們在輸出值計算中不需要采用開爾文。該LM35溫度傳感器無需任何外部元件即可工作,只需要4 V至30 V穩壓直流電源作為偏置。在此電路中,我們使用 Arduino 開發板的 +5V DC。該傳感器在室溫下提供±1/4°C的溫度輸出,在-55°C至150°C的整個溫度范圍內提供±3/4°C的溫度輸出。

由于該 LM35 提供模擬輸出(線性 + 10-mV/°C 比例因子),因此我們可以將 LM35 的輸出引腳直接連接到 Arduino 板的任何模擬輸入引腳。 LM35 可以采用單電源或雙電源供電,其自身運行功耗僅為 60 μA。它有不同的封裝,如 TO-CAN (3)、TO-92 (3)。這里我們使用德州儀器 (TI) 的 LM35 TO-92。

image.png

直流風扇控制電路圖

image.png

繼電器(交流風扇)控制電路圖

image.png

該電路可以構建在面包板或普通 PCB 板上,具有額外的 12V 直流電源用于風扇或繼電器。如前所述,LM35 只需要 5V,因此 Arduino 的 5V 引腳和 Gnd 引腳與 LM35 連接,輸出引腳直接連接到模擬輸入引腳 A0,并在以下程序中提到。指示 LED 與數字引腳 D8 連接并聲明為輸出引腳。 D3 PWM引腳聲明為輸出引腳,連接至開關晶體管 2N2219A 的基極。這里我們必須根據 LM35 感測到的溫度水平來更改輸出脈沖寬度。順便說一下,我們可以達到不同的速度級別。每當溫度傳感器檢測到 Arduino 外部的溫度變化時,D3 引腳的 PWM 輸出就會發生變化,因此風扇的速度也會發生變化。

為了控制繼電器,使用 D3 引腳作為數字輸出引腳并在 Arduino 代碼中聲明它。這樣我們只能根據溫度水平來打開和關閉交流風扇。根據溫度水平使用任何目標負載來打開和關閉。每當溫度傳感器檢測到溫度變化超過 30°C 時,Arduino 就會改變 D3 引腳的數字輸出(高電平),從而風扇速度發生變化。低于 25°C 時,D3 引腳的數字輸出變為(低)。

自動風扇速度控制電路Arduino LM35編程

int tempPin = A0;   // connect Sensor output pin
int fan = 3;       // Output drive for fan
int led = 8;        // fan status led pin
int temp;
int tempMin = 25;   // Minimum temperature to start the fan
int tempMax = 75;   // Maximum temperature to turn fan at 100% speed
int fanSpeed;
 
void setup() {
  pinMode(fan, OUTPUT);
  pinMode(led, OUTPUT);
  pinMode(tempPin, INPUT);
  Serial.begin(9600);  // Initialize serial communication at 9600 baud rate
}
 
void loop() {  
   temp = readTemp();     // read temperature
   Serial.print("Temperature: ");
   Serial.print(temp);
   Serial.println(" °C");
   
   if(temp < tempMin) {   // if temp is lower than minimum temperature
       fanSpeed = 0;      // fan is off
       digitalWrite(fan, LOW);
       Serial.println("Fan Speed: OFF");
   } 
   if((temp >= tempMin) && (temp <= tempMax)) {  // if temperature is higher than minimum temperature
       fanSpeed = map(temp, tempMin, tempMax, 32, 255); 
       analogWrite(fan, fanSpeed);  // spin the fan at the fanSpeed speed
       Serial.print("Fan Speed: ");
       Serial.println(fanSpeed);
   } 
   
   if(temp > tempMax) {        // if temp is higher than tempMax
     digitalWrite(led, HIGH);  // turn on led 
     Serial.println("Fan Status: Overheating!");
   } else {                    // else turn off led
     digitalWrite(led, LOW); 
     Serial.println("Fan Status: Normal");
   }
   delay(1000); // Delay for 1 second before reading temperature again
 }
 
int readTemp() {  // get temperature and convert it to celsius
  temp = analogRead(tempPin);
  return temp * 0.48828125;
}

自動繼電器控制電路Arduino LM35編程

const int tempPin = A0;    // LM35 temperature sensor connected to analog pin A0
const int relayPin = 3;    // Relay control pin connected to digital pin 2

const int tempThresholdHigh = 30;  // Temperature threshold to turn on the relay (in Celsius)
const int tempThresholdLow = 25;   // Temperature threshold to turn off the relay (in Celsius)

void setup() {
  pinMode(tempPin, INPUT);
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);  // Ensure the relay is initially off
  Serial.begin(9600);
}

void loop() {
  int tempValue = analogRead(tempPin);  // Read temperature value from LM35 sensor
  float temperature = (tempValue * 0.48828125);  // Convert analog reading to Celsius
  
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
  
  // Check temperature and control the relay
  if (temperature >= tempThresholdHigh) {
    digitalWrite(relayPin, HIGH);  // Turn on the relay
    Serial.println("Relay Status: ON");
  } else if (temperature <= tempThresholdLow) {
    digitalWrite(relayPin, LOW);  // Turn off the relay
    Serial.println("Relay Status: OFF");
  }
  
  delay(1000);  // Delay for 1 second before reading temperature again
}

在上面的兩個程序中,我們使用以下方法將模擬輸出電壓從 LM35 轉換為攝氏度

int readTemp() {

temp = analogRead(tempPin);

return temp * 0.48828125;

}

利用Arduino的自動風扇速度控制電路設計(二)

大多數時候,人們在離開房間時仍然開著風扇,因為他們忘記將其關閉。他們甚至將風扇設置為最高速度,無論外面的天氣如何。所有這些習慣每天都會消耗和浪費越來越多的電力。為此,我們需要制作一個風扇可以自動打開和關閉的風扇。

這里風扇的速度可以通過改變輸入電源來改變,但是如果我們需要根據溫度變化來改變風扇速度。然后我們必須在系統中實現微控制器(Arduino)和溫度傳感器 LM 35。現在風扇可以根據房間內的溫度變化來改變速度。所有這些都將節省大量電力。

電路原理

image.png

如圖電路圖所示,電路的主要部分是Arduino Uno板和LM35溫度傳感器。這里傳感器的輸出直接與Arduino板的模擬輸入A0引腳連接,LED1與數字引腳D8連接。輸出取自Arduino的D11引腳。現在您可以選擇任何具有 PWM 功能的數字引腳作為輸出引腳,為此,我們也必須在 Arduino 程序代碼中進行這些更改。這里給出的代碼基于 D11 引腳作為輸出。每當溫度傳感器檢測到 Arduino 外部的溫度變化時,D11 引腳的 PWM 輸出就會發生變化,因此風扇的速度也會發生變化。此外,在該電路中,SL100 晶體管充當開關晶體管。我們需要一個12V電源來偏置電路。

Arduino代碼

#include < LiquidCrystal.h >
LiquidCrystal lcd(7,6,5,4,3,2);
int tempPin = A0;   // connect Sensor output pin
int fan = 11;       // Output drive for fan
int led = 8;        // fan status led pin
int temp;
int tempMin = 25;   // Minimum temperature to start the fan
int tempMax = 75;   // Maximum temperature to turn fan at 100% speed
int fanSpeed;
int fanLCD;
 
void setup() {
  pinMode(fan, OUTPUT);
  pinMode(led, OUTPUT);
  pinMode(tempPin, INPUT);
  lcd.begin(16,2);  
}
 
void loop() {  
   temp = readTemp();     // read temperature
   if(temp < tempMin) {   // if temp is lower than minimum temperature
       fanSpeed = 0;      // fan is off
       digitalWrite(fan, LOW);       
   } 
   if((temp >= tempMin) && (temp <= tempMax)) {  // if temperature is higher than minimum temperature
       fanSpeed = map(temp, tempMin, tempMax, 32, 255); 
       fanLCD = map(temp, tempMin, tempMax, 0, 100);  // speed of fan to display on LCD
       analogWrite(fan, fanSpeed);  // spin the fan at the fanSpeed speed
   } 
   
   if(temp > tempMax) {        // if temp is higher than tempMax
     digitalWrite(led, HIGH);  // turn on led 
   } else {                    // else turn off led
     digitalWrite(led, LOW); 
   }
   
   lcd.print("TEMP: ");
   lcd.print(temp);      // display the temperature
   lcd.print("C ");
   lcd.setCursor(0,1);   
   lcd.print("FANS: ");
   lcd.print(fanLCD);    // display the fan speed
   lcd.print("%");
   delay(200);
   lcd.clear();   
}
 
int readTemp() {  // get temperature and convert it to celsius
  temp = analogRead(tempPin);
  return temp * 0.48828125;
}
聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • 電路圖
    +關注

    關注

    10356

    文章

    10725

    瀏覽量

    532872
  • 控制電路
    +關注

    關注

    82

    文章

    1719

    瀏覽量

    136100
  • 自動風扇
    +關注

    關注

    0

    文章

    2

    瀏覽量

    5958
  • Arduino
    +關注

    關注

    188

    文章

    6477

    瀏覽量

    187816
  • 速度控制
    +關注

    關注

    0

    文章

    38

    瀏覽量

    8005
收藏 人收藏

    評論

    相關推薦

    求助!設計一個熱風傳送系統的風扇電機運轉控制電路

    1.采用74LS系列集成電路設計能夠實現以下功能的電路系統并模擬運行。2.設計一個熱風傳送系統的風扇電機運轉控制電路,共有8種速率,采用電路設計
    發表于 12-18 22:08

    新型風扇速度自動控制集成電路及其應用

    介紹兩種新型風扇速度自動控制集成電路使用簡單遠程二極管溫度傳感器的四逹風扇控制集成
    發表于 07-18 15:53 ?40次下載

    家用電風扇微風控制電路

    家用電風扇微風控制電路
    發表于 10-14 22:35 ?4720次閱讀
    家用電<b class='flag-5'>風扇</b>微風<b class='flag-5'>控制電路</b>圖

    組合機床順序控制電路設計

    組合機床順序控制電路設計 一、 實驗目的;1、 熟悉常用低壓電器元件的使用。2、 掌握控制電路設計的方法
    發表于 09-23 08:18 ?3519次閱讀
    組合機床順序<b class='flag-5'>控制電路設計</b>

    儀器用風扇調速控制電路

    儀器用風扇調速控制電路
    發表于 12-30 18:00 ?1334次閱讀
    儀器用<b class='flag-5'>風扇</b>調速<b class='flag-5'>控制電路</b>圖

    風扇陣風控制電路

    風扇陣風控制電路 分析與檢修:該型電風扇的陣風控制電路原理如附圖所示。由時基集成電路NE555等元器件組成
    發表于 05-26 14:20 ?3501次閱讀
    電<b class='flag-5'>風扇</b>陣風<b class='flag-5'>控制電路</b>

    高效率的風扇控制電路

    高效率的風扇控制電路 最簡單的風扇控制方案是采用一個開關控制風扇,這種方案雖然簡單,但效率非常
    發表于 09-25 10:23 ?8529次閱讀
    高效率的<b class='flag-5'>風扇</b><b class='flag-5'>控制電路</b>

    電子式風扇控制電路的組成及按鍵原理分析

    燈和風扇是單獨控制的,只是把兩種不同功能的電器組合到一起。電子式風扇控制電路由電源、發射電路、接收電路
    的頭像 發表于 07-08 15:08 ?1.8w次閱讀
    電子式<b class='flag-5'>風扇</b><b class='flag-5'>控制電路</b>的組成及按鍵原理分析

    基于實用基電風扇模擬的自然控制電路

    基于實用基電風扇模擬的自然控制電路
    發表于 06-27 10:05 ?9次下載

    流截止負反饋自動調速控制電路設計與實現

    流截止負反饋自動調速控制電路設計與實現
    發表于 07-18 09:23 ?1次下載

    基于AD603放大器的自動增益控制電路設計

    基于AD603放大器的自動增益控制電路設計
    發表于 08-18 14:30 ?98次下載

    數字風扇速度控制電路如何工作的

    這是數字風扇速度控制電路設計,可用于使用感應電機控制220V風扇速度
    的頭像 發表于 05-10 16:49 ?2041次閱讀
    數字<b class='flag-5'>風扇</b><b class='flag-5'>速度</b><b class='flag-5'>控制電路</b>如何工作的

    如何使用Arduino生成的PWM來控制交流風扇速度

    在這個項目中,我們將演示使用 TRIAC 的 Arduino 交流風扇速度控制。這里使用交流信號的相位控制方法來
    的頭像 發表于 08-18 16:26 ?1.2w次閱讀
    如何使用<b class='flag-5'>Arduino</b>生成的PWM來<b class='flag-5'>控制</b>交流<b class='flag-5'>風扇</b>的<b class='flag-5'>速度</b>

    使用Arduino和晶閘管(TRIAC)控制交流風扇速度

    在許多基于Arduino自動化項目中,使用開關或使用某種控制很容易打開或關斷家用電器。但是在很多應用中,我們需要控 制交流電源,例如,控制風扇
    發表于 03-06 14:57 ?3次下載
    使用<b class='flag-5'>Arduino</b>和晶閘管(TRIAC)<b class='flag-5'>控制</b>交流<b class='flag-5'>風扇</b>的<b class='flag-5'>速度</b>

    風扇控制電路速度控制指南

    風扇控制電路的范圍從在特定溫度下提高風扇速度的簡單開關到具有連續可變速度的數字控制
    的頭像 發表于 05-17 11:51 ?5535次閱讀
    <b class='flag-5'>風扇</b><b class='flag-5'>控制電路</b>和<b class='flag-5'>速度</b><b class='flag-5'>控制</b>指南
    现金百家乐破解| 龙虎斗游戏| 百家乐官网赌博公司| 真人百家乐软件云南景| 乐亭县| 太阳城百家乐主页| 香格里拉县| 百家乐客户端软件| 周至县| 百家乐高手和勒威| 梅州市| 百家乐棋牌官网| 百家乐官网的必赢术| 百家乐官网系列抢庄龙| 曼哈顿百家乐的玩法技巧和规则| 永利高百家乐官网信誉| 百家乐在线洗码| 网上百家乐官网博彩正网| 百家乐真人百家乐赌博| BB百家乐官网HD| 大发888如何下载| 奇迹百家乐官网的玩法技巧和规则 | 百家乐有真假宝单吗| 百家乐官网高人玩法| 乐天堂百家乐赌场娱乐网规则| 澳门百家乐官网几副牌| 大发888体育| 百家乐官网怎么才能包赢| bet365备用主页| 百家乐客户端下载| 长子县| 百家乐具体怎么收费的| 优惠搏百家乐官网的玩法技巧和规则| 六合彩官方| 温州市百家乐ktv招聘| 百家乐官网娱乐城博彩正网| 威尼斯人娱乐代理注| 仕達屋百家乐官网的玩法技巧和规则| 临清市| 威尼斯人娱乐城博彩网| 金锁玉关24山砂水断|