Need help in coding timer to be display in lcd and timer in relay


#41

that sucks :confused: Where’d you get it from?


#42

This is the output, and the relay is still on, i will try to disassemble and assemble the hardware


#43

I bought it here in the link below
http://www.e-gizmo.net/oc/index.php?route=product/product&product_id=761


#44

I doubt you can read the state of coin inserts via simple digitalRead if the output from the device is PWM. On that page it says this:

Output Type: PWM

That means the output signal is a pulse width modulated signal. You should probably use analogRead. Try adding the following in the loop where you see “Waiting for pulse”:

int val = analogRead(Coinpin);       // read the input pin
Serial.println(val);             // debug value

Watch what happens to the value when you insert a coin. Maybe different coins show different values?


#45

With any luck, it’ll be a replica of the Sparkfun coin acceptor (https://www.sparkfun.com/products/11636) which has a few documents you can download, one of which is the datasheet. Do the connectors on yours resemble those of the Sparkfun coin acceptor?


#46

Did you try calling them? Maybe they can email you the information.


#47

Ill try to change the wiring and ill update the codes :slight_smile:


#48

pulseIn function ?
https://www.arduino.cc/en/Reference.PulseIn


#49

I very much doubt that. You’re going to need a datasheet and probably a library to read from the coin acceptor. Without that you’re going to have a very hard time making this work.


#50

Hey, guys I just thought of something. Why don’t we continue this discussion until we reach 100? I mean we’re pretty close to it. That way we can get the reader badge.


#51

Thank you sir i’m goin to stick in this codes. :smiley:


#52

This is the updated codes, in this codes the fucntion of the system is opposite when you insert coin the relay turns off with a 5 sec time :smiley: but after the 5 sec the relay continue to go on
CZONETRIAL1.ino (3.0 KB)


#53

That’s a little strange; you print coinpin LOW in the branch of code for when it’s HIGH and vice versa.

What is the serial output you see?


#54