KrisKasprzak
Well-known member
I have one of these hall effect sensors connected to my Teensy 3.2 with a very short wire and the sensor works fine, by passing a magnet over the sensor i get a single count on my interrupt pin (I'm using pin 2) , when I remove the magnet no additional pulse. Code below. All is fine.
Now I have added a 2 foot shielded cable between the sensor and my Teensy, and I'm getting very wrong results. The cable is actually a short USB cable, and my sensor and Teensy are soldered to some PCB's all connections are good
When I pass the magnet over the sensor, the sensors light goes out and I get a pulse (Count =1), but when I remove the magnet I get another pulse, Count now = 2).
I have a feeling there is some capacitance issue with the wire--but I'm real stuck.
https://www.amazon.com/Wrisky-Ardui...6&sr=8-39&keywords=hall+effect+sensor+arduino
Anyone have an idea?
Now I have added a 2 foot shielded cable between the sensor and my Teensy, and I'm getting very wrong results. The cable is actually a short USB cable, and my sensor and Teensy are soldered to some PCB's all connections are good
When I pass the magnet over the sensor, the sensors light goes out and I get a pulse (Count =1), but when I remove the magnet I get another pulse, Count now = 2).
I have a feeling there is some capacitance issue with the wire--but I'm real stuck.
https://www.amazon.com/Wrisky-Ardui...6&sr=8-39&keywords=hall+effect+sensor+arduino
Anyone have an idea?
Code:
volatile unsigned long Count;
void setup() {
Serial.begin(115200);
pinMode(2, INPUT_PULLUP);
attachInterrupt(2, inc_rpm, FALLING);
}
void loop() {
}
void inc_rpm() {
Click++;
Serial.println(Click);
}