Purpose / Reason why i would do this:
Simply because the device is cheap and easily accessible for most people, and the pulse count output that it comes with is pretty lame, it misses coins and is a pain in the butt to train the device, however the diagnostic terminal on the bottom puts out information that is essential what ever coin is passed through it weather it accepts it or not. im also thinking that the information on whether it accepted the coin or not is also in the packet. this would mean the end of days for counting pulses, instead the pulse output could be used as a means to interrupt the arduino. another advantage to this would be you would be able to identify more than the stock 6 types of coin, in the us we have 6 major coins, but there are more coins in circulation and each of them are slightly different. (50c piece, silver dollar, susan b anthony, gold dollars, quarters, nickles, dimes, pennies)
What I have so far:
through the only article i can find on the internet i have established that there is a serial output coming from the bottom diagnostic connector on pin 2 or pin 5 depending on how you hold the device, the information as the article says is 19200 baud, however the information i get from the terminal is different than the article, inside the device is a 12c5208AD micro controller it emits serial from the 5th pin, which is how i tracked it to the the diagnostic port is with a continuity meter.
data collected:
with my initial test i collected some information using this code:
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Serial 1: Online");
Serial3.begin(19200);
while (!Serial3) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Serial 2: Online");
}
void loop() { // run over and over
if (Serial3.available()) {
//int incomingByte = Serial3.read();
// Serial.print(incomingByte, HEX);
// Serial.print(' ');
//Serial.write(Serial3.read());
//Serial.write(cmd,12); // Request Match from scanner
//delay(100);
//cnt = 0;
word mybuffer[11];
unsigned long startWait = millis();
while (Serial3.available() < 10 && (millis() - startWait < 3000))
{
// Don't do a thing
}
// At this point, there are 12 characters or we waited too long
if (Serial3.available() >= 10)
{
for (int i = 0; i < 10; i++)
{
mybuffer[i] = Serial3.read();
}
for (int i = 0; i < 10; i++)
{
Serial.print(mybuffer[i], HEX);
}
Serial.println(' ');
}
else
{
// No reply from scanner in reasonable time
}
}
if (Serial.available()) {
Serial3.write(Serial.read());
}
}
is is pretty clear lat the two beginning identifiers are unique to perhaps the diameter of the coin, what the information is im really not concerned with exactly because it could be a bunch of variables telling the actual parameters of the individual coin, which if i worked for the department of weights and measures would probably be really useful, however right now i just need it to identify ALL of the US coins that are currently in circulation.
All coins USD
5, 50c pieces
16B09091FD1FB
16809091FD1FB
16909071FD1FB
16B09091FD1FB
16D09091FC1FB
5, Gold Dollars
17901E06F1FC1FB
17601E06E1FD1FB
17501E0691FC1FB
17401E06F1FC1FB
17401E06D1FD1FB
5, Nickles
1E215F1F51FD1FB
1E315B1F31FD1FB
1E015C1F51FD1FB
1E315F1F51FD1FB
1E01561F31FC1FB
5, Dimes
1890AE1FD1FC1FB
1890BE1FC1FD1FB
1890A81FC1FD1FB
1890AB1FD1FD1FB
18C0B31FD1FD1FB
5, Pennies
19909C1F91FC1FB
19A09F1FB1FC1FB
19B0931FB1FD1FB
19A0A01FC1FD1FB
19109B1FD1FD1FB
it is probably of worthy note that all of the above coins were rejected because the unit i have is broken, so the values of an accepted coin may be different i wont be able to see that for about another week when i get the replacement in.
obviously if i use the information i can collect currently as a hash it will fail most of the time, so what do you think the best way of "converting" or using this data to identify the coins would be?
in the next couple hours i am going to try the simplest approach and see what sort of results i get, and that is if i add all of the numbers together and average them to see if there is enough variation in the hashes to tell them apart. if you have a better option i would totally love to hear it, as well as any positive and general advice anyone may have .