LEARN.PARALLAX.COM
Published on LEARN.PARALLAX.COM (https://learn.parallax.com)
Home > Connect a Coin Acceptor to Your Propeller Project

Connect a Coin Acceptor to Your Propeller Project

Want to make an arcade game or vending machine?  Maybe you want to charge customers to use your awesome invention – but how?  Look no further! Coin acceptors have become inexpensive enough for anyone to purchase, so this tutorial is designed to show you how to connect one to your Propeller-powered BlocklyProp project.

 

Hardware Required

  • (1) – Coin Acceptor (this project specifically uses this one from Amazon)
    • If you choose a different coin acceptor, you may need to make modifications to the instructions. Consult your device’s manual.
  • (1) – 12 VDC power supply (#750-00003)
  • (1) – 10 k-Ohm resistor (brown-black-orange) (part of #751-00011)
  • 3-pin cable:
    • (1) – 3-pin cable (#800-00160)  OR
    • (3) – female to female jumper wires (#800-00062)
  • Propeller development board:
    • (1) – Propeller Activity Board or Activity Board WX (#32912)  OR
    • (1) – Propeller FLiP (#32123) plus:
      • (1) – 3-pin breadboard header (#451-00303)
      • misc male/male jumper wires (#800-00016)
      • Note: The header, breadboard, wires and FLiP can be purchased separately or you can get them (and more) together in the Propeller FLiP Try-it Kit (#32023).
  • Misc coins to program the coin acceptor with (20 of each type of coin is best)

NOTE: The 12V supply can be connected to the (→5-9VIN pin) on the FLiP – however be aware that because the input voltage is above 9 volts, if the FLiP module’s power connections are shorted, the FLiP will get VERY HOT.

Circuit Design

Connections differ depending on the Propeller board you choose to work with. The first set of instructions are for the Activity Board or Activity Board WX. The second set of instructions are for the Propeller FLiP on a breadboard.

Building the Circuit (Propeller Activity Board/Activity Board WX)

  • Modify one end of the 3 pin cable:
    • Use a tool with a fine point to carefully lift each of the tabs on the connector:
    • Pull out the wires
    • Arrange the wires so they are ordered RED-WHITE-BLACK and re-insert them into the connector end:
    • Make sure the wires make the following connections when plugged into the coin acceptor:
      • RED -> DC12V
      • WHITE -> COIN
      • BLACK -> GND
  • Make sure the P12-13 shunt jumper is moved from the 5V to the VIN position:

  • Connect the other (unmodified) end of the 3-pin cable to the P12 header.
  • Connect a 10 kOhm resistor between P12 and 3.3V.

 

Building the Circuit (Propeller FLiP)

  • Modify one end of the 3 pin cable :
    • Use a tool with a fine point to carefully lift each of the tabs on the connector:
    • Pull out the wires.
    • Arrange the wires so they are ordered RED-WHITE-BLACK.
    • Make sure the wires make the following connections when plugged into the coin acceptor:
      • RED -> DC12V
      • WHITE -> COIN
      • BLACK -> GND
  • Follow the diagram below to make the connections on the breadboard:

REMEMBER: The 12V supply can be connected to the (→5-9VIN pin) on the FLiP – however be aware that because the input voltage is above 9 volts, if the FLiP module’s power connections are shorted, the FLiP will get VERY HOT.

Setup, Sampling, and Programming

Setting up the Coin Acceptor

  • Locate the NC/NO switch on the back of the coin acceptor.  Make sure it is set to NO.
  • Locate the FAST/MEDIUM/SLOW switch on the back of the coin acceptor.  Make sure it is set to FAST.
  • Power the coin acceptor by
    • Turning the switch to position 2 if using an Activity Board, or
    • Supplying 12V to the coin acceptor (FLiP)

 

Setting the Coin Acceptor’s Parameters

  • Press and hold the ADD and MINUS buttons at the same time for at least 3 seconds.  The letter “A” will appear on the display.
  • Press the SETUP button once, and the letter “E” will appear.
  • Use the ADD and MINUS buttons to set how many different kinds of coins you’d like to accept.  Press SETUP again to set the value.
  • For each type of coin:
    • The letter “H” and a number will appear on the display.
    • Use the ADD and MINUS buttons to set the number of sample coins you will use.  Press SETUP to set the value. You can simply press SET to use the default value of 20.
    • The letter “P” and a number will appear on the display.
    • Use the ADD and MINUS buttons to set the number of pulses this type of coin will output to the Propeller.  This value should be different for each type of coin.
    • Press SETUP to set this value.
    • The letter “F” and a number will appear on the display.  This is the accuracy can can be set from 1 (most accurate) to 30 (least accurate).  Values between 5-10 are typical.
    • Press SETUP to set the value.
    • This completes setup for one type of coin – repeat this section for each type of coin.
  • When each coin type is setup, the letter “E” will appear again on the screen.
  • Disconnect or turn off power to the coin acceptor.

 

Sampling coins

  • Power the coin acceptor by turning the switch to position 2 (ActivityBoard) or by supplying 12V to the coin acceptor (FLiP)
  • It is recommended that you use 20 coins of each type.  This affects the overall accuracy of the coin acceptor.
  • Press SETUP.  The letter “A” will appear on the screen.
  • Press SETUP again.  The letter “A” will be followed by a number.
    • Begin inserting one type of coin.  Keep inserting coins until the lights flash and the number increases.
    • After the number on the display increases, begin inserting the next type of coin.
  • Repeat this process until all coin types have been sampled.

 

Programming the ActivityBoard or FLiP

The coin acceptor connects to the Propeller very similarly to a pushbutton switch:

The coin acceptor “tells” the Propeller what type of coin was inserted by closing the circuit a specific number of times.  Because these are basically pulses, the Propeller can simply wait for the circuit to close, and then count how many pulses it receives.

The following program will work for a coin acceptor that has been set up to send 5 pulses for a US quarter ($0.25), 4 pulses for a US dime ($0.10), and 3 pulses for a US nickel ($0.05):

  • Build the program above.  
  • If necessary, modify the program to match how you set the parameters for your coin acceptor.  
  • Load your program to the Activity Board or FLiP module’s EEPROM.

When you insert a coin into the coin acceptor, it will display the value for that coin:

 

Your Turn

  • The program above can be placed in a function and run in its own cog using the new processor block.  This will allow you to run a monitor for the coin acceptor inside of your program.
  • Try integrating the coin acceptor into your own invention.

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024


Source URL:https://learn.parallax.com/courses/connect-a-coin-acceptor-to-your-propeller-project/
Links