My first big Arduino project has hit its first major problem that I cannot seem to solve by myself.
In short it's a data logger that (among other things) counts revolutions on an axle via an interrupt on INT5 (D18) via "Slot-type Optocoupler". It runs on a Arduino Mega 2560 with a TFT/SD shield
When testing in the office it all works fine. Each time I breach the slot sensor it will count 1 up. As soon I place the Setup in the boiler room and make real readings then I get a lot of false interrupts.
I have tried to shield the setup in a metal box. I tried 1uF from my DO on the sensor to 0V to try and "eat" small spikes
Can noise enter through the VCC that gets it power from a transformer plugged to 220V?
I know my code might not be perfect, but I'm new to Arduino and C++ and first goal is to make it work.....perfect comes later :)
- I have 10k pull up resister on D18
- sensor: http://www.aliexpress.com/item/Slot-type-Optocoupler-Tacho-generator-Counter-Module-for-Arduino-for-Raspberry-pi/32283471953.html
- code: https://codebender.cc/sketch:134188