This is actually my first post and first question, so not sure if I'm doing this right. I'd like to read out a pulse coming from a 12v signal wire. (Coin acceptor)
Sending the 12v directly in isn't a great idea, and as a programmer I'm not really sure how to solve this "hardware issue".
I read about a voltage divider, and I'm fairly certain I've got that set up. Is there any downside to the schema in the image below? Any caveats? Trying to keep this simple.
The voltage divider is OK, with ratio = 4.7/(6.8+4.7) = 0.41, so 12V will actually be read out as 4.9V. However, the switch should break the positive connection, not ground.
Otherwise the Arduino input could in some cases be floating and give false readings.
Thank you! That helps a lot. Iโll get started on the real deal then. I was thinking of simply using digitalRead() with INPUT_PULLUP. That would mitigate the false readings. Am I correct?
Thank you for your time and advice. Right! Wonโt do that.
Yeah, it says on the box that it outputs a 12v signal. Can also configure the pulse time with some switches (e.g. 50ms, 100ms)
I think I can manage to code the false positives out programmatically then.