የ Arduino ኮድ እና ቪዲዮ ለ KY-024 ሆል ሴንሰር ሞጁል
በዚህ ትምህርት፣ መግነጢሳዊ መስኮችን ለመለየት የKY-024 ሆል ዳሳሽ ሞጁልን ከአርዱኖ ጋር እንዴት መጠቀም እንደሚቻል እንመረምራለን። የሆል ዳሳሹ መግነጢሳዊ መስክ ሲያገኝ እርምጃ ለመውሰድ ይጠቅማል፣ እና ውጤቱን በሴሪያል ሞኒተር ላይ እናሳያለን። ውጤቱም ወደ ፕሮጀክቶችዎ መግነጢሳዊ ዳሳሽን ለማዋሃድ ቀላል እና ውጤታማ መንገድ ነው፣ ይህም ወደፊት ለማስፋት መሠረት ይሰጥዎታል። ለበለጠ ዝርዝር ማብራሪያ፣ ቪዲዮውን (በቪዲዮው 00:00 ላይ) መመልከትዎን ያረጋግጡ።


የሃርድዌር ማብራሪያ
የሆል ዳሳሽ ሞጁሉ መግነጢሳዊ መስኮችን ለመለየት የተነደፈ ሲሆን በተለያዩ አፕሊኬሽኖች ውስጥ በተለምዶ ጥቅም ላይ ይውላል፣ ይህም የቅርበት ዳሳሽ እና የፍጥነት መለየትን ጨምሮ። መግነጢሳዊ መስክ በሚኖርበት ጊዜ፣ ዳሳሹ በአርዱኖ ሊነበብ የሚችል ምልክት ያወጣል። ይህ አርዱኖ መግነጢሳዊ መስክ ያለው ነገር በአቅራቢያ መኖሩን እንዲያውቅ ያስችለዋል።
በዚህ ፕሮጀክት ውስጥ፣ እንደ እርምጃ መሣሪያ ባዘርንም እንጠቀማለን። የሆል ዳሳሹ መግነጢሳዊ መስክ ሲያገኝ፣ አርዱኖ የሚሰማ ማንቂያ ለመስጠት ባዘሩን ያንቀሳቅሳል። ዋናዎቹ ክፍሎች የሆል ዳሳሽ፣ የአርዱኖ ቦርድ እና ባዘሩ ናቸው።
የዳታሼት ዝርዝሮች
| አምራች | ሆኒዌል |
|---|---|
| የክፍል ቁጥር | SS495A1 |
| የሎጂክ/IO ቮልቴጅ | 4.5 – 10 ቪ |
| የአቅርቦት ቮልቴጅ | 4.5 – 10 ቪ |
| የውጤት ኤሌክትሪክ (በአንድ ቻናል) | 20 ሚኤ ከፍተኛ |
| ከፍተኛ ኤሌክትሪክ (በአንድ ቻናል) | 50 ሚኤ ከፍተኛ |
| የPWM ድግግሞሽ መመሪያ | የለም |
| የግብዓት ሎጂክ ገደቦች | 0.7 ቪ (ከፍተኛ)፣ 0.3 ቪ (ዝቅተኛ) |
| የቮልቴጅ ጠብታ / RDS(on) / ሙሌት | 0.4 ቪ ከፍተኛ |
| የሙቀት ገደቦች | -40 እስከ +85 °ሴ |
| ፓኬጅ | TO-92 |
| ማስታወሻዎች / ልዩነቶች | በተለያዩ ስሜታዊነት ደረጃዎች ይገኛል |
- በተጠቀሰው የቮልቴጅ ክልል ውስጥ ትክክለኛ የኃይል አቅርቦት ያረጋግጡ።
- ሞጁሉን ላለመጉዳት የውጤት ኤሌክትሪክ ገደቦችን ያስተውሉ።
- ለተረጋጋ ንባብ አስፈላጊ ከሆነ የፑል-አፕ ሬዚስተር ይጠቀሙ።
- ዳሳሹን ጣልቃ ገብነት ሊያስከትሉ ከሚችሉ ጠንካራ ኤሌክትሮማግኔቲክ መስኮች ያርቁ።
- ዳሳሹን በተወሰነው የአፕሊኬሽን ፍላጎት መሠረት ያስተካክሉ።
የሽቦ መገጣጠሚያ መመሪያዎች


