Magnetic reed contact

I was looking for an external contact, to be used with Littlebit circuits instead of the I3 pushbutton.
After some experiments with the protobit I tried a reed switch and it worked !
I will share the outcome of my experiment with this reed switch.
It could be used to detect the position of a stepper motor (see the forum topic from @chris101.


Or a secret chess board contact as @Eidrog is thinking of…

What is a reed contact ?
A reed contact is a little glass tube with a contact inside that can be closed and opened with an external magnetic field.

I connected this reed contact to the proto bit, using the same circuit as used for the I3 button.
With this magnetic contact a lot of inputs can be realised in Littlebit projects.

See also the YouTube video: https://www.youtube.com/watch?v=51rLlwiCzfI

.

1 Like

Verry cool @alexpikkert, excellent rapid prototyping! The kind that littleBits is so great for.

In your video it appeared that the reed switch did not always trigger right away - you had to sometimes fiddle with the position. does one orientation of the magnet close the switch, and the other way around hold it open? I should probably get one of these and experiment, eh.

1 Like

Oh wow @alexpikkert, that looks like a terrific solution for hiding a secret circuit in a chessboard! Like @chris101 mentioned, I’m curious that the circuit seemed to struggle just a hair when approached the last time, nevertheless, I really want to try this out!! Thanks for sharing! :smiley:

1 Like

Hi @chris101,
I checked the specifications of the reed switches in various documents on the internet.
There are a lot of misinterpretations. but finally I found the truth (I think…).
The contacts themselves are not made from magnetic material but they become magnets under the influence of the magnetic field lines from the external magnet.
I made a small video to explain how they are always attracted to each other and checked it in reality.
(The proof of the pudding is in the eating)…
I have a little microscope (10x magnifying factor) with built-in camera connected to my PC and took a detailed look at my reed switch. You can see the contacts open and close as explained by the theory.!
You were right, the position of the magnet (and its field lines) is important. The video explains it all.

See: https://www.youtube.com/watch?v=hbhifedV6oA

:smile:
.

1 Like

Hi, @alexpikkert. I’m replying to your question about this project from another post. I think it is a fine submission to the bitlab. I, myself, have been (slowly) working on a hall effect sensor, which is quite similar to a reed switch. You can see this type of sensor in this project: http://littlebits.cc/projects/bike-tachometer

If I had a wish for your reed switch circuit, it would be to have a slide switch that would give the maker a choice as to whether the circuit should output high or low in the presence of a magnet without needing to use an inverter. What do you think?

2 Likes

Hi @JackANDJude,
Thanks for your comment, I will submit my reed switch to the bitlab and will mention some applications also.
I know there are reed switches on the market with a change-over contact. So you can select NO normally open or NC normally closed. (High or low in the Littlebits SIG line).
But I do not have this version, but I will submit the diagram for this version together with the NO type.

Nice bike-tachometer !

1 Like

Nicely explained Alex! Now I get it. You are a fine teacher.

1 Like

+1 for the idea of a reed-switch bit. :smiley: (if it could be set to either NO or NC that would be amazing!)

@Eidrog
I submitted the prototype to the Bitlab today including NO NC mode switch (as suggested by @JackANDJude) . Let’s wait and see…

1 Like

Is there’s anyway I can show support for the bit? :open_mouth: I think it’s really fantastic, but I couldn’t find it in the bitlab. :fearful: My apologies if this is a really newbie question. :flushed:

1 Like

Hello @Eidrog,
It is a good question. :slight_smile:
I submitted the design and after that it takes some time before it will be published in the bitlab (or not, it could also be rejected by the Littlibits team…)
When published you can vote on it and ask more people to vote by sending them the link or putting it on other social media…
So let’s wait and see…

Hey @alexpikkert!

After playing with optical position sensors for my current project, I have concluded (as you probably predicted) that a reed switch would be the best solution to positioning the stepper. So I built one, using your OP original post) above as a guide. The extra circuitry you see below is there to smooth out the signal, so it’s now a 'nice, Arduino friendly HIGH or LOW.

Here’s the device I made:

It’s schematic:

And it actually worked first time I tried it!

Oh, if anyone else tries this, be careful with the glass envelope!

Of course, I’d MUCH rather have just snapped in a Bit, so:

"Hey everyone! Go vote for Alex’s Magnetic Reed Switch module in the BitLab!!!

2 Likes

Hi Chris @chris101,
Great reed contact bit you made !
There is a big difference in your design however, compared with the bit I submitted to the bitlab…
Yours is a real “input” bit that has only an output bitsnap and needs no power or other bits connected. The pushbutton bit I based my reed contact design on is in fact just transferring the signal from the left SIG connection to the right SIG connection… When not pushed, the right SIG connection is kept low via a 1 Mohm resistor. (or 100 kohm in the roller switch). And it has a small capacitor to GND I think is only there for minimising a possible bouncing effect.
Your contact is connecting the right SIG directly to GND. I am not sure if this might hurt other bits in the system because of a direct shortcircuit of the SIG line…
. For example the power bits feed +5 Volt directly on the SIG line.
The design of the normal LB pushbutton diagram results in the fact that you must always connect a power bit or another bit on the left side when using it, else it will not work.
You made the first bit with only an output bitsnap ! I think this might be a real new thing !

PS
I understand your diagram with the 10 kohm resistor and the capacitor, but I do not see the effect of the diode and the 470 ohm parallel resistor. The SIG line has always a plus voltage so the diode will always conduct. (?)

1 Like

Hey-ya Alex! (@alexpikkert), thanks!

I broke all kinds of littleBits’ module rules with this one, but it’s only intended to be connected to an Arduino input pin. I wanted the pin to be HIGH when open and LOW when closed. In the Arduino sketch, I initialize the pin it’s on with pinMode(theSwitch, INPUT_PULLUP); so it is normally HIGH.When the switch is closed (ie approached by a magnet), it goes LOW. Since I don’t intend to connect it to a power bit, I didn’t worry about protecting it, or any other upstream bits (and as you noticed, there isn’t even an input bitSnap for that.)

The extra resistor and diode are there (I believe) to force the capacitor to keep the SIG LOW for a moment during a “bounce-open” of the switch. I got this circuit by googling “debounce reed switch”, and looking at the image from that search. I followed the image back to a thread on the forum.arduino.cc site, and the logic explained there made sense to me, so I built it that way. The circuit does work without the diode and second resistor, but it didn’t seem to work quite as smoothly when I tried it on the breadboard. It’s kind of hard to tell though, when hand holding the magnet.

This device is now in my first stepper project, which I finished last evening. I’m in the process of documenting it now. I hope to post it before Friday morning, as I’m flying back to Michigan then so I can drive my family home after their summer vacation there (I drove them there a month or so ago.) I’m going to spend a few days, then head back to Arizona.

2 Likes