Pages: [1] 2   Go Down
Author Topic: Two wire hall effect gear sensor  (Read 1816 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a two-wire hall effect gear sensor I'm trying to get sensible readings from. It's an Allegro ATS682LSH (http://www.allegromicro.com/en/Products/Part_Numbers/0682/0682.pdf). The readings I'm getting don't make any sense.

Has anyone managed to get one of these working?

Thanks, Mark.
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That device looks impossible to hook up wrong. What do you mean by your readings not making sense? What did you expect and what did you get?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The readings were sporadic. I'd get random HIGH/LO values when no magnetic field was even present, let alone anywhere near a rotating gear.

- Mark.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That device is a two wire current loop output. One must wire a series resistor and use the voltage drop across the resistor as the signal output to be wired to a digital input. So what source voltage are you going to use? The spec say you can use anything between +4 and +24 volts. I assume you want to be able to wire it to a arduino digital input pin? If so and you don't wish to use any kind of op-amp comparitor circuit, you will have to carefully size the sensing resistor to ensure the the sensors high and low states are converted to legal high and low arduino logic voltage levels. I think around 200 ohms might work, assuming a +5vdc Vcc for the device, but I would want to test it out first.

Figure 7 shows a typical interface using a 100 ohm sensing resistor feeding a comparitor. Figure 4 shows both high side and low side interfacing using a series sensing resistor. Again this device is not as simple to interface to an arduino digital input pin as it might first appear as the sensor is a digital current output and the arduino digital input requires a voltage input, thus the need to convert the logic current signal to a logic voltage signal that meets the AVR legal digital voltage requirements.

So how are you wiring up the sensor to arduino presently?

Lefty
« Last Edit: July 28, 2011, 10:53:21 am by retrolefty » Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using the recommended Rsense value of 100 Ohms? Is Vcc between 4 and 24 Volts?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using the recommended Rsense value of 100 Ohms? Is Vcc between 4 and 24 Volts?

A 100 ohms resistor would only generate a maximum of around 1.8vdc for a 'high' state, not large enough to be read as a legal arduino logic high. That's why they show the 100 ohm resistor feeding a comparator.

Here are the possible current logic values possible output for the device:

Quote
ICC(LOW)  5.0        7       8.4 mA  // min typical max
ICC(HIGH) 11.8      14     16.8 mA

Lefty
« Last Edit: July 28, 2011, 11:01:37 am by retrolefty » Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Once you get it working satisfactorily at all, as Lefty points out, some additional conditioning will be required to get the output into a range that will reliably satisfy the Arduino's digital input requirements. I suppose you could instead use an analog input.
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
A 100 ohms resistor would only generate a maximum of around 1.8vdc for a 'high' state, not large enough to be read as a legal arduino logic high. That's why they show the 100 ohm resistor feeding a comparator.

I was just suggesting a hookup that should provide a guaranteed method of testing whether the device worked at all. I don't see a way to get around some sort of conditioning. With a possible maximum of 8.4 mA for a logic low, 200 Ohms gives 1.68 V which I believe is too high for a reliable logic low.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I suppose you could instead use an analog input.

As most of the time this kind of sensor is being used to measure RPM it would be a little ackward I would think to have to read it as a analog input value, and then try and 'count' the valid thresold state to convert it to a digital variable suitable for timing the signal's frequency?

Lefty

Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
As most of the time this kind of sensor is being used to measure RPM it would be a little ackward I would think to have to read it as a analog input value, and then try and 'count' the valid thresold state to convert it to a digital variable suitable for timing the signal's frequency?

Note the use of "suppose" and "could". :-P
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
As most of the time this kind of sensor is being used to measure RPM it would be a little ackward I would think to have to read it as a analog input value, and then try and 'count' the valid thresold state to convert it to a digital variable suitable for timing the signal's frequency?

Note the use of "suppose" and "could". :-P

Yes, weasel words at best.  smiley-wink However can you see another possible application in the analog world for this device considerings it's digital output nature? I can't.

Quote
200 Ohms gives 1.68 V which I believe is too high for a reliable logic low.

Your correct. I did some quick calculations and I can't come up with a single resistor value that meets all the possible hi/lo min and max current variation that would still meet the avr's logic min and max digital voltage levels. Guess a comparitor op-amp is a requirement for using this sensor.

Lefty
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yes, weasel words at best.   However can you see another possible application in the analog world for this device considerings it's digital output nature? I can't.

I was thinking along the lines of generating an interrupt using the comparator function of the 328 chip. I realize this is outside the realm of a starter project but certainly worth a look if you wanted a minimum parts count solution. Still too weasely for you?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm feeding it 5v from the Arduino. I first tried with a resistor, but I wasn't getting anything, if I remember correctly. I didn't realize this altered current instead of voltage.

If this isn't going to work well with an Arduino, can anyone suggest a better part?

Thanks, Mark.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yes, weasel words at best.   However can you see another possible application in the analog world for this device considerings it's digital output nature? I can't.

I was thinking along the lines of generating an interrupt using the comparator function of the 328 chip. I realize this is outside the realm of a starter project but certainly worth a look if you wanted a minimum parts count solution. Still too weasely for you?

Sounds possible. Arduino doesn't provide any comparator functions in it's core library commands so with my software skills still firmly following a learning curve I wouldn't have a clue how to implement that other then with good old hardware components.  smiley-wink

If it was me, I would just buy a Allegro version that uses voltage output: http://www.allegromicro.com/en/Products/Part_Numbers/0616/index.asp

Lefty
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm feeding it 5v from the Arduino. I first tried with a resistor, but I wasn't getting anything, if I remember correctly. I didn't realize this altered current instead of voltage.

If this isn't going to work well with an Arduino, can anyone suggest a better part?

Thanks, Mark.

http://www.allegromicro.com/en/Products/Part_Numbers/0616/0616.pdf

This device seems to be able to work with a +5vdc supply and has a open collector output, so should be easy to wire up to a arduino digital input pin using a simple pull-up resistor.

Lefty

Logged

Pages: [1] 2   Go Up
Jump to: