I am working on a project where a microcontroller needs to read hall effect sensors. Could someone direct me to an information source that covers algorithms on how to count pulses from a hall effect sensor?. Note I can't use an input capture pin. I can only use an A to D input to read the hall input.
Thanks, Paul C
Didn't find your answer? Ask the community — no account required.
T
Thad Smith
There shouldn't be anything magic about hall sensors per se. Relevant questions:
Will there be any bounce on edges (probably not)?
What are the minimum pulse widths?
What is the cost of missing an edge?
If you can't trigger an interrupt on a transition, then you must poll fast enough to catch each edge transition. Otherwise, you need to either generate an interrupt or clock a counter with an edge.
Thad
D
Donald
formatting link
There are at least two kind of hall effect sensors.
One will have a proportional output to the strength of the magnetic field applied. The other is a switch that will change state with the magnetic field applied.
Which type of sensor do you have or want to use ??
donald
P
Paul
I am using a hall effect sensor that outputs a voltage proportional to the magnetic field strength applied.
I think what I need to do when using an A to D converter is. Establish a threshold. Compare the A to D value to the threshold. If the voltage is above the threshold a high pulse is occurring. If the voltage is below the threshold there is no pulse present.
What I am concerned about if there are details I need to include such as timing, or delays that I need to worry about?. I know that if I sample the A to D channel twice as fast as the signal frequency being applied I should be able to detect pulses with out error.
Thanks for the responses,
Paul C
D
Donald
I would not say without error.
Is the purpose to find pulses or for timing ?
Do you need to respond to a "high" within a preset time ?
You may need to sample many times the signal frequency to get timing information.
Good Luck
donald
G
Gary Reichlinger
Why (see below)?
This is what a Hall effect switch would do for you for less than what the analog Hall sensor costs. Unless you have something else going on in the circuit that actually uses the field strength readings, a Hall effect switch would be much better for this application.
If you used a Hall effect switch, you could extend the low time by adding a small capacitor to the circuit to be sure that a pulse did not go undetected.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.