Hi, I am new to Arduino and also new to this forum. I made comment on a post earlier but realised that it may not get picked up as it is quite an old post.
Here is the link to original post:
My comment in the post was to get some advice on a similar project but putting an Arduino in place of the Ticket Dispenser to count tickets. The Arduino will hopefully be able to read when the ticket dispenser is turned on and then pulse back to the machine as if a ticket has been read. Once the machine 'thinks' all tickets have been dispensed the Arduino would recognise that the 'virtual' dispenser has been disabled. I'm not looking for any code at this point but what hardware I should purchase to help achieve this. Thanks in advance.
That doesn't quite make sense to me. If the Arduino has replaced the ticket sensor, then the ticket dispenser is no longer there, so how could the Arduino read if a non-existant ticket dispenser is on or off? Please rephrase your question/problem.
Start from scratch and state your plan in simple logical flow. Provide as much detail as you know and links to any components. It is generally not great form to hijack an old thread so just make this one have all the info on it. It is likely to be you that needs to research hardware and then Ask questions
Sorry @PaulRB. A gaming machine controls the ticket dispenser. So currently when tickets are ready to be paid, the machine enables the motor on the ticket dispenser and then for each notch in the ticket dispenser, it reports back to the machine. Once the number of tickets is dispensed the machine disables the Ticket Dispenser.
What I want to do is replace the ticket dispenser with an Arduino that can detect when the machine enables the dispenser ( I have assumed when it applies voltage to the pin - see link to dispenser below). Once the Arduino detect this it should then send back a signal acting as if a ticket has passed the notch. Once the machine thinks it has paid out all the tickets, the arduino will see a disable motor signal.
I hope this explains a little better. I have little electronics knowledge or Arduino knowledge but I am a programmer - albeit Pascal This is why I needed help selecting the right hardware that wold be able to cope with the signals.
Your project sounds absolutely achievable. Any basic Arduino will do the job. The only question is what voltages and currents are involved in signalling between the gaming machine and the dispenser. The Arduino can easily be damaged by voltages or currents that are too high, so some components may be required between them to deal with that.
Hmm, I'm not sure why the link isn't downloading for you. If I click it the PDF shows straight away. This is a screen snip from the PDF.
It looks like a signal between 2.5-12v enables the motor so that is what the Arduino would be looking for. Then it would have to send the notch part back to the machine.
These specs seem to be what signals the ticket dispenser can accept. What you really need to know is what signals the gaming machine will actually output, because those are what you need to adapt for the Arduino. Could you simply measure those with a multimeter? In other words what voltages do you see from the gaming machine's motor enable output when the motor should be on/off and what is the voltage on the ticket notch input.
Thanks @PaulRB. I won't get chance to look at this until the weekend. I suspect that because the Ticket Dispenser is used in many different types of gaming machines that I really need to monitor the output when it is in that range and protect the Arduino in someway to allow upto the 12v? It may be possible for me to test on something here tomorrow so I will report back.
@PaulRB, I checked out a board I used in the past that pays out tickets through serial communication. The notch wire (blue) sits at around 6.2v when the dispenser is idle. The enable wire (white) is at 0 volts. Once the dispenser is sent a signal 2.5v is sent to the white wire and the dispenser starts. Each ticket that passes, pulls down the 6.2v to zero as the notch appears.
I hope this helps to determine what hardware I would need to purchase and if any other components are required to protect the Arduino.
It does make the circuit slightly more complex, but no major concern .
6.2V is slightly too high to expose an Arduino pin to directly. A transistor will be needed to pull this down to 0V without being directly connected to the Arduino pin. An ordinary npn like bc337 will be fine, with a current limiting resistor (eg. ~1K) connecting it's base to the Arduino pin.
2.5V is a little too low to register as HIGH for a digital pin. There are a couple of options here.
Use an analog input pin. A 2.5V signal should give a reading of around 500. The signal must not exceed 5V using this technique, or the Arduino pin could be damaged.
Use another transistor to pull a digital pin low when the 2.5V signal is present. Another bc337 would be fine, with a current limiting resistor on its base and the arduino pin's internal pull-up resistor enabled. This would also allow that signal to be up to 12V if used with a different gaming machine.
Question: would there be a problem if the ticket notch signal was pulled low every 300~500ms continuously, regardless of whether the motor enable pin is high or low? Would this be detected as some kind of error by the gaming machine? If not, it would simplify things!
I don't think the machine would go into alarm from experience. It usually only goes into error when trying to pay a ticket and nothing passes the notch.
If you already have an Uno, then use that, but don't buy one for this project.
An Uno is designed to have "shields" plugged on top of the Uno. A shield is a specially designed pcb for some purpose with a similar shape to Uno. If not using any kind of shield, Uno is not a good choice.
For your first Arduino, I would recommend a Nano 3, because they are breadboard compatible, which is a good way to prototype your circuit.
Your project needs so few pins that something like a DigiSpark board would be more than adequate. However, they are a little trickier to get started with compared to Nano, if you are a beginner.
I would still need to monitor the motor as the intention would be that the notch not only tell the machine it has paid but stores the count on the Arduino.
@PaulRB, yes a display and later once I know the communication is possible between this and the machine, it will up updating a local server over WiFi. It's the first part I need to know is possible as the rest should be easy (he says for a beginner).