0

interfacing coin acceptor to raspberry pi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

interfacing coin acceptor to raspberry pi

by dev64 on Sat Oct 19, 2013 2:25 pm

uhm i trying to interface this coin acceptor to a pi. I have a vending machine that is using this coin acceptor. That cable shown in the product pic is coming from the vending machine itself and run into the coin acceptor. I need a way to split/divide the cable coming from the machine and pass it through the pi and back into the coin acceptor.
http://www.adafruit.com/products/787

the pi also uses 3v. really appreciate anyhelp on this.
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Sun Oct 20, 2013 8:35 am

What voltage level is the coin line pulsing at? You can use a level-shifter or a pair of resistors as a voltage divider to bring the coin line down to 3.3V.

As for splitting the coin line, you can simply connect it to both the vending machine and to the Pi through the level-shifter.

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 Sun Oct 20, 2013 10:24 am

adafruit_support_rick wrote:What voltage level is the coin line pulsing at? You can use a level-shifter or a pair of resistors as a voltage divider to bring the coin line down to 3.3V.

As for splitting the coin line, you can simply connect it to both the vending machine and to the Pi through the level-shifter.


How can I find out the voltage level for the con line?
I see a little diagram on the coin acceptor like this

12v-------------------
Coin------------------
Gnd-------------------
Counter-------------

I also see a switch labelled no/nc
And another switch labeled fast/med/slow

The vending machine itself uses 12v DC.that diagram is a 4pin connector as seen in the product pic of the coin acceptor. It is fed from the vending machine to the club acceptor. The machine is receiving pulse from the acceptor.
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Sun Oct 20, 2013 10:38 am

dev64 wrote:How can I find out the voltage level for the con line?

An oscilloscope would be handy. I doubt that the pulses are long enough to give a good reading on a multimeter.

Where does the coin line go to? Some sort of microprocessor? Do you know what voltage that microprocessor runs at?

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 Sun Oct 20, 2013 11:00 am

adafruit_support_rick wrote:
dev64 wrote:How can I find out the voltage level for the con line?

An oscilloscope would be handy. I doubt that the pulses are long enough to give a good reading on a multimeter.

Where does the coin line go to? Some sort of microprocessor? Do you know what voltage that microprocessor runs at?

Yup it is a circuit board it has a 4 segment display. Basically its a breathalyzer board. The microprocessor takes a 12v DC and I also see the sane diagram on the board as on the acceptor

Dc12
Coin
Gnd
CounterCounter
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Sun Oct 20, 2013 11:43 am

Well, I think the coin line is open-drain, meaning that the voltage for the HIGH signal is whatever you pull it up to. So that's going to be set by the breathalyzer board. I doubt that the microprocessor on that board runs at 12V. If this is an older thing, it's probably running at 5V, so the coin line is probably running at 5V.

What you can try is to splice another wire into the coin line, and run it over to the PI. There, you want to make a resistive voltage divider.
To do that, you connect the coin line to a Pi GPIO pin through a resistor, then you connect another resistor from the same GPIO pin to ground. Like this:
voltage_divider.png
voltage_divider.png (464.46 KiB) Viewed 1706 times

The values for R1 and R2 depend on what the coin line voltage is. To be safe, you should probably first assume that Coin is 12V. In that case, you want the following values for the resistors:
R1: 56kOhm
R2: 22kOhm

Try that. If you can't see the Coin line changing on the Pi, then it's not running at 12V. You can try different resistors and assume Coin is 5V:
R1: 12K
R2: 22K

PLEASE NOTE: This is all at your own risk. We don't have good information on what kind of signal levels you're dealing with here. You run the risk of damaging your Pi, and we can't be responsible for that.

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 Sun Oct 20, 2013 12:41 pm

Thanks for the detailed reply. What if the coin line was running at 5v, I could then simply power the pi with the coin line? I should probably determine what voltage is coming out of the coin line using a voltmeter. Can I power and read coin input from the coin line? that would be great! I also need some jumper cables for use with gpios.

On the other hand, this looks more promising and safer way to power the pi
http://www.ebay.com/itm/DC-Converter-St ... 1203074650

So lets say, I am able to power the pi by splicing the 12v power from the breathalyzer board and wileding it with the above connector and then finally power the power using the micro usb.
Is there a more elegant way to splice the coin line, i did rather buy a line splitter or a divider. I did rather not go down the path of resistors, the approach seems a bit too hackish.

adafruit_support_rick wrote:Well, I think the coin line is open-drain, meaning that the voltage for the HIGH signal is whatever you pull it up to. So that's going to be set by the breathalyzer board. I doubt that the microprocessor on that board runs at 12V. If this is an older thing, it's probably running at 5V, so the coin line is probably running at 5V.