የሆል ዳሳሽ ሞጁሉን ከአርዱኖ ጋር ለማገናኘት፣ በመጀመሪያ የዳሳሹን VCC ፒን ለኃይል ከአርዱኖው 5V ፒን ጋር ያገናኙ። በመቀጠል ዑደቱን ለማጠናቀቅ የGND ፒንን ከአርዱኖው GND ፒን ጋር ያገናኙ። የሆል ዳሳሹ የውጤት ፒን፣ በተለምዶ OUT ተብሎ የሚታወቀው፣ በአርዱኖ ላይ ካለው ዲጂታል ፒን 2 ጋር መገናኘት አለበት።
ለባዘሩ፣ አወንታዊውን ተርሚናል በአርዱኖ ላይ ካለው ዲጂታል ፒን 8 ጋር ያገናኙ፣ እና አሉታዊውን ተርሚናል ከGND ጋር ያገናኙ። ይህ ዝግጅት አርዱኖ የዳሳሹን ውጤት እንዲያነብ እና መግነጢሳዊ መስክ ሲገኝ ባዘሩን እንዲያንቀሳቅስ ያስችለዋል።

የኮድ ምሳሌዎች እና ማብራሪያ
የሚከተለው ኮድ የሆል ዳሳሹን እና ባዘሩን ይጀምራል። ለዳሳሹ እና ለእርምጃው ፒኖችን ይገልጻል። ዋናው ሉፕ የዳሳሹን ሁኔታ ያነባል እና ባዘሩን በዚሁ መሠረት ያንቀሳቅሳል።
#define DETECT 2 // ፒን 2 ለዳሳሽ
#define ACTION 8 // ፒን 8 ለእርምጃ አንድ ነገር ለማድረግ
void setup() {
Serial.begin(9600);
pinMode(DETECT, INPUT); // የመለየት ግብዓት ፒንን ይግለጹ
pinMode(ACTION, OUTPUT); // የACTION ውጤት ፒንን ይግለጹ
}
በዚህ ኮድ ውስጥ፣ የDETECT ተለዋዋጭ ዳሳሹን ለማንበብ ወደ ፒን 2 ተመድቧል። የACTION ተለዋዋጭ ባዘሩ ወደተገናኘበት ፒን 8 ተመድቧል። የsetup ተግባር የሴሪያል ግንኙነትን ይጀምራል እና የፒን ሁነታዎችን ያዘጋጃል።


