Basic tutorials for ticket dispensers

Ticket in is to channel voltage to the dispenser and move the ticket roller.

Ticket out is to track the number of how many tickets have been released, like if the dispenser has released 10 tickets then ticket out would release 10.

it's not a specification...

so do you trigger this with a pulse, 12 V or 5V ? or do you need to keep the voltage on until the ticket is out? how do you know the ticket is out in this case? how much current does it require if you need to keep the voltage on?

how does one wire says "10 tickets released" ?? a pulse (5V, 12V ?) every time a ticket goes out?

that's the type of info you need

There is a table on the last page of the document that is linked to in post #19.

It's not very well written but it says 'Motor Enable On Voltage' min 6V, max 12V.
I assume this is the voltage requirements for 'Ticket In'.
It also mentions the 'Motor Enable On Current' min 1.6mA, max 3.6mA.

Yes I've seen this

I think it's more likely for pin 3 the DC +12V and GND

➜ It tells you what you should expect for the whole device.

It does not tell you what the commands should look like (pulse or stable voltage for the duration of a ticket extraction).

Point 5 and 7 are useful though as they seem to indicate you can set a HIGH on "Motor Enable" between 6 and 12V and to switch if off a LOW is below 1V and the command does not draw much current. it's too bad they don't refer to the Ticket In and ticket out pins from the other diagram...

It's still unclear how you know a ticket is out, may be it's up to you to keep the motor running for the right amount of time.

Anyway, your Arduino cannot create a HIGH of 6V min, so you'll need a transistor for the command. then you can explore if it's a pulse or it needs to be there for the whole time assuming the enable pin is Ticket In or Out...

It is very unlikely that a Chinese manufacturer of ticket dispensing equipment has written a tutorial for using their ticket dispenser with an Arduino. Especially since there doesn't seem to be any technical documentation on the interface anywhere on the Internet.

I think you will need to reverse-engineer the interface. My instructions on Reply #7 would be a start toward that.

If you want to pay someone to do the reverse engineering and write a tutorial for you, post that under Community -> Jobs and Paid Consultancy:

OK now I'd answer this.

Actually, the ticket only dispenses if the input is connected to Ground. Yeah here 'IN' is connected to Ground and only worked with that.

With +12V pin used, then the voltage at IN is 4V when measured. The IN worked with Ground so yeah when it worked the voltage would be reduced to 0V.

The OUT part is to detect tickets (e.g. remaining number of it) and makes use of IR sensor, so yeah the OUT here would be connected to Arduino pins like regular IR sensor, and thus the voltage would be 0V (IR Sensor LOW) if it detects tickets but would be there (but small like approximately 2) if there are nothing detected (IR Sensor HIGH).

Did not get anything from your explanation… :grimacing: sorry

I was just answering certain question sorry, but to explain more for the OUT part, the OUT is well, the output (the dispenser makes use of IR sensors to detect tickets and the OUT pin is the IR sensor's output), for Arduino it'd be connected to like, pin 2 or 3 or 4 or 7 or 9 any of that.

are you sure it's 5V compatible?

Huh? What's the relation between the pin 2/3/4/7/9 with VCC? Pretty sure there are some devices that use external power supply like 12V VCC, but had its output connected to Arduino's pins.

Sorry if I misunderstand but dunno.

I'm asking if this OUT signal is compatible with an Arduino pin which cannot accept more than 5V (give or take). Say if this OUT signal is 6V then you risk killing your Arduino's pin

When measured, the OUT signal there only had small voltage like approximately 1-2V.

I assume this is when there is a ticket present so that will be read as LOW by your arduino if you connect on "pin 2 or 3 or 4 or 7 or 9 any of that"

is the other value like GND (0V) when there is no ticket?

➜ in which case you could not tell which is which with a digital pin. an analog pin would do

Yeah I meant connected to one of Arduino's digital pins for the OUT (from the dispenser). IN (from the dispenser) is connected to the GND, +12V and GND pins (from the dispenser) are connected to external power supply's 12V VCC and GND respectively.

and ?

Sound to me like IN will work with an Arduino OUTPUT pin. Set the pin to LOW to dispense tickets. Set the pin HIGH to stop.

Sounds like it is an 'Open Collector' output which would work with an INPUT_PULLUP pin.

Perhap the code in this old post will be of help in getting the timing right:

I guess this'd mean both the IN (=ENABLE_PIN?) and OUT (=INTERRUPT_PIN?) are connected to the Arduino digital pin based on the use of #define?

Also, trigger wasn't declared here? (or amountToDispense)

Yes. You have to decide which digital pin you are going to use for OUTPUT to the "TICKET IN" pin and which digital pin you are going to use for INPUT_PULLUP from the "TICKET OUT" pin. In the example code the INPUT_PULLUP pin is used for an interrupt input so you would need to choose one of the External Interrupt pins: 2 or 3 on the UNO/Nano/Leonardo/Micro.

OK. Then how about the trigger and amountToDispense variables there?

That is just an EXAMPLE of how you would use the dispenseTickets() function.

'trigger' is whatever condition in your program means that it is time to dispense one or more tickets. Only you know when you want to dispense tickets.

'amountToDispense' is the number of tickets you want to dispense. You can make that a constant, like 1.