CH-923 + Arduino Uno + PC wiring


hi,

i'm trying connect ch-923 coin acceptor (like one: https://www.youtube.com/watch?v=wlgwcs-utim ) arduino uno r3 microcontroller , send information pc when coin inserted.
i've set (3 types of coins, 30 samples each).
right cannot make work, looses signals or adds additional random signals.
this arduino sketch:
code: [select]
void sendinfo(const __flashstringhelper* head, char* data){
  serial.print(head);
  serial.println(data);
}

void setup()
{
  serial.begin(115200);

  attachinterrupt(0, acceptorcount, rising); //digital interrupt pin 2
 
  sendinfo(f("_on"), "");
}

void loop()
{
  //
}

void acceptorcount()
{
  sendinfo(f("+1"), "");
}


my wiring, real photos of connections, settings of coin acceptor etc in attachements. i've tried lot of options pull-up resistor (500 ohms, 1kohms, 1k2 ohms, 4k7 ohms, 47k ohms 100k ohms etc), changing settings of coin acceptor, attaching coin acceptor ground (i mean it's casing isn't grounded attached wallet socket's ground).

right give me exact number of signals (1 polish zloty = 1 pulse; 2 polish zlotys = 2 pulses, 5 polish zlotys = 5 pulses), gives me random pulses. ideas should prevent ivalid pulses , keep correct pulses?

have nice day,
jk.

bottom line can not serial print inside interrupt service routine. note variables used both inside , outside of 1 should volatile.

you need connect ground of coin counter ground of arduino.


Arduino Forum > Using Arduino > General Electronics > CH-923 + Arduino Uno + PC wiring


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code