hall sensor signal using Arduino timer

Hello Arduino,

I recently bought 2 Mega 2560 used for detecting rising edge and falling edge of hall effect sensor signal of 2kHZ frequency. The first one initially worked well when my entire system (including an AC motor) was running but soon it malfunctioned once I started the AC motor though it still works when AC motor is not running. The signal is clean and neat no matter whether the motor is running or not. Below are two examples of signal and output from arduino when motor was on and off. In this case, arduino is trying to invert the voltage everytime the edge change is detected.

Then I thought the first board may be fried. Thus, I ordered the second one and received it today. However, it still doesn't work. I was thinking it might be electromagnetic wave caused by AC motor that arose this issue but I couldn't figure out why the first board worked before. Is there any defect in the second board?

The info of first board is BN: Arduino/Genuino Mega or Mega 2560 VID: 2341 PID: 0042 SN: 955383335353517052F1.

The info of second board is BN: Arduino/Genuino Mega or Mega 2560 VID: 2341 PID: 0042 SN: 955383335353517051C1.

The operation system is windows 10 64-bit, x64 based processor.OS build: 15063.296.
My IDE is Arduino 1.8.2.

BTW, the AC motor is three-phase powered and isolated from the normal power circuit.

I am looking forward to your reply.

Sincerely,

SignalTest.ino (314 Bytes)

What is the Hall sensor sensing? What is a blinking LED supposed to tell you?

Hi edgemoron,
Sorry for the late reply. Here is the signal we got from the oscilloscope.

Hi edgemoron,
Sorry for the late reply. Here is the signal we got from the oscilloscope.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you post a picture of your project so we can see your component layout?

What is the 2Khz signal from and for?

Thanks.. Tom.. :slight_smile: