Did anyone work with a Raspberry Pi in a an automotive project ?
I am working on creating a dashboard for a motorcycle and it is making me crazy!
when configuring a GPIO pin as an interrupt it detects many pulses if the engine is running ! There is no problem with the other GPIO pins that they are not configured as an interrupt they work as expected!
But for the speed I am working with NJK-5002C sensor which is an NPN sensor , if it detects something the output will be connected to the GND. So I am configuring a pin as a pull Up GPIO and as an interruption to use it for this sensor.
It has been a while that I am facing this problem, I though it is because of the sensor but it is not. so to locate the problem I just started by testing the Raspberry Pi in this environment without even connecting the sensor and without connecting any thing to any GPIO. I just connected my Raspberry pi to the official power supply so the raspberry is totally isolated from the engine's battery, I configured a pin as a pull up and an interrupt so it contains an internal pull up resistor and when I run the engine it detects nothing but if I just connect any type of wire to this GPIO and add simply a 10Kohm external pull up resistor without even connecting the output of the sensor to the GPIO. the wire acts like an antennae and detects all that noise coming from the engine and the alternator. I tried also with the coaxial cable and same thing ! So when my raspberry has a pin configured as an interrupt and it is just connected to an external pull up resistor and nothing else it is detecting noise!
For the software I am working with the WiringPi library so when configuring the pin I am using the wiringPiISR
. I though that maybe the problem comes from this library which is not official so I tried the same thing with the Arduino and even the Arduino detected this noise.
Please if anyone worked with a Raspberry Pi on such a project tell me what should I do It's been a while that I am facing this problem !