Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Raspberry credits detection  (Read 3356 times)

0 Members and 1 Guest are viewing this topic.

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Raspberry credits detection
« on: April 16, 2018, 04:44:36 am »
There is any way to detect output (only coin blink will be enought) trought raspberry GPIO?
« Last Edit: April 16, 2018, 10:26:54 am by Marcoqwerty »

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry insert coin detection
« Reply #1 on: April 16, 2018, 09:40:14 am »
Im sure there is. Do you want the Pi to detect when the coin switch is activated?
Or do you want the Pi to turn on one of its outputs when it detects the coin switch being activated?

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Re: Raspberry insert coin detection
« Reply #2 on: April 16, 2018, 10:00:11 am »
Ehi master of scripts!!! thank you for the reply again! :notworthy:

I think it would be nice the PI turn on some of their outputs when the coin was detected, my aim is turn on a small light (6v), maybe directly trought PI (from some pinout are get out 5v).

My project actually miss space inside of the control panel...so i cant use or add realy or other control led boards.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry insert coin detection
« Reply #3 on: April 16, 2018, 10:06:30 am »
Ehi master of scripts!!! thank you for the reply again! :notworthy:

I think it would be nice the PI turn on some of their outputs when the coin was detected, my aim is turn on a small light (6v), maybe directly trought PI (from some pinout are get out 5v).

My project actually miss space inside of the control panel...so i cant use or add realy or other control led boards.

All the outputs on the RPi are 3.3 volts. And probably not enough current to safely power a incandescent lamp, you could however have the Pi turn on a transistor, which would then turn on the lamp with 5 volts.
Or just use an led instead of the 6 volt lamp.
How is your Pi detecting the coin switch?
Is it through a GPIO input pin, or are you using a keyboard encoder?

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Re: Raspberry insert coin detection
« Reply #4 on: April 16, 2018, 10:17:40 am »
Quote
All the outputs on the RPi are 3.3 volts.

Sorry but the GPIO 2 and 4 are not 5v output?



Quote
How is your Pi detecting the coin switch?

MINIPAC an external keyboard encoder who also throw out 5v at some of their pins.

Quote
Is it through a GPIO input pin, or are you using a keyboard encoder?

Keyboard encoder trought PI usb.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #5 on: April 16, 2018, 10:36:42 am »
Those pins are 5 volts, but they are on whenever the Rpi is on, and cannot be turned off or on using script.

If you only want to blink the bulb when a coin is detected, you could just hard wire the bulb to the switch, like this:

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #6 on: April 16, 2018, 10:42:03 am »
I see now where you are using a keyboard encoder. Do your pushbuttons and coin switches connect back to ground, or 5 volts?
You also may not need the blocking diode.

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #7 on: April 16, 2018, 11:04:17 am »
Ok, Ive never messed with the mini-pac so i went to the ultimarc website and did some research.
The switches do connect back to the ground that is on the minipac.
This ground is PROBABLY the same ground that is on the RPi, but using that incandescent bulb may be a bad idea.
The bulb will draw quite a bit of current. That current will have to flow through the minipac  and the USB cable to get back to the RPi.
Also the bulb has a "warm up" period, where it has to be on long enough for the filament to glow brightly.
The time the coin switch is on may be too short for the bulb to come to its complete brightness.
So you may not see the bulb come on at all.

Now if you use an LED instead of a bulb all the above problems would be solved, except I still wouldnt like the idea of running that 20 ma of power back through the minipac and the USB ground.
Dont know if that would be safe for the minipac or not.

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Re: Raspberry credits detection
« Reply #8 on: April 16, 2018, 12:06:42 pm »
Quote
Now if you use an LED instead of a bulb all the above problems would be solved,

Ok..there is no problem about bulb or led...i said bulb because actually its the only lamp of this type i have at home...but forget i will bought a 5v led to avoid this mess.

Quote
except I still wouldnt like the idea of running that 20 ma of power back through the minipac and the USB ground.
Dont know if that would be safe for the minipac or not.

Exacly...this is the same doubt i have! Obliviously i cant test to solve it...  :lol

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #9 on: April 16, 2018, 01:04:15 pm »
You could use a transistor to turn on the led.

marcoqwerty78

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:March 11, 2024, 07:11:29 am
  • I want to build my own arcade controls!
Re: Raspberry credits detection
« Reply #10 on: April 16, 2018, 02:14:08 pm »
With this i can control the LED LIGHT with a PI script?


Inviato dal mio iPad utilizzando Tapatalk

DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #11 on: April 17, 2018, 12:23:51 am »
No

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Re: Raspberry credits detection
« Reply #12 on: April 17, 2018, 03:56:27 am »
Then just detect a pression and turn the light on, right? and they never goes off after? Also do not blink?

It should be nice after the pression: bink and turn of after pression of the player 1 button; if is not possible detect any output from MAME.

I found this link from BYOAC:

http://forum.arcadecontrols.com/index.php?topic=155149.0


DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #13 on: April 17, 2018, 01:10:23 pm »
In the circuits I posted the light will be on steady as long as the switch is made.
No blinking, however the button or switch press may be so quick that the light blinks once.
switch made: Light on
switch not made: light off.

I will look into some script that maybe can detect the coin button (should be 5 on the keyboard for player one, 6 for player two), and turn on a GPIO output for a set amount of time, or blink it if thats what you want.
If you find another way to do it, please let me know.

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Re: Raspberry credits detection
« Reply #14 on: April 17, 2018, 04:24:35 pm »
Good...

Yes! i think a script would be the better shortcut...a fake output s detection; because, how ive read at link posted above, Mame 106 do not support yet outputs like the newer version. But if youre interested to investigate i can write a mail at the italian (as me) developer of advmame106.

For the "fake" options maybe it should follow some rules...before the pressing of the CREDITS button activate the PLAYER 1 LIGHT (blinking)

- first detect is running MAME
- detect the credits are no 0
- after press the PLAYER 1 BUTTON the script check again if the credits reach the 0 value

BTW  :notworthy:  i appreciate a lot your work and to listen all my requests...but REALLY do not waste to much of your time to think about my ideas (if its hard or too longer)....for me its good enought, an easy light turned on after a button pression.

Thank you for all!


DaOld Man

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Raspberry credits detection
« Reply #15 on: April 18, 2018, 07:59:32 am »
I dont mind working on things like this, but I have no idea how I would get the amount of credits that mame has registered.
Your better bet may be to contact your friend who is a developer of advmame106.

If I can help in any other way Id be glad to, but i have done nothing with mames code, and honestly, wouldnt know where to start.
 ???

Marcoqwerty

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
  • Last login:March 14, 2024, 02:46:08 pm
Re: Raspberry credits detection
« Reply #16 on: April 18, 2018, 09:35:33 am »
Thank you for all!!!! i check i there is some other way to add this fake feature...

 :notworthy: