Interrupt randomly triggering on a simple Arduino - Coin Collector project

Southpark:
I just checked that ..... that one is nicely written.

Ha, yeah. For a change. :slight_smile:

If I disconnect the white signal wire from pin2 it is constantly triggering as RISING without me doing anything.

Is that with a 1K? If it is just with nothing then it is no supprise as you input is floating.

If it is with 1K then you are in trouble and you have to add a more robust power supply circuit.

Thank you for doing the tests. Wow, this is strange ... with 10K pullup to Vin you get 1.1V constant signal, but with 1K pullup to 5V, you get 0.06V.

With both measurements, make sure:

  1. the black wire remains connected to Uno GND.
  2. the white wire remains disconnected from the Uno.
  3. the pullup resistor is connected from the white wire to Uno 5V.
  4. the readings are taken with a multimeter from the white wire to GND.

I remain convinced that the opto isolator would be the best solution for noise immunity. Here are several more variations you could try. May need to go with a more sensitive opto ... for example the PS2502-1-A has a minimum current transfer ratio of 200% @ 1mA



EDIT: Could also try changing the 1K to anything within 220Ω-470Ω.