5

I put a reed switch ( https://en.wikipedia.org/wiki/Reed_switch ) on the handle of a measuring wheel (perambulator). The reed switch will be activated up to around 20 times per second (every 50 ms). The sampling rate on my data acquisition is 200 Hz (every 5 ms). The DAQ is made with an IOIO OTG ( https://en.wikipedia.org/wiki/IOIO ) and the analog input I use can handle (0-3) V. Should I go for a Schmitt trigger or do you have a more elegant solution on how to have a long enough output signal from the reed switch to safely sample it?

I am only interested in the time between activations of the reed switch. I plan to put a LED and a beeper to get a short noise and a flash of light for each. The input level to the IOIO OTG will be the 0.7 V due to the LED. There are 9 mm diameter neodymium magnets mounted on the wheel and the wheel has a circumference of 1 m. I put 10 magnets on the wheel and the approximately highest speed I will measure is 2 m/s. Then the wheel rotates twice per second and thus I have up to around 20 activations of the reed switch per second.

Since we know the circumference of the wheel (1 m) and the 10 magnets are evenly spread out, knowledge of the time between activation of the reed switch will give a good approximation of the speed.

Edit: Changed the text regarding the placement of the reed switch. The reed switch is next to the wheel and the 10 magnets are on the wheel. I want to have 10 magnets to get a good estimation of the walking speed of the person holding the measuring wheel.

I guess I could use a digital input instead. I didn't consider it would be a better option in this case.

Maybe I should clarify what I mean about 1 m circumference and 10 magnets. Between every reed switch output the wheel has travelled 10 cm. If the wheel rotates 2 times per second at fast walking speed (2 m/s) the reed switch will close 20 times per second.

phell
  • 53
  • 4
  • 2
    I'd use a one-shot triggered by the switch contact closure/opening, but I'm confused... If the magnets are on the wheel and the switch is also on the wheel, how does the switch get actuated? – EM Fields Mar 16 '16 at 10:26
  • 3
    Why are you using an analog input? The relay has 2 states that you are interesting in, open and closed. Use a digital input, its a lot easier, and then you will not be restricted to a 200Hz sampling rate. Also, why 10 magnets? Surely 1 is enough to tell the speed. If you need to extend the pulse output of the reed switch then a simple RC circuit will do that. – Steve G Mar 16 '16 at 10:43
  • I have edited the text in response to your comments. I want a ridiculously good estimation of walking speed since this will be a reference system. – phell Mar 16 '16 at 22:54
  • This sounds nutty. Where is walking speed measured? The hips, the head, shoulders? If the measuring wheel is hand-held at a constant angle and the arm held fairly rigidly then you might be measuring shoulder speed. I think it's meaningless other than, perhaps, to analyse posture - think John Cleese walking with knees bent, shoulders level but legs going everywhere. What are you really trying to measure? – Transistor Mar 16 '16 at 23:18
  • @transistor: I was thinking of having it mounted behind the person who I want to measure the walking speed on. Maybe with two smaller supporting wheels on the sides of the measuring wheel. What I really try to have is a good reference system for measuring the walking speed indoors. GPS will not work and accelerometer based devices are not great for this. – phell Mar 17 '16 at 07:38
  • I forgot to add my definition of walking speed. Measured at waist level would be ideal. One way of doing it would be to put a 3-axis accelerometer at the lower back and integrate to get the speed but this approach needs constantly adjusting for drift in the MEMS accelerometer device. – phell Mar 17 '16 at 08:22
  • @EM Fields: I will go with a monostable 555 circuit. I can't believe I never heard of it before. – phell Mar 17 '16 at 23:17
  • @transistor Unless I'm mistaken, your shoulder is connected to the rest of your body, so shoulder speed will be equivalent to body speed. Even if you were swinging your body like an inverted pendulum around your hips, you could easily calculate average forward velocity to a high degree of accuracy. Positional accuracy would be harder to determine, but there's nothing 'nutty' about trying to measure the velocity of a human at one point or another with the described system. – Anthony Mar 20 '16 at 12:37
  • @phell Is there a reason you're not using a quadrature encoder with a more standard encoding strip? You could measure much faster velocities and directionality with much more precision and accuracy than the described setup as most micro controllers natively decode quadrature signals these days. It would also most likely be more robust and cost less. – Anthony Mar 20 '16 at 12:39
  • @Anthony You are right about quadrature encoder. It seems easier to use the magnet approach on my wheel but your suggestion would probably be better. – phell Mar 21 '16 at 21:42

1 Answers1

2

With reed activations for every meter traveled and 200Hz sampling rate, you're effectively limited to 10 m/s in terms of speed you can reliably measure (if you have achieved a perfect 5ms pulse time from the reed). In non-ideal conditions, you should expect reliable operation at about a half of that speed, 5m/s or 18 km/h. Assuming a bicycle application, that's not much.

My point is, you should either increase the sampling rate or reduce the number of magnets you use. The latter is the easiest option, with 2 magnets you'll be able to measure speeds up to 90 km/h, which looks reasonable.

And here's the RC circuit Steve told you about in his comment. It has a time constant of 5ms, so you'll measure between 3 and 1V in the sample following a reed activation, and less that 1V in subsequent samples.

schematic

simulate this circuit – Schematic created using CircuitLab

Dmitry Grigoryev
  • 25,576
  • 5
  • 45
  • 106
  • I upvoted the answer since it is helpful and I had a feeling something like this would be more elegant than a Schmitt trigger. The upvote will show up once I reach a higher status. – phell Mar 16 '16 at 22:57