Section 5

Coin Validator and Escrow

Validator

ESCROW:

Both

NOTES:

Capturing this data took weeks with a logic analyzer, watching responses to every possible coin combo that I could find. I went to the RBC and got a coins from just about every era in Canada and the US. They are a great resource. It was frustrating because when I finally got it talking and had it accepting 5c coins, it would accept 10 x 5c coins, but one would be rejected. I finally figured out that they are all multiple different coins, the year is different, the image is different, and obviously the metal content must be different.

So far, this is what I have learned, its enough to work with the validator so its as far as I am going with it.

The 10 conductor cable is the one that connects the Validator to the arduino.

Pin 1, 4, 5, 6, 7 and 8 are all common negativePin 9 is +12VDC Pin 10 is Reset 9 (low for reset)Pin 2 is Data Out From ValidatorPin 3 is Data Into Validator

Commands are given in ASCII format.

Commands To Validator:

g - Reset and give status responsec - rotate escrow to cash its coins, pause and return to null positionf - rotate escrow to refund its coins, pause and return to null positione(n) - enable the acceptance of coin number (n) where (n) = 0 to 9 and a to e

I have no idea if there are more, but this is what i have found so far:

1 - Canadian 5 cents2 - Canadian 5 cents3 - Canadian 10 cents4 - Canadian 25 cents5 - Canadian loony6 - US 5 cents7 - US 10 cents8 - US 25 cents9 - US $1.00 Coina - Canadian 5 centsb - Canadian 10 centsc - Canadian 25 centsd - Canadian loony e - Canadian loony

*********************************

** Command Set information **

*********************************

Testing results:

G = Escrow attached AIDEscrow detached ADII(A = Good)(ID = Escrow Attached)(DII) = Escrow detached)I = Object in cashbox drop (Probably full) of escrowI = object by path selector of validatorI = object in kickout path of escrowD = object in main escrow entry (kickout path)J = Jam in coin slot validtor0 = invalid coin

** The above is just a guess at the last of the info I could not figure out.

**Bellow, I have been able to confirm these commands:COIN VALIDATOR SLEEP MODE 's'COIN VALIDATOR WAKE UP 'g'CALC COIN VALIDATOR CHECKSUM 'k'ACCEPT NEXT COIN 'x'ACCEPT ALL VALID COINS 'a'REJECT ALL COINS 'z'COLLECT ESCROW 'c'REFUND ESCROW 'f'ESCROW NULL 'n'LEARN ESCROW 'l' <- Very important, they wont work together otherwise.REQUEST COIN STATUS 'r'DISABLE SPECIFIED COIN 'd'ENABLE SPECIFIED COIN 'e'READ COIN VAL ADDR 'q'RESPONSEA = Validator / Escrow pair test out AOK (issuing the "g" command will wake the unit and let you know what failed. Have not documented failures yet.G = Validator Received invalid command.

SOFTWARE EXAMPLE:

//Code based off Arduino Mega 2560
//SoftwareSerial mySerial(2, 3); // RX, TX
//Validator Pinout:
// Pin1 - GND
// Pin2 - Data out from Validator
// Pin3 - Data in to Validator
// Pin9 - +12vDC (draw is 10ma)
// Pin10 - Reset, leave high +5vDC, its not used.
 
void setup() {
  Serial1.begin(600);
  Serial.begin(9600);
  Serial.print('Program Start');
  Initialize();
  delay(50);
  Serial1.print('a');
  
}
void loop() {
byte c;
if (Serial1.available() > 0)
  {
    while(Serial1.available() > 0) {
      c = Serial1.read();
      Serial.write(c);
    }         
  }  
if (Serial.available() > 0)
  {
    while(Serial.available() > 0) {
      c = Serial.read();
      Serial1.write(c);
    }         
  }  
}
void Initialize() {
   Serial1.print('g'); //Wake up Validator (Sleep is 's')
    delay(10);
    Serial1.print('l'); //Pair to escrow, if you dont, 3/4 of all coins will fail
    delay(10);
    Serial1.print('z'); //Reject all coins.
    delay(100);
    //Initialize all known coins.
    for(int i = 0;i < 9;i++) {
      Serial1.print('e');
      Serial1.print(i);
      delay(100);
    }
    Serial1.print('e');
    Serial1.print('9');
    delay(100);
    Serial1.print('e');
    Serial1.print('a');
    delay(100);
    Serial1.print('e');
    Serial1.print('b');
    delay(100);
    Serial1.print('e');
    Serial1.print('c');
    delay(100);
    Serial1.print('e');
    Serial1.print('e');
    delay(100);
    Serial1.print('e');
    Serial1.print('f');
    delay(100);
    Serial1.print('k'); //Verify Checksum, avoids random errors
    delay(100);
    Serial1.print('a'); //Accept all KNOWN coins.
}