Hi every one
I'm desperately trying to get multiple hall sensors (SS49E) to work at the same time on an arduino nano.
When only one hall sensor ist connected everything ist working fine. But when I hook up five of them, the analog reading are very uneven.
Here's the setup:
Here is my code:
byte inputPin[] = {A0, A1, A2, A3, A4}; // Pins on which the hall-sensors are connected
void setup() {
Serial.begin(9600);
for (int i = 0; i < 5; i++) {
pinMode(inputPin[i], INPUT); //initialize all pins as input
}
}
void loop() {
for (int i = 0; i < 5; i++) {
Serial.print(analogRead(inputPin[i]));
Serial.print("t ");
}
Serial.println("");
}
This is the output:
163 859 265 820 357
803 446 699 530 550
655 445 786 346 894
259 928 202 951 130
982 155 955 193 951
242 894 300 839 347
764 412 670 521 542
645 436 777 333 883
251 923 199 948 127
976 149 954 188 943
234 886 292 833 337
762 407 670 515 536
639 431 769 326 875
Here's what i've tried so far:
- add a delay after each reading
- add a second analogread() in front of the one that is printed
- adding a smoothing-function for the read outs
I'm clueless...
Does anyone have a clue why I don't get stable readings?
Do the sensors have to be more spread out?
I am happy about every input. Thanks in advance and have a great day!