I was wondering if someone could please take the time and create a complete multi coin acceptor tutorial?
Looking at all the topics, i only see bit and pieces.. nothing that really stands out as complete.
for instance, i purchased a 616 multi coin acceptor (accepts up to 6 different coins):
but all the sample coding i find online are for 1 coin acceptors and i have search and searched and all i see on here is people trying to make that code work for multi coin acceptors - well, that doesn't work.. so it would be really nice if someone that has actually accomplished in making their multi coin acceptor work properly to share with a tutorial.
also, i created a TOPIC to use 1 power supply instead of 2.. yet nobody has given me a diagram nor showed me any parts i need to accomplish this.
now, i request this not just for myself but for anyone else that has or intends on getting a muti coin acceptor and are just as new/lost as i am..
i'm still waiting for the coin acceptor to come in the mail.. any day now actually.. so i can't tell you or post the specs..
more looking for a tutorial on the coding portion.. as for the power supply issue, again still waiting on the coin acceptor to come in, but as stated in the topic link i provided there will have to be a step down voltage regulator.. but we'll keep that convo in that topic.. here is where i would like the coding tutorial.
all i am asking for is a complete tutorial so that everyone can make use of it.. i been looking for 3 days now, and still no complete tutorial for multi coin acceptors.. just single coin ones.
this is what i am thinking and came up with so far... i don't need serial code as i will not be using the serial monitor at all...
/*
*REMEMBER TO STORE THE 7 ITEMS INCASE OF POWER OUTAGE
*/
#include <Wire.h>
#include <hd44780.h> // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
hd44780_I2Cexp lcd; // declare lcd object: auto locate & config exapander chip
// LCD geometry
const int LCD_COLS = 20;
const int LCD_ROWS = 4;
// RESET button
const int ResetButton 3; // this will reset ALL counts.. NO TURNING BACK AFTER PRESSING
// MENU button
const int MenuButton 4; // this the button in the front that will change the LCD screen through 3 phases with delay per phase - i'll get to this later.. when it's time to call the 7 counts
// the next 7 we want to keep in memory even after a power outage
// attach coin wire to digital 2
volatile int coins;
// other int's
int Pennies; //how many pennies
int Nickles; //how many nickles
int Dimes; //how many dimes
int Quarters; //how many quarters
int HalfDollars; // how many half dollar coins
int DollarCoins; // how many dollar coins
void setup() {
// put your setup code here, to run once:
pinMode(ResetButton, INPUT);
pinMode(MenuButton, INPUT);
int status;
status = lcd.begin(LCD_COLS, LCD_ROWS);
// i'm assuming something like this... i could be wrong
PinMode(COIN, INPUT);
digitalWrite(COIN, HIGH); //pull up
coins = 0;
}
void loop() {
// put your main code here, to run repeatedly:
// this is for when the machine is doing nothing and waiting for coins to be inserted
lcd.setCursor(0, 1);
lcd.print(" INSERT ");
lcd.setCursor(0, 2);
lcd.print(" CHANGE ");
delay(500);
lcd.clear();
delay(500);
//in here has to be something for each of the 6 coins.. but keep a dollar format with commas when needed IE: $1,000.00
// if a penny is added, add 1 cent to count
// if a nickle is added, add 5 cents to count
// if a dime is added, add 10 cents to count
// if a quarter is added, add 25 cents to count
// if a half dollar is added, add 50 cents to count
// if a dollar coin is added, add $1.00 to count
// keep in mind we are saving coin counts of every coin as well as the the TOTAL dollar amount saved in case of power outage
// i also assume something like this... i could be wrong again..
// while the coin pin is low (no coin detected), do nothing
while (! digitalRead(COIN)) {
delay(1);
}
}
What you're asking for - is very specific to your requirements - so is unlikely to be useful to many (if any) other coders.
Generally the help given here is for people that got 'so far' then struggled, or are discussing fundamental questions that may be encountered by others.
We're always ready to help - but the OP's must have made some effort to start the journey.
Connecting the 0V wires together is not a big step.
Your code attempt is a valid start - but while you're waiting for the machine to arrive - read up on the switch() case: construct. You will need to consider using break;
all i am asking for is a complete tutorial so that everyone can make use of it
spycatcher2k:
This is not possible!
In OP's defence, they're not actually asking for a turnkey solution for their problem. In the opening post they asked:
so it would be really nice if someone that has actually accomplished in making their multi coin acceptor work properly to share with a tutorial.
They'd be happy to see an explanation of someone's working solution. It's a perfectly reasonable ask: if someone has done it before, please make a tutorial. Not like they're asking someone to magic up a tut out of thin air, for an unseen device.
If the OP were able to provide the hardware and its datasheet then I would be prepared to consider writing a guide on using that hardware, but it would not be generally applicable to all coin acceptors.
I would, however, need the datasheet first so that I would know what I might be getting into before committing to doing anything, and the timescale might be quite extended.
The OP could, of course, ask for help and a quote for writing a guide in the Gigs and Collaborations section of this forum.
I just had another look at OP’s code snippet in post #5
Apart from the basic interfacing, i’d probably move away from naming specific coin types - to an array of coin types (struct), with the names and denominations, so the codeis easily modified for any number of different coins and face values.
How are you going with counting coin pulses?
Any progress yet?
lastchancename:
What you're asking for - is very specific to your requirements - so is unlikely to be useful to many (if any) other coders.[/b]
not really. it"s just basic coding for a multi coin acceptor would work for any multi coin acceptor whether it be a 3 coin, 4 coin or 6 coin.. so it is not a far fetched idea for a general complete tutorial to be made.. if you look, there are tons of topics being made about multi coin acceptors because there is no general multi coin acceptor tutorial.
when the acceptor arrives i will post the specs.. tho juma_yetu seemed to find it without even having the unit on hand.
first off, this is not for a "change machine".. secondly we are NOT using a coin hopper.. this is basically for like a piggy bank where you SAVE money NOT change it.. the code there is useless and honestly... why on earth would anyone even try to sell code when you can get it free with contribution and effort? Are we not here to teach, share and help freely? his code and method are NOT what i was trying to get to as for a tutorial.. and if anyone wants to to do a tutorial on here about a "CHANGE" machine, i'm all for it but a piggy bank and change machine are 2 totally different things.. and require different hardware..