Black Lives Matter - Action and Equality. ... Adafruit is part of the Stop Hate for Profit campaign. Adafruit is open and shipping.
0

interfacing coin acceptor to raspberry pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: interfacing coin acceptor to raspberry pi

by dev64 on Wed Jun 11, 2014 9:06 pm

adafruit_support_rick wrote:You really can't do it with a voltmeter, because the signal changes too rapidly. Instead, do as I suggested earlier - assume that the signal voltage is 12V, and make the divider out of a 56K and a 22K resistor. If the PI can detect the signal changing, then you are good to go. If it does not detect the signal changing, then assume a 5V signal and use the 12K and 22K resistors for the divider.

Note that the lower resistor doesn't have to change - it's 22K in both cases. Just swap the 56K for the 12K, if the 56K doesn't work.


Hi,
I did the circuit you suggested and it actually worked! you were right the coin line is running at 12v and im using a 56k resistor between the coin wire and the pi gpio. the setup is quite simple. The only glitch I see so far is if I disconnect the 12v power supply, I get a pulse on the coin wire and it get's registered as a coin input. not sure how to fix it.


any advice?
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Thu Jun 12, 2014 7:15 am

Nothing much comes to mind. If you had an oscilloscope, you could see what the pulse-width looks like. Maybe the glitch is either longer or shorter than a valid pulse. Your code could measure pulse-width and filter out glitches.

How does the thing distinguish different coin values? A different pulse count?

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: interfacing coin acceptor to raspberry pi

by dev64 on Thu Jun 12, 2014 9:31 am

Well it only talks one type of coin. I wonder what the counter line is for ?
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Thu Jun 12, 2014 10:26 am

No idea.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: interfacing coin acceptor to raspberry pi

by jaws_perez on Thu Dec 25, 2014 7:35 am

Question: how did you determine the value for the resistors?

also: could you use the coin signal to drive another 12v/5v switch that connected the 3.3v from the raspberry to a pin?
would that be less efficient?

jaws_perez
 
Posts: 5
Joined: Tue Dec 23, 2014 1:50 am

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_mike on Sat Dec 27, 2014 4:03 am

The exact values of the resistors aren't critical, but the proportions matter.

If you have a signal that goes between 0v and 12v as input, and want a signal that goes between 0v and 3.3v as output, you want a voltage divider where the lower resistor is a little more than 1/4 the total resistance, or a little more than 1/3 the size of the other resistor:

divider.jpg
divider.jpg (18 KiB) Viewed 309 times

26k and 22k are standard resistor values that give about the right result. They're also large enough that very little current will flow through them (thus reducing the chance of anything being damaged).

You could use a switch or a relay to connect the RasPi's 3.3v pin to a GPIO pin, but the parts are less common and would use more power.

adafruit_support_mike
 
Posts: 61124
Joined: Thu Feb 11, 2010 2:51 pm

Re: interfacing coin acceptor to raspberry pi

by jaws_perez on Sat Dec 27, 2014 5:56 am

Heaps cool so your using the resistors to break up the voltage into a percentage that will equal ~3.3V

so for this to be true that would mean that R2 is between the ground and pin on the raspberry and that r2 will have the 3.3v right?

jaws_perez
 
Posts: 5
Joined: Tue Dec 23, 2014 1:50 am

Re: interfacing coin acceptor to raspberry pi

by zener on Sat Dec 27, 2014 4:53 pm

Yes. That is how it is shown in the 6th post.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Please be positive and constructive with your questions and comments.