What you can try is to splice another wire into the coin line, and run it over to the PI. There, you want to make a resistive voltage divider.
To do that, you connect the coin line to a Pi GPIO pin through a resistor, then you connect another resistor from the same GPIO pin to ground. Like this:
voltage_divider.png

The values for R1 and R2 depend on what the coin line voltage is. To be safe, you should probably first assume that Coin is 12V. In that case, you want the following values for the resistors:
R1: 56kOhm
R2: 22kOhm

Try that. If you can't see the Coin line changing on the Pi, then it's not running at 12V. You can try different resistors and assume Coin is 5V:
R1: 12K
R2: 22K

PLEASE NOTE: This is all at your own risk. We don't have good information on what kind of signal levels you're dealing with here. You run the risk of damaging your Pi, and we can't be responsible for that.
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Sun Oct 20, 2013 3:31 pm

dev64 wrote:What if the coin line was running at 5v, I could then simply power the pi with the coin line? I should probably determine what voltage is coming out of the coin line using a voltmeter. Can I power and read coin input from the coin line? that would be great! I also need some jumper cables for use with gpios.

The coin line is a signal line. You can't power anything with it.

You can't determine the voltage level of the coin line signal with a voltmeter, as it only carries a few 40 ms pulses when a coin is inserted.
dev64 wrote:On the other hand, this looks more promising and safer way to power the pi
http://www.ebay.com/itm/DC-Converter-St ... 1203074650

That would work.
dev64 wrote:Is there a more elegant way to splice the coin line, i did rather buy a line splitter or a divider. I did rather not go down the path of resistors, the approach seems a bit too hackish.

It's not hackish. You have to reduce the signal level to 3.3V somehow. That's the easiest way.

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 Tue Oct 22, 2013 12:40 pm

I am debating maybe this might just work.
http://www.ebay.ca/itm/GELID-PWM-Y-Cabl ... 0746442099
But I am worried about the circuit flow. I have a female 4 pin connector coming from the breathalzyer board that is directly connected to the coin acceptor. Can I use that Y cable splitter and connect the female 4 pin to the coin acceptor and the one end of the male to the breathalzyer and the other to the pi? I know pi would need a male to female converter before it can be used in the gpios.

maybe im beating my imagination here! thanks again for any help...
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Tue Oct 22, 2013 12:48 pm

Just cut the coin wire and solder it back together with a third wire to go to the Pi.

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 Tue Jun 10, 2014 12:57 pm

adafruit_support_rick wrote:
dev64 wrote:What if the coin line was running at 5v, I could then simply power the pi with the coin line? I should probably determine what voltage is coming out of the coin line using a voltmeter. Can I power and read coin input from the coin line? that would be great! I also need some jumper cables for use with gpios.

The coin line is a signal line. You can't power anything with it.

You can't determine the voltage level of the coin line signal with a voltmeter, as it only carries a few 40 ms pulses when a coin is inserted.
dev64 wrote:On the other hand, this looks more promising and safer way to power the pi
http://www.ebay.com/itm/DC-Converter-St ... 1203074650

That would work.
dev64 wrote:Is there a more elegant way to splice the coin line, i did rather buy a line splitter or a divider. I did rather not go down the path of resistors, the approach seems a bit too hackish.

It's not hackish. You have to reduce the signal level to 3.3V somehow. That's the easiest way.


The coin line is a signal line. You can't power anything with it.

You mean, the resistors in the diagram are only to step down the voltage from the coin line incase it is greater than 3.3v which is what the pi's gpio headers can take?

If the coinline cant be used to power the pi, Do I still have to find an alternate way to power the pi?
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by dev64 on Tue Jun 10, 2014 1:38 pm

To power the pi itself, I am going to use a transformer module with a usb interface. The coin acceptor has a 12v power source provided by the breathalyzer breadboard. So basically I will run the 12v power through the transformer below and the use a usb cable to power the pi.
https://www.dx.com/p/dc-7-24v-to-dc-5v- ... 5c7gPldVfg

As for monitoring coin pulses, I may have to use voltage divider circuit like you explained to make sure the coin line is pulsating at 3.3v so as to not fry the pi. Can you please help me with a shopping list hehe. What do I need to buy besides resistors and perhaps female jumper cables to connect to the gpio headers.

Thanks
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Wed Jun 11, 2014 10:43 am

All you need should be the resistors and the male-male jumper wire. You can install the resistors in your breadboard, and run the jumper wire from there to the Pi.

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 Wed Jun 11, 2014 10:48 am

OK I have a dumb question. A multimeter has two probes +ve and -ve. How can I measure the voltage through the coin line ? I mean dont I need a negative terminal or is it possible to measure the voltage from the coin line?
dev64
 
Posts: 10
Joined: Sat Oct 19, 2013 2:06 pm

Re: interfacing coin acceptor to raspberry pi

by adafruit_support_rick on Wed Jun 11, 2014 12:27 pm

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.

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

Please be positive and constructive with your questions and comments.