Hi.
I made this topic to seek some advice. I'm having an horrendous time trying to make the BV20 bill acceptor from Innovative Technologies work with Arduino Mega 2560. I'm an experienced programmer new to electronics, and I'm just accepting the fact that I won't be able to do this on my own (I did try a lot...).
The BV20 is a bill acceptor/validator, same kind of device you can find in most vending machines worldwide. You insert a bill into the device, it checks it to see if it's real money, and if it is, it sends a signal to a microcontroller informing the credit.
The one I'm using sends the signal through a pulse stream, using one single pin to do it. This is the logical info available from the device manufacturer:
INPUTS
Logic Low: 0V to +0.5V.
Logic High: +3.7V to +12V.
OUTPUTS WITH 2K2 PULL UP
Logic Low: 0.6V.
Logic High: Pull up hostage of host interface.
MAXIMUM CURRENT SINK
50mA per output.
The full manual can be found here: http://kriss-sport.com/dl-files/bv20_operations_manual_20101126.pdf. The info I presented is in the 5th page.
The device outputs a 50ms LOW pulse, followed by a 50ms HIGH for each dollar in a bill (so if I insert a $5 bill it sends a 50ms LOW pulse with a 50ms HIGH interval between each pulse five times).
If I put a led between the pulse pin and the arduino i can (barely) see it blinking the pulses when i insert a bill, so I know the device is working and recognizing the bills, but the arduino keep receiving 0's and 1's randomly.
I've tried every kind of assembly imaginable to make the arduino read the pulses correctly, but it was a complete failure. To be honest, I've used the pulseIn() function with moderate success. If I connect the pulse pin directly into the arduino input pin and use this code:
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT);
pulseCount = 0;
}
void loop() {
int x = pulseIn(2,LOW);
if (x >= 500) {
Serial.println(x);
}
}
I will get some readings of "x" above 500 when a bill is inserted. But that will output anything from 500 to 1200 an inconsistent number of times, independently of the bill. So I can't tell the difference between a $1 and a $5 bill inserted.
I'm trying to make these two work together for weeks now. I'm desperate and I need help. I know it can't be hard to accomplish. Someone can help me out?
Thanks in advance.