I am working on a Data Acquisition project using Arduino Due for petrol scooters where I am trying to collect 6 types of data - acceleration, location, brake, throttle, horn and RPM of the wheel. I'm using the BNO055 9 axes IMU shield to collect acceleration data, GPS shield to get location, and a 44E hall effect sensor + magnet to collect RPM data. I am pulling the hall effect sensor using INPUT_PULLUP command in the IDE and not using an external resistor (I hope that's okay). The throttle data is directly given to an analog pin on the Due (I'm using an electronic throttle which has a hall effect sensor inside it). For the brake and horn (it's a mechanical horn), I am using a potential divider that gives an output of 3.3V, to give it to the digital pins (I am recording the instances at which the brake and horn is pressed). The Due is being powered by the 12V lead acid battery on the scooter. The throttle and the hall effect sensor that I'm using for RPM is powered by the 3.3V onboard regulator on the Due. All the data is logged on the SD card at a frequency of 5Hz. I am facing a certain issue with the horn and RPM data, and here it is -
Every time I press the horn, the RPM data goes boink. Even pressing the indicators corrupts the RPM data which is weird, as I am not even collecting indicator data. The more I press the horn, the more crazy the RPM data goes; sometimes it touches 1000-2000 RPM which is absolutely wrong. But when I dont press the horn, I get the correct RPM data. Why is this happening? Why does the horn affect only RPM data? Is it because, the hall effect sensor works on magnetic field and the horn is an inductor which generates a huge amount of magnetic field? Or, because the Arduino and the horn are powered from the same source and hence have a common ground? Is there a way to isolate or filter the noise from the horn?