board dev studio

Verified 2026-11

dfrobot Gravity: Digital Magnetic Sensor

Two-terminal magnetic switch on a 10 kOhm pull-up: one Gravity pin reads high with no magnet and low when one comes close.

Place this board on a carrier in the editor →

Logic level5 V

Part & documents

Sourcewww.dfrobot.com/product-233.html →

Pinout

3 pads, as the vendor numbers them.

#NameFunctionSignals
1Ddigital output, 470 ohm series, low when the switch closes
2VCCsupply in 3.3-5 V
3GNDground

Power

Input3.3-5 V on VCC

Notes

The board prints no pad numbers and the wiki publishes no pin table, so the 1-3 numbering is connector J1's own in DFRobot's schematic, where the pads are also labelled D, VCC and GND. The schematic is the only vendor document - no module datasheet exists and the magnetic element has no published part number, so datasheet_url is null and part is null. No supply current, absolute maximum, output drive or magnetic operate/release point is published for this board.

AI context

Dense context for pasting into a model prompt — addresses, pinout, voltages, tolerances and the vendor's reference circuit.

BOARD: DFRobot Gravity: Digital Magnetic Sensor, SKU DFR0033, 22 x 30 mm, one 3-pin Gravity connector (J1), one onboard indicator LED, one digital output and nothing else - no I2C device, no microcontroller. The product page states only that it reports whether a magnetic object is nearby, as a digital output.
ADDRESSES: none. The board has no bus device, so `addresses` is empty because nothing answers a scan, not because the address was lost.
PINOUT: three pads on the Gravity connector, numbered 1, 2, 3 as J1's own pads in DFRobot's schematic (footprint S3B_PH): pad 1 = D (digital output), pad 2 = VCC, pad 3 = GND. The full schematic labels them "1 D", "2 VCC", "3 GND" beside the connector, so the numbering and the labels come from the same vendor document; the board itself prints no pad numbers and the wiki publishes no pin table.
SUPPLY: DFRobot rates the module 3.3 V to 5 V. The output high level is set by the pull-up to VCC, so it tracks the supply - 3.3 V or 5 V, following whatever the host uses.
LOGIC LEVEL: R1 (marked 103, 10 kOhm) pulls the sensing node to VCC and the magnetic switch closes that node to GND, so the sensor is active-low: open switch reads high, closed switch reads low. R3 (marked 471, 470 ohm) sits in series between the sensing node and the D pad, which limits what a wrong cable can do to the switch. DFRobot publishes no absolute maximum, no output current and no operate/release field strength for this board or its switch, so none of those is stated here.
REFERENCE CIRCUIT, as built: R1 103 = 10 kOhm from VCC to the switch node; the "Mag" element (two terminals, pins 1 and 2) from that node to GND; R3 471 = 470 ohm from the node to J1 pad 1 (D); D1 LED with its anode on the D node and its cathode through R2 102 = 1 kOhm to GND; C1 104 = 0.1 uF across VCC and GND. The bill of materials is C1, D1, J1, the Mag element, R1, R2 and R3, so pull-up, series resistor, indicator and decoupling are all fitted.
TRAPS: the indicator LED hangs on the D node itself, so it is lit while the output is high (switch open, no magnet) and goes dark when the switch closes - a lit LED means no magnet, which is the reverse of what people assume. The magnetic element is drawn and listed only as "Mag": DFRobot publishes no part number for it, hence no silicon datasheet and `part` null. It is a two-terminal switch, so it can only report presence, never field strength, pole or direction - the Gravity Linear/Analog Hall (DFR1132) and BMM350 boards are the ones for that. Nothing on the board debounces the contact, so a slow-moving magnet produces chatter at the edge; debounce in firmware.

Provenance

Every figure on this page was read from the 3 sources below and last checked on Nov 1, 2026.