• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Moderate Digital Hall Sensor Question

Status
Not open for further replies.

iso9001

New Member
I have this digital hall effect sensor that is hooked up to a processor that reads the pulses of a rotating shaft. I changed the shaft size and number of gears on this shaft and now the processor gets the wrong rpm of the shaft. I need to make this processor think i'm still using the old shaft...

Problem is the Signal wire on the sensor is getting 5V *FROM* the processor and not the other way around (sensor sending out low pulses). It looks to be that the processor is monitoring the 5V its sending out, whenever a gear tooth goes by it grounds out the signal wire, the processor sees this, and thus knows the speed.

Anyone have any ideas on how to do this for all freqs from 0-2000Hz... I'm coding in C so I have some flexiblity there.

The only thing I have right now is:

delay half the time in uS of the freq, output_low (ground the pin), delay_us then set it back to floating... repeat.

Any ideas ?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
iso9001 said:
I have this digital hall effect sensor that is hooked up to a processor that reads the pulses of a rotating shaft. I changed the shaft size and number of gears on this shaft and now the processor gets the wrong rpm of the shaft. I need to make this processor think i'm still using the old shaft...

Problem is the Signal wire on the sensor is getting 5V *FROM* the processor and not the other way around (sensor sending out low pulses). It looks to be that the processor is monitoring the 5V its sending out, whenever a gear tooth goes by it grounds out the signal wire, the processor sees this, and thus knows the speed.

Anyone have any ideas on how to do this for all freqs from 0-2000Hz... I'm coding in C so I have some flexiblity there.

The only thing I have right now is:

delay half the time in uS of the freq, output_low (ground the pin), delay_us then set it back to floating... repeat.

Any ideas ?
It sounds like there's a pull-up resistor on the processor board, it's unlikely that you would need to float the output - simply high or low should be perfectly OK. If you do have to float the output, you could either use RA4 (which is often open collector on PIC's), or set the output permanently low and switch the pin from output to input using the TRIS register.
 

Roff

Well-Known Member
How does the processor use the info from the Hall sensor? For example, does it simply display RPM, or control the shaft rotation speed, or...?
 

iso9001

New Member
The original processor does use a lot of info from the hall sensor. MANY MANY things are conrtoled by the units speed. So when I do this, it needs to be as accurate as possible. I dont know how accurate I can get this, but I know the original system keeps the speed plus a single decimal point. But, its just counting a number of gears, so I should be fine using ints and whatnot.

I did get my thoery to work. The original system has a wire going to the hall sensor that is 5V, when a gear goes by the hall is grounds that signal. Thier proc. waits for the signal to go low. That way it knows whats going on.

If I divert that signal wire to my pic instead of the hall sensor and set the output to low, it effectivly grounds that signal. I set it to float b/c I have 5V coming IN to the pic, to ground it i OUTPUT low, if I were to output high, I'm not sure what would happen. Remeber I have 5V coming in already. I might be able to set it to Input to do the same thing, but it works well this way.

So I can set the pic to make a 100Hz signal that fools the gauge to go up to 400rpm or such.

Right now I'm making the pic into an imaginary hall sensor. The final goal here is to

1.read in from a hall sensor (4 large gears)
2.multiply it by a certain coeffiecent (the origal system had 100 small gears)
3.then output the 'imagainary' hall sensor info to the processor (ie: that original signal x 25 or so, and space the output over an even time so that the % of the freq is about 50%... the 50% is b/c if I sent all the pulses out real quick, like at 10% it would spike the speed and then wait untill the next signal, I want an even flow, so there is no telling that the signal is different from the original setup)

To top it all off I need this to all be in interupts so that the pic can also do two or three ohter minor functions (if input(A_2) >> output(B_4))

I'm coding in C, but I dont even have a good algorithm to go on yet.
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top