Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The coin inhibit of the HX 616 is the bottom pin header with 2 pins, labelled "SET" on my device. Of those 2 pins, the botton one is ground and the top is the coin inhibit pin.
The manual describes it as: "Signal of forbidden energy inputting. Up PIN means signal inputting, voltage is more than 4V means OK, 0V means forbidden. Down PIN means ground wire."
The above translation is hard to understand but experimentation shows that:
The way I implemented this is by connecting the ESP32's coinInhibit output pin to a low level trigger relay. The relay drives the connection between the HX616 coin inhibit wire and ground in "NO" (normally open) mode.
So when the ESP32 sets the coinInhibit output pin to LOW, the relay becomes active and connects the HX616 coin inhibit wire to ground, and coins are refused. And when the ESP32 sets coinInhibit output pin to HIGH, the relay becomes inactive and the HX616 coin inhibit wire is left floating, so coins are accepted.
It might be possible to implement this in a different way, for example by using a MOSFET or transistor as a switch, or perhaps by using a 3V3 to 5V level converter or some kind of step-up/boost converter.