I was messing around with a reed switch and magnet for a bike computer project
(more of a tinker) I was having.
I found an unusual response from the reed switch, however. The circuit is shown
below (only capacitance is that of the scope probe) and the corresponding pulse
obtained is also shown.
I might have expected the leading edge to have bounced somewhat (it didnt) and
the trailing edge to be the same as the leading edge, but there was a pronounced
slope to it.....I thought maybe that the switch was becoming saturated (fast
turn on, slow off) but the slope got no better or worse depending upon the
magnet "range."
I admit to not knowing too much about reed switches....but I would have thought
this was abnormal. Can anyone enlighten me? The switch isnt mercury wetted (as
far as I know). The magnet was a plain "bar" type, too.
the reed switch is just a couple of bits of metal that are quite close to each other but lightly
sprung apart.
The proximity of a magnet sets up a field in each of the bits of metal that attracts them to each
other (bad explanation, probably technicaly inaccurate, but it'll do ;))
you get the slow rise to the waveform because the only thing pulling the voltage up is your
resistor, into some capacitance. time=capacitance*resistance.
Make the resistor smaller you get a faster rise time.
the presence / absence of bounces depends on the mechanical properties of the switch.
if you need the waveform out of the switch to look nice then place a capacitor accross the switch,
chosing a value that will give you a time constant that is a lot smaller than the data rate (how
fast does your wheel spin ?) a ratio of about 2 decades (100 to 1) is probably ok. This will give a
waveform without too much bounce on it, but it will have slow edges. You can fix that by feeding the
signal into a schmitt input gate... the PICs I have used have schmitt inputs on a lot of their
pins... it's in the datasheet. if it's not going to a pic then use a standard logic part, or
whatever else tickles your fancy.
> -----Original Message-----
> From: Simon Nield [SMTP:simon.nieldKILLspamQUANTEL.COM]
> Sent: Friday, July 28, 2000 10:11 AM
> To: .....PICLISTKILLspam.....MITVMA.MIT.EDU
> Subject: Re: [OT]: Reed switch responses
>
> the reed switch is just a couple of bits of metal that are quite close to
> each other but lightly
> sprung apart.
> The proximity of a magnet sets up a field in each of the bits of metal
> that attracts them to each
> other (bad explanation, probably technicaly inaccurate, but it'll do ;))
>
> you get the slow rise to the waveform because the only thing pulling the
> voltage up is your
> resistor, into some capacitance. time=capacitance*resistance.
> Make the resistor smaller you get a faster rise time.
>
Only thing here is, looking at Dan's diagram the whole pulse is 10ms wide,
and the rising edge looks like it is nearly half of the entire pulse time
(assuming recently calibrated ASCII art!!).
0.005/10000 = 0.5uF !!!
Thats a awfully high capacitive load, esp. for a scope which should be in
the low pF range. Dan, are you sure you actually have a 10K resistor and
not a 10M by mistake?
part 1 2684 bytes content-type:text/plain; charset=us-ascii
Hi,
Definately 10K.....I measured it and was using the exact same resistor for an
I2C pull up (I'm short of components at home ;-) I didnt have any decent lower
value resistors or capactors at hand (as Simon suggested) but I'll be a bit
better equipped for this weekend.....in terms of time, too - better than the 10
minute play I had last night
The ascii art is a bit limited in terms of defining slopes, I agree, but the
trailing edge rise time was in the proportion shown (which is why I thought it
odd, also)......As to my previous mail, it couldnt be saturation as I daftly
suggested - it should have opened like a switch. I'll just shorten the wires,
try a lower value resistor and see where it gets me.
At 09:57 AM 7/28/00 +0100, Dan wrote:
>I was messing around with a reed switch and magnet for a bike computer project
>(more of a tinker) I was having.
>I found an unusual response from the reed switch, however. The circuit is
>shown
>below (only capacitance is that of the scope probe) and the corresponding
>pulse
>obtained is also shown.
>
>I might have expected the leading edge to have bounced somewhat (it didnt) and
>the trailing edge to be the same as the leading edge, but there was a
>pronounced
>slope to it.....I thought maybe that the switch was becoming saturated (fast
>turn on, slow off) but the slope got no better or worse depending upon the
>magnet "range."
Although the mass of a reed switch might delay its closing by 1 ms, you
should get about a 10 us rise time on the closure.
Your rise time of 10 ms through a 10k resistor is roughly equivalent to 1
uF of capacitance in the system!
You mention your power source is "5 V current limited". What exactly does
"current limited" in this case mean?
================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: spamBeGoneralspamBeGonelcfltd.com
Least Cost Formulations, Ltd. URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239 Fax: 757-467-2947
"Vere scire est per causas scire"
================================================================
> Thats a awfully high capacitive load, esp. for a scope which should be in
> the low pF range
> Mike
A handy time to report back on my troubles with crystal oscillators. The
scope probe is faulty, might have been for a little while and the oscs
were the first sensitive device to make it be noticed. 29/30 of the cans
worked to varying useable degrees when looked at with another scope,
just took a couple of days to get to one. Unsure what the fault is as the
scope seems to do most other measurements OK. Definitely doesn't like
osc cans though
I think that either your 10K resistor is in fact 100K or higher or the
reed switch was designed for use in alarm systems and has a small
capacitor across the contacts. Is it molded ? If so then there is a very
high probability to the capacitor being there.
Peter
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements
> reed switch was designed for use in alarm systems and has a small
> capacitor across the contacts. Is it molded ? If so then there is a very
> high probability to the capacitor being there.
I never heard of such a thing.. (having installed a great many such
switches) That would be a very bad idea, the current on closure would
accelerate switch failure.
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements
Yes, but they are there ;) I have one at work, it must be about 15 years
old, and it has a 0.1 uF in it. It is NC so I have to put a 'contra'
magnet to it to open it to see the cap. I suppose that this answers your
'closing current' question. I think that someone worried about the
inductance of all that daisy chain wire with sense current in it being
interrupted suddenly. I happen to know that they were worried by this
after they lost some microcontrollers to mysterious failures (suspected
ESD/impulse damage on inputs).
You might also look at something called GMRR (Giant Magneto Resistive...
something or other). Basically they are little SO8's that can detect a
magnetic field and either put out porportional output or a logic level at
much higher sppeds than a reed switch. I think the company that made these
was called NVE?
Erik Reikes
Senior Software Engineer
Xsilogy, Inc.
>You might also look at something called GMRR (Giant Magneto Resistive...
>something or other). Basically they are little SO8's that can detect a
>magnetic field and either put out porportional output or a logic level at
>much higher sppeds than a reed switch. I think the company that made these
>was called NVE?
Philips also make these - part number is KMZ51
A "hall effect" sensor may be another option. Unlike a reed switch this
gives a proportional output related to not only the magnitude but also the
polarity of the magnetic field, ie. you can tell apart north and south poles
of a magnetic field.
I've never been too fond of reed switches because they
are sensitive to mechanical shock, at least the ones I dealt with
were. When I was an audio visual technician, I once saw a
special phonograph designed for some kind of paced learning
system that had metal pieces embedded in the record to be played
such that the player would stop when the arm reached certain
spots in the program. While it has been about 18 years or so
since I saw that device, I think I remember that it was in the
shop because the reed switch had erratic responses. A thump or
mechanical jolt would cause it to intermit and foul up the
program. I think there was a magnet under the turn table platter
and the metal slugs in the phonograph record blocked or
transmitted the field to the reed switch which was in the
magnetic path, somewhere. Anyway, it isn't rocket science that
these fragile things vibrate when struck, so I immediately
disliked the design.
If it's gona' be used in a schoolroom, mechanical shocks
are not only likely, but almost a certainty. At least this unit
didn't contain a live 22 caliber bullet like the one I found in
another phonograph, once.
Martin McCormick
Richard writes:
>A "hall effect" sensor may be another option. Unlike a reed switch this
>gives a proportional output related to not only the magnitude but also the
>polarity of the magnetic field, ie. you can tell apart north and south poles
>of a magnetic field.
>
>
>{Original Message removed}
part 1 1441 bytes content-type:text/plain; charset=us-ascii
Hi,
Thanks, Erik (and everyone else for their responses on this subject). I've
pretty much got the thing going nicely (after some initial 'finger trouble')....
You might also look at something called GMRR (Giant Magneto Resistive...
something or other). Basically they are little SO8's that can detect a
magnetic field and either put out porportional output or a logic level at
much higher sppeds than a reed switch. I think the company that made these
was called NVE?
Erik Reikes
Senior Software Engineer
Xsilogy, Inc.