Go Down

Topic: How to efficiently check 180 hall effect sensors ( clustered per 5 ) (Read 208 times) previous topic - next topic

henridvl

Hi guys,

I am working on a project which requires me to check 180 hall effect sensors if they are either "on or off" but I'm having a hard time trying to figure out the best way.

The goal is to have 216 LEDS and divide them into 36 clusters of 6 LEDS. Each cluster ( 6 LEDS ) will be asigned it's own color. This color has to be selected based on 5 hall effect sensors. One of those 5 hall sensors will be active at all times which will define the color for one cluster of LEDS.

Currently I am trying to figure it out with some MCP23017 chips but i can't get it to work yet and i would like to know if I'm on the right track or if there is a better idea.

This is actually my first project without any knowledge which makes it pretty hard to gasp the idea behind it.

The current idea is to take a MCP23017 ( 16 channels ) and attach the hall effect sensors to the channels. Checking each channel to see if the hall effect sensor is getting power or not. Depending on that state change the color of the LED.

If there are any suggestion how to reach my goal or if there are better ways to do this please let me know. Thanks.

Paul_KD7HB

Are ALL the sensors identical and from the same manufacturer?
Paul

henridvl

Hi Paul,

Yes they are all A3144 sensors. Also good to know per 5 sensors ( cluster ) only 1 will be active at all times. There will never be more sensors active at the same time.

wvmarle

see if the hall effect sensor is getting power or not.
What is powering up and down the sensors?

You would need an array of 12 MCP23017 but they have only 8 I2C addresses to choose from, so that doesn't work for your numbers.

As all you need there are inputs, consider an array of shift registers, you'd need 23 of them.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

hammy

If you are just lighting up leds , could you not just have a simple transistor switch attached to each sensor powering the led direct .

Allard

If you are just lighting up leds , could you not just have a simple transistor switch attached to each sensor powering the led direct .
The LEDS are WS2812B leds so unfortunately they need a controller / data.

--

Currently I am trying to use the hall effect sensors with a multiplexer but I can not get the right result.
I got a MCP23017 connected to my Arduino Uno and I am trying to get a 1 or 0 for on or off with the following code:

Could some one explain to me the logic why the following won't work with a hall effect sensors output attached to pin 0 of the multiplexer?

I tested it with a button to make sure the circuit works but switching the button out for a hall effect sensor it's doesn't work. Sometimes i will get some sort of weird result but not a constant 1 or 0.

```#include "Adafruit_MCP23017.h"
Adafruit_MCP23017 mcp;
int dly = 100;

void setup() {
    Serial.begin(19200);
    mcp.begin();
    mcp.pinMode(0, INPUT);
}

void loop() {
      Serial.print("Pin 0: ");
      Serial.println(mcp.digitalRead(0));
      delay(dly);
}```

Unfortunately I do not get a constant 1 when a magnet is held by the sensor. Sometimes a 1 pushes through but it makes no sense at all ( just random and only once or twice of a 100 checks ). -- The circuit has been tested with a push button which works.

Can any one explain to me why that is and how to fix it? Thanks.

** P.S. I am the same person but using my own account, the previous time I was at a friends house with his account **

wvmarle

What does "some sort of weird result" mean exactly?

Are all parts soldered properly?
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up