La livraison gratuite de plus de 1000DH
Capteur de porte/fenêtre MC38 Interrupteur magnétique (FERME)
22.00 د.م.
94 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 ECG AD8232
120.00 د.م.CM031
Capteur Gaz MQ135
35.00 د.م.CM007
CAPTEUR DE VIBRATION SW-420
25.00 د.م.CM024
Capteur Empreintes Digitales FPM10A
180.00 د.م.CM026






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