Author Topic: Cleaning reed switch signal for speed measurement  (Read 1588 times)

0 Members and 1 Guest are viewing this topic.

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Cleaning reed switch signal for speed measurement
« on: October 18, 2018, 11:48:39 pm »
My old treadmdill has a reed switch attached. When the motor is running, the switching signal is extremely noisy, until the point that using input capture method to measure speed fails. I used a schmitt trigger inverter to see what happens, and the signal continues to be noisy. Would a comparator circuit like the one attached be better at this?

 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: Cleaning reed switch signal for speed measurement
« Reply #1 on: October 19, 2018, 12:01:59 am »
You'd need some kind of filtering - that's what you added on your schematic. You could also do the filtering on the MCU using simple debouncing techniques (but I guess in this case using a simple input capture peripheral would not cut it).

As for me, if modifying the device is possible, I would try and replace the reed switch with a Hall-effect sensor. Might still need some minor filtering, but the signal would be cleaner and life expectancy much higher.
 

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Re: Cleaning reed switch signal for speed measurement
« Reply #2 on: October 19, 2018, 12:08:47 am »
Okay. I will try the comparator circuit first. Would you modify something on it? Also, what do you think of those little hall effect modules for Arduino/Raspberry on Amazon and Ebay? Can I try with those?
 

Offline DaJMasta

  • Super Contributor
  • ***
  • Posts: 2296
  • Country: us
    • medpants.com
Re: Cleaning reed switch signal for speed measurement
« Reply #3 on: October 19, 2018, 12:33:30 am »
What kind of noise?  It could be vibration effecting the contacts in the reed switch, but it could also be noise induced in the switch wiring from the powered up motor - if it's picked up noise, getting rid of it could be as simple as some shielding or using a different cable to go out to the switch.


Otherwise, yeah, debouncing is a good approach.  If you can find that the noise has a pretty short period (maybe, 200ms or less?), you could put on an RC filter with a low cutoff frequency and run it through a schmitt trigger or a comparator and probably get good results, at least as long as the charge up time for the first impulse into the filter isn't too long as to be useful for the thing monitoring the relay.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: Cleaning reed switch signal for speed measurement
« Reply #4 on: October 19, 2018, 02:36:23 pm »
Try a clamp-on ferrite on the cable to the reed switch, near the end which connects to the controller board (not near the switch). This prevents the cable from becoming an antenna for EMI/RFI emitted by the motor.
 

Offline duak

  • Super Contributor
  • ***
  • Posts: 1041
  • Country: ca
Re: Cleaning reed switch signal for speed measurement
« Reply #5 on: October 19, 2018, 04:43:35 pm »
Without a 'scope waveform of the input signal it's hard to suggest a simple solution.

If it's RFI from the motor then a 1K0 resistor between the reed switch and the 104n cap will form a better filter.  This will also help with any contact bounce.

The filter will probably introduce a slew rate problem, ie., the sensed signal is not changing fast enough so adding hysteresis to the comparator will help,  This could be done with positive feedback from the comparator output to the + input with a 1M0 resistor and 1K0 resistor between the + input and the 104n capacitor.

Cheers,
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 838
  • Country: fr
Re: Cleaning reed switch signal for speed measurement
« Reply #6 on: October 19, 2018, 05:03:29 pm »
Measuring speed with reed switch?never heard of that.put a real sensor


Envoyé de mon iPad en utilisant Tapatalk
 

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Re: Cleaning reed switch signal for speed measurement
« Reply #7 on: October 19, 2018, 06:33:11 pm »
I really like the idea of dropping the reed switch and use an optical slot or reflective sensor. Look at the motor attached. I have seen many motors that bring physical spot for these sensors, but the motor I want control didn't bring it.
 

Offline perieanuo

  • Frequent Contributor
  • **
  • Posts: 838
  • Country: fr
Re: Cleaning reed switch signal for speed measurement
« Reply #8 on: October 22, 2018, 04:04:35 pm »
Hi,
Just put some reflexive on the pulley or put some screw and detect the screw with proximity sensor.very easy and clean
Pierre


Envoyé de mon iPad en utilisant Tapatalk
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf