I'm having some success reading sensor output from a 12VDC coin hopper as coins get ejected from it. The challenge is that its sensor output is causing my Trinket M0 (running Arduino sketch) to wig out intermittently when receiving signals (fine at all other times), resetting. Aware that this is not an Ardiuno device specifically (can test soon), I have a hunch that the sensor output is throwing too much voltage at the sensor input occasionally.
The coin hopper sensor output is "open collector NPN - active low, maximum sink of 25mA at 35Volt maximum". I have the built-in pull-up resistor enabled when receiving signals in the Trinket.
The hopper is powered by a 12VDC power supply connected with a relay. The coin hopper's ground connection goes back to the power outlet while the single sensor wire connects to a digital input pin. I've learned that this may deliver "floating" values which can be unpredictable.
I found somewhere in an ancient IRC chat from 2013 (sorry I lost link) that I may be able to add a ground wire somewhere in-between with a 10kohm resistor and have learned here in my discussion of a possible need for a capacitor. Honestly though, I'm still an electronics newbie and am not sure how I would configure this.
Any ideas on how I would tame the volts? :o
This is going towards a charity project that I'll be happy to share once completed. Thanks in advance for your time and awesomeness!