Digital_magnetic_sensor_(SKU__DFR0033) - jimaobian/DFRobotWiki GitHub Wiki

Digital magnetic sensor (SKU: DFR0033)

Introduction

The magnetic sensor can be used on magnetic (magnet) detection, detection range up to about 3cm (detection range and the strength of the magnetic).

Specification

  • Voltage: +3.3-5V
  • Pin Definition :1 - Output 2 - Power 3 - to
  • Weight: 5g

Connection diagram

Digital magnetic sensor (SKU: DFR0033)

Sample code

#include <Wire.h>
int magPin=3;
void setup()
{
 Serial.begin(9600);
 Serial.println("magnet:");
 pinMode(magPin,INPUT);
}
 int val;
void loop()
{
  val=digitalRead(magPin);
  Serial.println(val);
}

image:nextredirectltr.pngGo shopping digital magnetic sensor (sku: dfr0033)

category: Product Manual category: DFR Series category: Sensors category:source category:Diagram

⚠️ **GitHub.com Fallback** ⚠️