Which Relay to use for 12volt electromagnet on a coin acceptor?

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.

coin-selector.jpg

IRLZ34N.jpg

Would this do my job?

https://www.amazon.co.uk/Channel-Interface-Trigger-Optocoupler-Arduino-Blue-Black/dp/B07PXCH8GJ/ref=sr_1_6?keywords=Relay+12V+1-Channel+Relay+Module+Blue+for+Arduino&qid=1554726239&s=gateway&sr=8-6

  1. This is a 12V 1 channel relay module with optocoupler isolation.
  2. 1 relay output module, max load AC 250A 10A, DC 30V 10A.
  3. VCC, GND power input,with optocoupler isolation.
  4. Low level trigger,stable performace.
  5. Widely used in SCM control, PLC control, home intelligent control,industry etc.

Warren333:
I have a bunch of IRLZ34N MOSFET's.. would one of those do the trick?

For 65 mA, that should be absolutely fine!

Put a 10k resistor between the Arduino pin controlling it, and ground to keep it turned off while the Arduino is initialising.

Don't forget the "kickback" diode across the solenoid.

Thank you Paul,

Paul__B:
Don't forget the "kickback" diode across the solenoid.


These are marked IN4001 and came in a bag that say's SSY-2420 BW221. Would one of these do?
Are these 'direction'sensitive?
Cheers
Warren

Warren333:
These are marked IN4001 and came in a bag that say's SSY-2420 BW221. Would one of these do?

Yes.

Warren333:
Are these 'direction'sensitive?

Yes.

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.

Am I correct?

Warren333:
Am I correct?

No.

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.

That made a lot more sense to me as I started to draw it.. I hope :confused: lol

Is this correct?

Umm, no! :grinning:

The 10k should not be in the black lead, but between the black and green wires at the Arduino.

Paul__B:
Umm, no! :grinning:

The 10k should not be in the black lead, but between the black and green wires at the Arduino.

Ah, ok, do you mean across the pin 3 and Gnd coming out of the Arduino, connecting them to each other?

Is everything else ok?

Thanks again btw, much appreciated :slight_smile:

Yep.

Thank you very much Paul, I really appreciate it :sunglasses:

This seems like X/Y issue.
Your problem is “My problem is when credit = 1 the main game starts”

Why not fix your code so it increments credits while game is running and skip this patchwork solution?

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.