void loop() {
int detected = digitalRead(DETECT); // የሆል ዳሳሽ ያንብቡ
if (detected == LOW) {
digitalWrite(ACTION, HIGH); // ባዘሩን ያብሩ
Serial.println("ተገኝቷል!");
} else {
digitalWrite(ACTION, LOW); // ባዘሩን ያጥፉ
Serial.println("ምንም");
}
delay(200);
}
ይህ የኮድ ክፍል የሆል ዳሳሹን ሁኔታ ያለማቋረጥ ይፈትሻል። ዳሳሹ መግነጢሳዊ መስክ ካገኘ (የdetected ዋጋ LOW ሲሆን)፣ ባዘሩን ያብራል እና "ተገኝቷል!" በሴሪያል ሞኒተር ላይ ያትማል። ምንም መስክ ካልተገኘ፣ ባዘሩን ያጠፋል እና "ምንም" ያትማል።
ማሳያ / ምን እንደሚጠበቅ
ኮዱን ሲያሂዱ፣ አርዱኖ ለማንኛውም መግነጢሳዊ መስክ የሆል ዳሳሹን ያለማቋረጥ ይከታተላል። መግነጢሳዊ መስክ ከተገኘ፣ ባዘሩ ይቃጠላል፣ እና "ተገኝቷል!" በሴሪያል ሞኒተር ላይ ሲታተም ያያሉ። ምንም መግነጢሳዊ መስክ ከሌለ፣ ባዘሩ ጠፍቶ ይቆያል፣ እና "ምንም" ይታያል። የተገላቢጦሽ ግንኙነቶችን ለማስቀረት በሽቦ ግንኙነት ላይ ይጠንቀቁ፣ ይህም የመለየት ችግር ሊያስከትል ይችላል (በቪዲዮው 06:15 ላይ)።
የቪዲዮ ጊዜ ምልክቶች
- 00:00 - ለሆል ዳሳሽ ሞጁል መግቢያ
- 02:30 - የሽቦ ግንኙነት ማብራሪያ
- 05:00 - የኮድ ማብራሪያ
- 08:15 - ማሳያ
/*
* This is the Arduino code for a Hall Sensor module for Arduino.
// Written for Robojax.com video
* A Hall sensor switch will detect the magnetic field, and the module is used to trigger something.
* Watch the video for details: https://youtu.be/QH1Lw9BwTJI
* Code is available at: http://robojax.com/learn/arduino
*
Written by Ahmad Nejrabi for Robojax.com
on January 28, 2018 at 19:41 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.
*
*/
/*
*/
// Hall Sensor code for Robojax.com
#define DETECT 2 // pin 2 for sensor
#define ACTION 8 // pin 8 for action to do something
void setup() {
Serial.begin(9600);
Serial.println("Robojax.com Hall Module Test");
pinMode(DETECT, INPUT);//define detect input pin
pinMode(ACTION, OUTPUT);//define ACTION output pin
// Flame sensor code for Robojax.com
}
void loop() {
// Hall Sensor code for Robojax.com
int detected = digitalRead(DETECT);// read Hall sensor
int detectedAn = analogRead(A0);// read flame analog value
if( detected == LOW)
{
digitalWrite(ACTION,HIGH);// set the buzzer ON
Serial.println("Detected!");
// Serial.println(detectedAn);// print analog value
}else{
digitalWrite(ACTION,LOW); // Set the buzzer OFF
Serial.println("Nothing");
// Hall Sensor code for Robojax.com
}
delay(200);
}
እንደሚያስፈልግዎት ይችላል
-
አማዞን
-
አማዞን
-
አሊኤክስፕሬስBuy KY-024 Linear Magnetic Hall Switch from AliExpresss.click.aliexpress.com
-
አሊኤክስፕሬስBuy KY-024 Linear Magnetic Hall Switch from AliExpress (2)s.click.aliexpress.com
ምንጮች እና ምንጮች
-
ውስጥHall Sensor Datasheet (PDF)elecrow.com
ፋይሎች📁
የዳታ ማዕከል (pdf)
-
SS49E_SS39ET_SS59ET_hall_sensor_honeywell_49EThe SS39ET/SS49E/SS59ET Series low-cost linear Hall-effect sensor ICs are small, versatile devices that are operated by the magnetic field from a permanent magnet or an electromagnet. They are designed and manufactured for cost competitiveness. The linear sourcing output voltage is set by the supply voltage and varies in proportion to the strength of the magnetic field. Low voltage capability as low as 2.7 Vdc and reduced current consumption of only 6 mA typically at 5 Vdc help make this product energy efficient. The integrated circuitry features low noise output, which makes it unnecessary to use external filtering. These sensor ICs Interface with many electrical components without buffering. They also include thin film resistors to provide increased temperature stability and accuracy. These linear Hall-effect sensor ICs have an operating temperature range of -40 °C to 100°C [-40 °F to 212 °F], appropriate for industrial and medical environments. Thermal balancing allows for stable operation over the full temperature range. They are available in three package styles, all of which may be supplied on tape for automated, lower-cost assembly: • SOT-23: SS39ET. This small footprint takes up less space on the PC board, typically allowing for more components. • Flat TO-92-style, with different lead configurations: SS49E, SS49E-L, SS49E-F. • SOT-89B: SS59ET.
SS49E_SS39ET_hall_sensor_honeywell_49E.pdf0.98 MB -
49E YANGZHOU Hall-effect linear hall sensorThe 49E Series Economical Linear Hall-effect sensors are small, versatile linear Hall-effect devices that are operated by the magnetic field from a permanent magnet or an electromagnet. The linear sourcing output voltage is set by the supply voltage and varies in proportion to the strength of the magnetic field. The integrated circuitry features low noise output, which makes it unnecessary to use external filtering. It also includes thin film resistors to provide increased temperature stability and accuracy. These linear Hall sensors have an operating temperature range of -40 °C to 100 °C, appropriate for commercial, consumer, and industrial environments.
49E_YANGZHOU_Hall-effect_linear_hall_sensor.pdf0.49 MB -
SS49E SS39ET Hall Sensor Honeywell 49EDatasheet for Honeywell SS49E and SS39ET linear Hall-effect sensor ICs. These sensors provide analog output proportional to magnetic flux density, operate from 4.5V to 10.5V, and are available in a small SIP package.
SS49E_SS39ET_hall_sensor_honeywell_49E.pdf0.98 MB