Search the Community
Showing results for tags 'opto'.
-
Hi Guys. This thread is for anyone who already has two hoppers on their MFME cabinet, and want to add an extra 1,2 or 3 hoppers for the older fruities. - The older ones with 2p/10p/50p/token solonoid/tube payouts After planning this months ago, I finally got round to experimenting with my Arduino Uno (regarding Pacdrive Triac outputs to hopper). (Thanks to getting some quiet during the daytime!) So as a newby to Arduinos, I literaly took the simplist code there is for the Arduino (https://docs.arduino.cc/built-in-examples/basics/DigitalReadSerial), and built on it for my test. The idea was to take the 5v output generated by the Pacdrive for triac payouts, and make a hopper spit out a coin, and stop when the coin has paid out. Here my diagram of set up. Here is what I altered the (public domain) code to: //pins const int pulse = 2; const int opto = 4; const int motor = 12; int relaya = 0; // off int relayb = 0; // off void setup() { // output: pinMode(motor, OUTPUT); // input: pinMode(pulse, INPUT); pinMode(opto, INPUT); } void loop() { relaya = digitalRead(pulse); if (relaya == HIGH) { digitalWrite(motor, HIGH); } relayb = digitalRead(opto); if (relayb == HIGH) { digitalWrite(motor, LOW); } } And here is a quick video example of it running it with a blue hopper. https://youtu.be/JTeSdhvOSsg (The button being pressed, is only to demonstrate what happens when the Pacdrive 5v output sets a relay off) Here is a pin diagram for the opto circuit on a blue hopper as they are never labeled, and a diagram is hard to find. My next test was to run 2 separate hoppers both at the same time, by duplicating some of the Arduino code. //pins const int pulse = 2; const int opto = 4; const int motor = 12; const int pulse2 = 5; const int opto2 = 7; const int motor2 = 13; int relaya = 0; // off int relayb = 0; // off int relayc = 0; // off int relayd = 0; // off void setup() { // output: pinMode(motor, OUTPUT); pinMode(motor2, OUTPUT); // input: pinMode(pulse, INPUT); pinMode(opto, INPUT); pinMode(pulse2, INPUT); pinMode(opto2, INPUT); } void loop() { relaya = digitalRead(pulse); if (relaya == HIGH) { digitalWrite(motor, HIGH); } relayb = digitalRead(opto); if (relayb == HIGH) { digitalWrite(motor, LOW); } relayc = digitalRead(pulse2); if (relayc == HIGH) { digitalWrite(motor2, HIGH); } relayd = digitalRead(opto2); if (relayd == HIGH) { digitalWrite(motor2, LOW); } } Here is another quick video of both hoppers running. Here is a pin diagram for the opto circuit on a common black serial hopper too. Feel free to add anything that may help others below.