Need help with Reed Switch and it's functioning (What is DD in it?)

Hey everyone!

I'm making a project on a magnetic door which makes an LED light glow when the door is brought close to the reed switch (the door contains a magnet) using an Arduino

I bought a "Rees52, Magnetic Switch Reed Switch Sensor Module: DC 3.3V~5V For Photocopiers /Washing Machines / Refrigerators /Door".

I'm following this guide -

In the guide above, there are only 2 terminals to the reed switch but the reed switch that I bought has 3 terminals (VCC, Ground and D0)
I googled hours and hours but couldn't find what does this D0 mean. I'll post the image of the reed switch that I bought

Also, ignoring DD doesn't give me any output.

I need help here.

Here's the image -

So this is the condition.

My question is - What is this D0? My device doesn't work as followed by the guide even with the help of a professor and he told me to post a question here. I really need help to get the reed switch working and the LED light glowing but this D0 is out of my understanding. Please help me connect the D0 properly on my Arduino.


I think "DO" is "Digital Output". The fact the switch has Vcc and Gnd makes me think it's going to pull the output one way or the other if the switch is inactive, and then it goes the other way when it's active.

That's to save you from having to do the pulling up or down yourself, which of course on an Arduino is dead simple for the pullup case.

So, if you put 5V and ground on, what reading do you get on the DO pin (measured to ground) with the switch in its normal position and activated by the magnet?

In other words, now that I looked at the Instructable, I think your module is actually what I've chopped out from there into this pic. (Although the resistor could be either a pull up or pull down: you'll need to figure that out.)

reed module.GIF

reed module.GIF

And if you can't figure out how the module works, or it's stuffed, you could just clip some wires on and use it like in the Instructable. Or cut the switch off?

reed module wires.GIF

reed module wires.GIF

So, if you put 5V and ground on, what reading do you get on the DO pin (measured to ground) with the switch in its normal position and activated by the magnet?

Thanks for your answer. It doesn't make a difference. The LED just keeps glowing. Nothing to show.

And yes, I'll try clipping a few wires to the +be and -ve of the Reed Switch and try it. I've to go to my college to try it because I don't have clipping wires. I'll report the readings later.

But it's really, really weird that even after the right coding, I'm just getting a glowing LED all the time.

even after the right coding,

Well we only have your word for that, and that the circuit's the same as in the Instructable.

You should copy YOUR code to a post here, along with a decent photo and sketch of YOUR circuit.

Have you tried with a circuit like that Instructable, but instead of the switch just use a piece of wire to make/break the circuit? That way, you'll check that the circuit apart from the switch is ok, and the code's right.

reed module short.GIF

I don't have clipping wires

I'm sure you can find some wire somewhere and just twist them on, or get someone to hold them if you ran out of hands.

reed module short.GIF

Have you got a voltmeter to measure the voltage across DO and ground with the switch open and closed?

Or alternatively, stick your led and series resistor across DO and ground, with nothing connected to the Arduino except maybe borrowing its 5V and ground to power the module.

In fact, I wonder if one of those components on the module IS an led, if so what does it do?

And as a very last resort, have you found any documentation for that module :wink:

I wonder what its potentiometer does: perhaps it's some kind of sensitivity thing to adjust the line between digital high and low, maybe it needs moving.

And here's another thought: if you're using a breadboard, are the power rails continuous? Look at the red and blue lines and see if they go from end to end or if they break in the middle. If they break, so does the power, and then you might not (depending on where you jam the wires in) actually have the power and ground connected as you hoped.

breadboard power not split.GIF

breadboard power split.GIF

breadboard power not split.GIF

breadboard power split.GIF

I believe that the reed switch module is adapted from a common module designed to read sensors with an analog output(like a photosensor or ldr) which is then fed to a comparator(lm393) for conversion to a digital output(DO) at a level set by the potentiometer. It's evidently inexpensive enough to use it as a mounting platform for something which does not require the circuitry.

If you are not seeing HIGH/LOW output on DO with the magnet near and far, you might have to adjust the potentiometer to get the digital output when the switch is open or closed.