I have a Coin Acceptor and a program successfully written together and working great on an Arduino Mega.
My problem is when credit = 1 the main game starts and the program leaves the coin acceptor meaning any money inserted doesn't show up until the game has finished.
My solution is to disable the electromagnet on the side of the unit while in game mode meaning money will not register and be returned to the customer. Once the game is over it can accept money again.
Another option would be to add an Arduino Uno to simply take the money and produce credits although I'd sooner disable the Electromagnet.
The instructions say "2pin socket - Electromagnetic valve DC 12V" and specifications for the unit says;
"Working Voltage DC +12V +-10%"
"Working Current 65mA =-5%"
I know that Arduino can only handle 20mA so I understand I will need a relay of some sort. I'm just not sure how to size one? I have a bunch of IRLZ34N MOSFET's.. would one of those do the trick?
I have searched everywhere for an answer and have found a few but I'd sooner get it right without guessing.
Thanks in advance.
Hi Paul, I have put together a diagram of how I think it should all go;
I have 12 volts going into the coin collector and 12 volts coming out of the coin collector (only when activated by a correct coin) which is going to the electromagnet.
I have disconnected the positive from the electromagnet and put that into the Drain pin of the Mosfet and the Source comes back to my Electromagnet to complete the positive loop.
My Diode is across the positive & negative of my electromagnet with the silver band on the positive side.
My Arduino Sketch will activate pin 3 which will join my Drain to my Source and complete the circuit. Arduino ground is connected to the same ground as the coin selector.
My thinking is that the Arduino will activate the gate which will join my positive wires and when a correct coin enters the electromagnet will take the coin. If the gate is closed thus disconnecting the power to the electromagnet then all coins will be returned.
The source terminal of the FET must go to ground, the same ground as the Arduino. And you need a 5 V power supply for the Arduino in case that was not mentioned before.
The drain terminal goes to the negative of the collector solenoid with the positive of the solenoid going to 12 V. Yes, the band (cathode) on the diode connects to the positive terminal of the solenoid and the other end to the negative.
There is no need for a large series resistor in the gate connection from the Arduino as the FET draws no current except at the instant of switching, so some people do like to put in a 220 Ohm resistor. However as mentioned, put the 10k resistor between the Arduino pin controlling it, and ground to keep it turned off while the Arduino is initialising.
Warren333:
My problem is when credit = 1 the main game starts and the program leaves the coin acceptor meaning any money inserted doesn't show up until the game has finished.
Sounds like you forgot to add a line in your game code that calls the coin acceptor routine frequently, and records incoming coins.
It'd also be the more user friendly solution.