Pages: [1]   Go Down
Author Topic: Hall US1881 sensor issue  (Read 209 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all, I´m developing a project and I have a little issue.

I´m using:

1 Arduino Mega
1 GSM shield
1 Reed Switch
1 LED
8 Hall Sensors (US1881)

The problem is that because I´m using the shield; I lose a lot of digital pins. Pin 13 is attached to the reed switch. And I have only 7 digital pins left to use with the halls, so 1 of them i had to attach it to a analog and use it like a digital.
In the first times, it works fine, but with time (days later), the hall literally dies. The other 7 are working properly months later.
I assumed that digital and analog pins works in the same way, maybe I must use a capacitor or a different resistor with this sensor? (actually im using 10k)

Any ideas? Thank you¡


* scheme.png (336.02 KB, 1962x2343 - viewed 15 times.)
Logged

France
Offline Offline
Edison Member
*
Karma: 37
Posts: 1008
Scientia potentia est.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

You should use a shift register. In your case, a "parallel in, serial out", such as the 74HC165, I think it could work (but I'm far from being expert) smiley-wink

http://playground.arduino.cc/Code/ShiftRegSN74HC165N
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2451
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I'd opt for a mux like the 4051...

Basically you feed all of your hall sensors to the 4051, then using 3 pins you can select which hall sensor to read...  saving you 4 pins and up to 8 sensors.
Logged

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

Thank you for the replies¡ With the multiplexer, I can read all the sensors at the same time? I´ve never mutiplexed before
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2451
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the replies¡ With the multiplexer, I can read all the sensors at the same time? I´ve never mutiplexed before

Nope, can you read all 7 hall sensors at the same time?

You iterate through all your sensors in a for loop....... selecting each individual sensor;  to collect data from, one at a time.
Logged

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

Yep, I´m reading all of them at the same time, to know every moment wich one is the last switched on
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2451
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep, I´m reading all of them at the same time, to know every moment wich one is the last switched on

I guess you're stuck then..  use a parallel mode on a shiftregister.... as suggested, that way you read it all in "1 go" in reality, it'll be 1 bit a time as it reads in the data, but to you, it will be instant.

I like the idea of a mux, because you get to control which sensors you access, and as far as the end user is concerned, it's pretty much instant to your eye (even with a for loop)

« Last Edit: June 27, 2014, 02:34:33 am by cjdelphi » Logged

USA
Offline Offline
Sr. Member
****
Karma: 14
Posts: 368
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The schematic shows analog input A0 connected to what appears to be a Hall effect device, and digital pin 13 connected to what appears to be an anemometer. 

I don't know of any reason that A0 shouldn't work as a digital input indefinitely.  To test your theory that something fails with pin A0, I'd recommend swapping those two devices - connect the Hall sensor to digital pin 13, and connect the anemometer to A0.  Naturally, you'll have to address that change in your code.  Then observe which one, if either, fails. 
Logged

Pages: [1]   Go Up
Jump to: