Search Code

አርዱኖ ኮድ እና ቪዲዮ ለሁለት-ቻናል 5V ሪሌይ

አርዱኖ ኮድ እና ቪዲዮ ለሁለት-ቻናል 5V ሪሌይ

በዚህ መማሪያ ውስጥ፣ አርዱኖን በመጠቀም ባለ ሁለት ቻናል 5V ሪሌይ እንዴት ኤሲ እና ዲሲ ሸክሞችን መቆጣጠር እንደምንችል እንማራለን። ሪሌዩ እንደ ኤሲ አምፖል እና ዲሲ ሞተር ያሉ ሁለት የተለያዩ ሸክሞችን ለመቀየር ያስችልዎታል፣ ይህም ለተለያዩ አፕሊኬሽኖች ተለዋዋጭነትን ይሰጣል። በዚህ መመሪያ መጨረሻ ላይ፣ የራስዎን ሪሌይ ሲስተም ማዋቀር እና በቀላል አርዱኖ ኮድ መቆጣጠር ይችላሉ።

2 chanel relay module

በሂደቱ ውስጥ፣ አስፈላጊ ክፍሎችን፣ የወልና መመሪያዎችን እና ሪሌዩን ለመቆጣጠር የሚያገለግለውን የአርዱኖ ኮድ ግምገማ እንሸፍናለን። ይህ ፕሮጀክት የኤሌክትሮኒክስ እና አውቶሜሽን ዓለምን ለመዳሰስ ለሚፈልጉ ጀማሪዎች ፍጹም ነው። ለእይታ መመሪያ፣ ተያያዥ ቪዲዮውን (በቪዲዮ 00:00) መመልከትዎን ያረጋግጡ።

ሃርድዌር ተብራርቷል

በዚህ ፕሮጀክት ውስጥ ዋናው ክፍል ባለ ሁለት ቻናል 5V ሪሌይ ነው። ይህ ሪሌይ የተለያዩ ሸክሞችን መቆጣጠር የሚችሉ ሁለት ገለልተኛ ማብሪያዎችን ያካትታል። እያንዳንዱ ሪሌይ ሶስት እውቂያዎች አሉት፡ በተለምዶ ዝግ (NC)፣ በተለምዶ ክፍት (NO) እና የጋራ (COM)። ሪሌዩ ሲነቃ፣ የNO እውቂያ ይገናኛል፣ ይህም ጅረት በሸክሙ ውስጥ እንዲፈስ ያስችላል።

ሌሎች አስፈላጊ ክፍሎች ሪሌዩን በዲጂታል ፒኖቹ የሚቆጣጠረውን አርዱኖ ቦርድ ያካትታሉ። የሪሌይ ሞጁሉ ሪሌዩ ሲነቃ የሚበሩ አመላካች ኤልኢዲዎችንም ያካትታል። በተጨማሪም፣ ሪሌዩ በኦፕቲካል ተለይቷል፣ ይህም የመቆጣጠሪያ ዑደቱን ከሸክሙ ዑደት በመለየት ደህንነትን ይሰጣል።

የዳታሺት ዝርዝሮች

አምራችSongle
የክፍል ቁጥርSRD-05VDC-SL-C
የሎጂክ/IO ቮልቴጅ5 ቪ
የአቅርቦት ቮልቴጅ5 ቪ
የውጤት ጅረት (በአንድ ቻናል)10 ኤ
ከፍተኛ ጅረት (በአንድ ቻናል)10 ኤ
የPWM ድግግሞሽ መመሪያየለም
የግቤት ሎጂክ ገደቦች2.5 ቪ ዝቅተኛ
የቮልቴጅ ጠብታ / RDS(on) / ሙሌት80 mΩ
የሙቀት ገደቦች70 °ሴ
ፓኬጅሞጁል
ማስታወሻዎች / ልዩነቶችበኦፕቲካል ተለይቷል

  • የኤሲ ሸክሞችን ሲያገናኙ ትክክለኛ መነጣጠልን ያረጋግጡ።
  • ከፍተኛ ሸክሞች ጋር ለደህንነት ተገቢ ፊውዝ ይጠቀሙ።
  • የሪሌይ ሞጁሉን ከእርጥበት ያርቁ።
  • ለከፍተኛ ኃይል አፕሊኬሽኖች የሙቀት መስጫ (ሄትሲንክ) ያስቡ።
  • ጉዳትን ለማስቀረት ከማብራትዎ በፊት የወልናውን ያረጋግጡ።
  • አስፈላጊ ከሆነ ለከፍተኛ ጅረት መሳሪያዎች የተለየ የኃይል አቅርቦት ይጠቀሙ።

የወልና መመሪያዎች

Arduino wiring for 2 channel relay module AC load
Arduino wiring for 2 channel relay module AC load

ባለ ሁለት ቻናል ሪሌዩን ከአርዱኖ ጋር ለማገናኘት፣ የሪሌይ ሞጁሉን የVCC ፒን በአርዱኖ ላይ ካለው 5V ፒን ጋር በማገናኘት ይጀምሩ። የሪሌዩን የGND ፒን በአርዱኖ ላይ ካለው GND ፒን ጋር ያገናኙ። ይህ ለሪሌይ ሞጁሉ ኃይል ይሰጣል።

በመቀጠል፣ የመቆጣጠሪያ ፒኖቹን ያገናኙ፡ የሪሌዩን IN1 ፒን በአርዱኖ ላይ ካለው ዲጂታል ፒን 7 ጋር እና የIN2 ፒንን ከዲጂታል ፒን 8 ጋር ያገናኙ። ይህ ዝግጅት ሁለቱንም ሪሌዮች በገለልተኝነት እንዲቆጣጠሩ ያስችልዎታል። በመጨረሻም፣ የኤሲ ወይም የዲሲ ሸክሞችዎን እንደ ፍላጎትዎ ከሪሌይ እውቂያዎች ጋር ያገናኙ፣ ከኤሲ ቮልቴጅ ጋር በሚሰሩበት ጊዜ ትክክለኛ የደህንነት ጥንቃቄዎችን መከተልዎን ያረጋግጡ።

የኮድ ምሳሌዎች እና ግምገማ

በአርዱኖ ኮድ ውስጥ፣ ተከታታይ ግንኙነትን በማስጀመር እና ለሪሌይ መቆጣጠሪያ ፒኖች የፒን ሁነታዎችን በማዘጋጀት እንጀምራለን። relay1Pin እና relay2Pin ተለዋዋጮች ከእያንዳንዱ ሪሌይ ጋር የተገናኙትን ፒኖች ለመወከል ይገለጻሉ። የእነዚህ ፒኖች የውጤት ሁኔታዎች በሉፕ ውስጥ ይቀየራሉ።

const int relay1Pin = 7; // ለሪሌይ 1 ፒን ይግለጹ
const int relay2Pin = 8; // ለሪሌይ 2 ፒን ይግለጹ

void setup() {
  Serial.begin(9600); // መረጃን ለማሳየት ሴሪያል ሞኒተርን ያዘጋጁ
  pinMode(relay1Pin, OUTPUT); // ከሪሌይ 1 ጋር የተገናኘ
  pinMode(relay2Pin, OUTPUT); // ከሪሌይ 2 ጋር የተገናኘ
}

ይህ ቅንጥብ የማረም መረጃን ለማውጣት ሴሪያል ሞኒተሩን ያስጀምራል እና የሪሌይ መቆጣጠሪያ ፒኖችን እንደ ውጤት ያዘጋጃል። ሪሌዮቹ እንደ አስፈላጊነቱ መብራት እና ማጥፋት እንዲችሉ ይህ ወሳኝ ነው።

void loop() {
  digitalWrite(relay2Pin, LOW); // ሪሌይ 2ን ያጥፉ
  Serial.print("Pin 8 LOW");
  digitalWrite(relay1Pin, HIGH); // ሪሌይ 1ን ያብሩ
  Serial.println(" Pin 7 HIGH");
  delay(3000); // ሪሌይ 2 ጠፍቶ እና ሪሌይ 1 በርቶ ለ3 ሰከንድ ይቆዩ
  digitalWrite(relay1Pin, LOW); // ሪሌይ 1ን ያጥፉ
  digitalWrite(relay2Pin, HIGH); // ሪሌይ 2ን ያብሩ
  Serial.print("Pin 7 LOW");
  Serial.println(" Pin 8 HIGH");
  delay(3000); // ሪሌይ 1 ጠፍቶ እና ሪሌይ 2 በርቶ ለ3 ሰከንድ ይቆዩ
}

ይህ ኮድ ሪሌዮቹን በየሶስት ሰከንድ ይቀይራል፣ አንዱን እያበራ ሌላውን ያጠፋል። ሴሪያል ሞኒተሩ የፒኖቹን ሁኔታ ያወጣል፣ ይህም ለማረም እና የሪሌይ ስራዎችን ለመረዳት ይረዳል።

ማሳያ / ምን እንደሚጠበቅ

ዝግጅቱ ሲጠናቀቅ፣ ሪሌዩ በየሶስት ሰከንድ በተገናኙት ሸክሞች መካከል ሲቀያየር ማየት ይኖርብዎታል። ሪሌዩ የተገናኘውን የኤሲ አምፖል ወይም የዲሲ ሞተር በተለዋጭ ያነቃቃል። ከኤሲ ሸክሞች ጋር ሲሰሩ ይጠንቀቁ፣ ምክንያቱም ተገቢ ያልሆነ አያያዝ ወደ አደገኛ ሁኔታዎች ሊመራ ይችላል (በቪዲዮ 12:34)።

የቪዲዮ ጊዜ ምልክቶች

  • 00:00 - ለባለ ሁለት ቻናል ሪሌይ መግቢያ
  • 04:15 - የወልና መመሪያዎች
  • 08:30 - የኮድ ማብራሪያ
  • 10:45 - የሪሌዩ ማሳያ

ምስሎች

Arduino wiring for 2 channel relay module AC load
Arduino wiring for 2 channel relay module AC load
2 chanel relay module
2 chanel relay module
2 chanel relay module
2 chanel relay module
2 chanel relay module
2 chanel relay module
2 chanel relay module
2 chanel relay module
46-This is the Arduino code for a dual-channel 5V relay.
ቋንቋ: C++
/*
 * This is the Arduino code for Dual Channel 5V Relay
 * to control turning ON or OFF AC or DC loads. You can control 2 different loads such as bulbs, or a heater, or other machines.
  Watch the video instruction for this code: https://youtu.be/EclIomn_3dI
 
 *  * 
 * Written by Ahmad Shamshiri for Robojax Video
 * Date: December 26, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code given that this
 * note is kept with the code.
 * Disclaimer: this code is "AS IS" and for educational purposes only.
 


Get this code and other Arduino codes from Robojax.com
Learn Arduino step by step in a structured course with all materials, wiring diagrams and libraries
all in one place. Purchase my course on Udemy.com: http://robojax.com/L/?id=62

If you found this tutorial helpful, please support me so I can continue creating 
content like this. You can support me on Patreon: http://robojax.com/L/?id=63

or make a donation using PayPal: http://robojax.com/L/?id=64


 * 
  * This code is "AS IS" without warranty or liability. Free to be used as long as you keep this note intact.* 
 * This code has been downloaded from Robojax.com
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

 


void setup() {
  
  Serial.begin(9600);// setup Serial Monitor to display information
  pinMode(7, OUTPUT);// connected to Relay 1
  pinMode(8, OUTPUT);// connected to Relay 2

}

void loop() {
  digitalWrite(8, LOW); // turn relay 2 OFF 
      Serial.print("Pin 8 LOW");
  digitalWrite(7,HIGH);// turn relay 1 ON
      Serial.println(" Pin 7 HIGH");
  delay(3000);// keep in relay 2 OFF and relay 1 On for 3 seconds
  digitalWrite(7, LOW);// turn relay 1 OFF
  digitalWrite(8,HIGH);// turn relay 2 ON
      Serial.print("Pin 7 LOW");
      Serial.println(" Pin 8 HIGH");
  delay(3000);// keep in relay 1 OFF and relay 2 On for 3 seconds


}
47-Control AC loads using a 2-channel relay and an Arduino
ቋንቋ: C++
/*
 * This is the Arduino code for a dual-channel 5V relay
 * to control turning ON or OFF AC or DC loads. You can control 2 different loads such as bulbs, a heater, or other machines.
 Watch the video instruction for this code: https://youtu.be/EclIomn_3dI
 
 *  * 
 * Written by Ahmad Shamshiri for Robojax Video
 * Date: December 26, 2017, in Ajax, Ontario, Canada
 * Permission granted to share this code, given that this
 * note is kept with the code.
 * Disclaimer: This code is "AS IS" and for educational purposes only.
 


Get this code and other Arduino codes from Robojax.com
Learn Arduino step by step in a structured course with all materials, wiring diagrams, and libraries
all in one place. Purchase my course on Udemy.com: http://robojax.com/L/?id=62

If you find this tutorial helpful, please support me so I can continue creating 
content like this. You can support me on Patreon: http://robojax.com/L/?id=63

or make a donation using PayPal: http://robojax.com/L/?id=64


 * 
  * This code is "AS IS" without warranty or liability. Free to be used as long as you keep this note intact.
 * This code has been downloaded from Robojax.com
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

const int relay1Pin =7;// define pin for relay 1
const int relay2Pin =8; // define pin for relay 2


void setup() {
  
  Serial.begin(9600);// setup Serial Monitor to display information
  pinMode(relay1Pin, OUTPUT);// connected to Relay 1
  pinMode(relay2Pin, OUTPUT);// connected to Relay 2

}

void loop() {
  digitalWrite(relay2Pin, LOW); // turn relay 2 OFF 
      Serial.print("Pin 8 LOW");
  digitalWrite(relay1Pin,HIGH);// turn relay 1 ON
      Serial.println(" Pin 7 HIGH");
  delay(3000);// keep in relay 2 OFF and relay 1 On for 3 seconds
  digitalWrite(relay1Pin, LOW);// turn relay 1 OFF
  digitalWrite(relay2Pin,HIGH);// turn relay 2 ON
      Serial.print("Pin 7 LOW");
      Serial.println(" Pin 8 HIGH");
  delay(3000);// keep in relay 1 OFF and relay 2 On for 3 seconds


}

እንደሚያስፈልግዎት ይችላል

ምንጮች እና ምንጮች

አሁን ምንም ምንጮች የለም።

ፋይሎች📁

አንድ ፋይል የለም።