La livraison gratuite de plus de 1000DH
Capteur de porte/fenêtre MC38 Interrupteur magnétique (FERME)
22.00 د.م.
84 en stock
UGS : CM053 Catégorie : VIBRATION - RADAR - MAGNETIQUE Étiquettes : Capteur, Door, Fenêtre, Interrupteur, Magnetic, Magnétique, MC38, Porte, Sensor, Window
Tutoriel : Utilisation MC38 interrupteur magnétique avec arduino (English)
Hardware Components
| Arduino UNO R3 | × | 1 | |
| MC-38 Magnetic Sensor Anti Theft Alarm | × | 1 | |
| Male to Female jumper wire | × | 1 |
Software Apps
| Arduino IDE |
Interfacing MC-38 Magnetic Sensor Anti Theft Alarm with Arduino
Step 1: Circuit
The following circuit shows how you should connect Arduino to MC-38 module. Connect wires accordingly.

Step 2: Code
Upload the following code to your Arduino. This code displays the status of the switch in the serial window.
/*
* Code d'exemple pour un capteur magnétique MC-38.
* Réaliser par Micro-Electroniques Générales au Maroc
* Visite notre site megma.ma
*/
const int magnet_switch = 2; // Magnet switch
const int ledPin = 13; // LED pin
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(magnet_switch, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
if (digitalRead(magnet_switch) == LOW) {
Serial.println("Switch Closed");
digitalWrite(ledPin, HIGH);
while (digitalRead(magnet_switch) == LOW) {}
}
else {
digitalWrite(ledPin, LOW);
}
} Soyez le premier à laisser votre avis sur “Capteur de porte/fenêtre MC38 Interrupteur magnétique (FERME)”Annuler la réponse
Produits similaires

Capteur Gaz MQ2
35.00 د.م.CM006
MLX90614 Capteur De Température Humaine Sans Contact
160.00 د.م.CM030
Capteur capacitif humidité du sol V1.2
40.00 د.م.CM013
Capteur Vibration céramique piézo + Module contrôleur analogique
35.00 د.م.CM027






Avis
Il n’y a pas encore d’avis.