Luka Code

Code ya Arduino mpe Video ya Module ya Senseur ya Hall KY-024

Code ya Arduino mpe Video ya Module ya Senseur ya Hall KY-024

Na boyekoli oyo, tokotalela ndenge ya kosalela module ya senseur ya Hall KY-024 na Arduino mpo na koyeba ba champs ya magnetiki. Senseur ya Hall ekosalelama mpo na kopelisa likambo moko ntango emoni champ ya magnetiki, mpe tokotalisa ba résultats na Serial Monitor. Nsuka ezali ndenge ya pete mpe ya kitoko ya kosangisa boyoki ya magnetiki na ba projets na yo, mpo na kopesa yo moboko mpo na kokola lisusu. Mpo na ba ndimbola ya mingi, tala video (na video na 00:00).

3144 hall sensor module
module ya senseur ya Hall 3144 motane
3144 hall sensor module
3144 hall sensor module

Biloko ya Matériel

Module ya senseur ya Hall esalemi mpo na koyeba ba champs ya magnetiki mpe esalelamaka mingi na ba applications ndenge na ndenge, lokola koyeba bopembeni mpe koyeba vitesse. Ntango champ ya magnetiki ezali, senseur ebimisaka signal oyo Arduino akoki kotanga. Oyo epesaka Arduino boyebi ya ntango oyo eloko moko na champ ya magnetiki ezali pembeni.

Na projet oyo, tokosalela mpe buzzer lokola eloko ya kosala. Ntango senseur ya Hall emoni champ ya magnetiki, Arduino akopelisa buzzer mpo na kopesa makelele ya koyoka. Ba composants ya liboso oyo esangani ezali senseur ya Hall, carte ya Arduino, mpe buzzer.

Ba Détails ya Datasheet

Mosali Honeywell
Numéro ya eteni SS495A1
Tension ya logique/IO 4.5 – 10 V
Tension ya alimentation 4.5 – 10 V
Courant ya sortie (na canal) 20 mA max
Courant ya pointe (na canal) 50 mA max
Motindiki ya fréquence PWM N/A
Ba seuils ya logique ya entrée 0.7 V (élevé), 0.3 V (faible)
Chute ya tension / RDS(on) / saturation 0.4 V max
Ba limites ya température -40 to +85 °C
Paquet TO-92
Ba notes / ba variantes Ezali na ba sensibilités ndenge na ndenge

 

  • Kokamba ete alimentation ezali na kati ya intervalle ya tension oyo ekomami.
  • Keba na ba limites ya courant ya sortie mpo na koboya kobebisa module.
  • Salela résistance ya pull-up soki esengeli mpo na ba lectures ya semba.
  • Kotika senseur mosika na ba champs ya électromagnétique makasi oyo ekoki kosala interférence.
  • Kobongisa senseur kolanda ba besoins ya application particulier.

Ba Instructions ya Câblage

Arduino wiring for 3144 Hal sensor module (black)
Arduino wiring for 3144 Hal sensor module (black)
Arduino wiring for 3144 Hal sensor module
Arduino wiring for 3144 Hal sensor module

Mpo na kokangisa module ya senseur ya Hall na Arduino, banda na kokangisa pin ya VCC ya senseur na pin ya 5V ya Arduino mpo na puissance. Na sima, kokangisa pin ya GND na pin ya GND ya Arduino mpo na kokokisa circuit. Pin ya sortie ya senseur ya Hall, oyo mingi ekomami lokola OUT, esengeli kokangama na pin ya digitale 2 na Arduino.

Mpo na buzzer, kokangisa terminal ya positif na pin ya digitale 8 na Arduino, mpe kokangisa terminal ya négatif na GND. Ndenge oyo epesaka Arduino makoki ya kotanga sortie ya senseur mpe kopelisa buzzer ntango champ ya magnetiki emonani.

3144 hall sensor module black

Ba Exemples ya Code & Explication

Code oyo elandaka ebandisaka senseur ya Hall mpe buzzer. Efinir ba pins mpo na senseur mpe mpo na likambo ya kosala. Boucle ya liboso etangaka état ya senseur mpe epelisaka buzzer kolanda yango.


#define DETECT 2 // pin 2 mpo na senseur
#define ACTION 8 // pin 8 mpo na kosala likambo moko

void setup() {
  Serial.begin(9600);
  pinMode(DETECT, INPUT); // définir pin ya entrée ya détection
  pinMode(ACTION, OUTPUT); // définir pin ya sortie ya ACTION
}

Na code oyo, variable DETECT ekomami na pin 2, oyo esalelamaka mpo na kotanga senseur. Variable ACTION ekomami na pin 8, epai buzzer ekangami. Fonction ya setup ebandisaka communication ya série mpe esengaka ba modes ya pins.

Wirig relay module to AC load
3144 hall sensor module

void loop() {
  int detected = digitalRead(DETECT); // tanga senseur ya Hall
  if (detected == LOW) {
    digitalWrite(ACTION, HIGH); // pelisa buzzer
    Serial.println("Detected!");
  } else {
    digitalWrite(ACTION, LOW); // zimisa buzzer
    Serial.println("Nothing");
  }
  delay(200);
}

Eteni oyo ya code etalaka ntango nyonso état ya senseur ya Hall. Soki senseur emoni champ ya magnetiki (ntango detected ezali LOW), epelisaka buzzer mpe ekomaka "Detected!" na Serial Monitor. Soki champ moko te emonani, ezimisaka buzzer mpe ekomaka "Nothing".

Démonstration / Nini Okoki Kozela

Ntango okosalela code, Arduino akotalaka ntango nyonso senseur ya Hall mpo na champ ya magnetiki nyonso. Soki champ ya magnetiki emonani, buzzer akoloba, mpe okomona "Detected!" ekomami na Serial Monitor. Soki champ ya magnetiki ezali te, buzzer akotikala ya kufa, mpe "Nothing" ekomonama. Keba na câblage mpo na koboya ba connexions oyo ebongolami, oyo ekoki komema na echec ya détection (na video na 06:15).

Ba Timestamps ya Video

  • 00:00 - Introduction na Module ya Senseur ya Hall
  • 02:30 - Explication ya Câblage
  • 05:00 - Explication ya Code
  • 08:15 - Démonstration

Images

Wirig relay module to AC load
Wirig relay module to AC load
3144 hall sensor module black
3144 hall sensor module black
3144 hall sensor module
3144 hall sensor module
3144 hall sensor module
3144 hall sensor module
3144 hall sensor module
3144 hall sensor module red
Arduino wiring for 3144 Hal sensor module (black)
Arduino wiring for 3144 Hal sensor module (black)
Arduino wiring for 3144 Hal sensor module
Arduino wiring for 3144 Hal sensor module
3144 hall sensor module
3144 hall sensor module
65-Hall sensor module for Arduino
Langue: C++
/*
 * 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);
}

Mokili na bisika

Fichiers📁

Fiche technique (pdf)

  • SS49E_SS39ET_SS59ET_hall_sensor_honeywell_49E
    The 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.pdf 0.98 MB
  • 49E YANGZHOU Hall-effect linear hall sensor
    The 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.pdf 0.49 MB
  • SS49E SS39ET Hall Sensor Honeywell 49E
    Datasheet 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.pdf 0.98 MB