In my project, a sensor reading is fed to pin 2 of arduino uno and tried to run a function using an interrupt. (attachInterrupt(digitalPinToInterrupt(2), PulseP_Event, RISING))
I think those small pulses trigger the interrupt functions.
What should I do to avoid such small noises?
Thanks in advance.
First I power the sensor using the external power supply and run the command. Then it run smoothly.
Then I power the sensor and the arduino using battery power, which is used to run the other components and circuits in my whole system. Then only it leads to this error.
Then the answer is to eliminate the noise at it's source, not where you are seeing it. Eliminate the noise source one at a time until you find is, then use caps or whatever is needed to suppress the noise at it;s source.
Please show a circuit diagram. Battery voltage, connected how?
Most probably you need a stronger power supply. Use one scope channel for watching the 5V line.
The diagram on the link has a voltage divider,
so it is for a PNP sensor, not for the NPN sensor you seem to have.
An NPN sensor only needs one resistor, from pin to VCC of the Arduino.
Use a relative low value if you use the sensor in an electrically dirty environment.
Start with 1k.
Leo..
Did you got solution to your problem ?
Please explain the solution ?
you are using resistor divider circuit to connect proximity sensor with interrupt pin ?
Is it safe way to connect?
you can think of connecting sensor with interrupt pin using optocoupler?
Please share circuit diagram how u are interfacing sensor with interrupt pin and how supply are used ?