Make Money with Arduino

Picture of Make Money with Arduino
What would I do with a Laser Cutter? Build Simple Robotic Kits to teach people a Hobby that I Love.

Ever wanted to make some money from your projects?
This Instrutable will show you how to Simply interface a coin selector with your Adruino.
And also how to then connect that to your Visual C# Project.
Then it's all up to you and that great idea you have, if it's electronic or a program/game,
The Buck Starts Here.

You will need:
A Coin Selector: There are many different type's, the CH-926 accepts the most amount of coins so thats what I'll be using.
UK Stock, US Stock

Any 12v Power Supply, Batteries or Wall Wart.

An Arduino UNO

Microsoft Visual Express 2010 C#: Free Download, Scroll down until you see the correct option.
Note: Only needed for a coin operated Program, Not electronics Projects.

Let's get Started!
Remove these adsRemove these ads by Signing Up

Step 1: Coin Sampling

For your Coin Selector to know what type of coins it accepts, you have to set it up and then feed it samples of those coins.
It is recommend to sample at least 15 coins of the same type, up to a maximum of 30. Don't feed the same coin through 30 times, it's make the selector to fussy about what it accepts.

A Coin Selector works by comparing the material, weight and size of coins past through it to the samples you provide. If a coin is not reconised it drops out the return slot, if it is reconised the Unit sends out pulse's on the "COIN" line.
So to make it easier for the programming side we use a "greatest common factor" rule.
eg. We'll use the following coins (UK) 5p, 10p, 20p, 50p,& £1, (US) 5c, 10c, 25c, 50c & $1.
All the the coins can be made up with multiple 5p or 5c coins, so we make 1 pulse equal to 5p or 5c.
5p/c = 1 pulse, 10p/c = 2 pulses, 20p = 4 pulses, 25c = 5 pulses, 50p/c = 10 pulses, £/$1 = 20 pulses.

Now, The Setup:

First the switches...
select "NC" by sliding the top switch to the bottom position.
select "FAST" by sliding the bottom switch to the top position.

Power Up the unit with a 12v supply.

1. Hold the "ADD" and "MINUS" buttons down at the same time for about 3 seconds, release and then the letter "A" will appear on the LED display.
2. Press the "SETUP" button once, and the letter "E" will appear. Then use the "ADD" and "MINUS" buttons to choose how many kinds of coins your going to use. Press the "SETUP" button again to finish.
3. The letter "H" will appear. Use the "ADD" and "MINUS"buttons to choose how many sample coins your going to feed it later. Press the"SETUP" button again to finish.
4.  The letter "P" will appear. Again use the "ADD" and "MINUS" buttons to choose the amount of output pulses you want. Press the "SETUP" button to finish. Refer to the above example to determine number of pulses.
5.  The letter "F" will appear. Using the "ADD" and "MINUS" buttons, choose the accuracy. The value is from 1 to 30, with 1 being the most accurate. I use 10 and it works fine. Again "SETUP" to finish.

You have now setup the first coin, depending on how many coins you selected in step 2, you'll have to repeat Step's 3 to 5 for each one.
The letter "A" will appear when you've setup all the coins. Hold "SETUP" for 3 seconds to finish, the letter "E" will appear.
Finally, switch the unit off and then back on.

Sampling time:

1.  Hold the "SETUP" button down for about 3 seconds, release and then the letters "A1" will appear on the LED display. This is your first coin (5p/c)
2. Feed the Coin Selector your sample coins, the LED display will show the amount of coins you've entered. "A1" will appear again when finished.
3. Hold the "SETUP" button down again for about 3 seconds, release and then"A2" will appear, repeat these steps until all coins are sampled.

If your not using all of the coin types available (eg 5 coins of a 6 type coin selector) the unit will ask for samples of a coin type you haven't setup, just hold the "SETUP" button down for 3 secconds of each of the remaining coins.

The Coin Selector restarts itself and is now ready to connect to the Arduino.
pjac821 year ago
How can I store the credit to EEPROM???! in case of powering off and on? SO it starts the count from the memory? I am trying but failing.
thewildman1 year ago
Thanks! Worked well for me. In Australia out $0.50 coin can fit in the slot but can't fit through the eject slot! I will have to hack the casing...
cefn1 year ago
Doesn't the COIN line have to be put through a voltage divider to prevent the ATMEGA pin for receiving more voltage than it can handle? I'm considering wiring one of these up with 6.8k and 5.1k resistors in a voltage divider arrangement to address this issue.

With the available documentation, (and without an oscilloscope on hand), I'm finding it hard to identify what the peak output voltage is from the COIN line, but it's safest to assume it's 12V like the supply in the absence of any other information. Perhaps you have found a data sheet which says otherwise.
I measured it at 3.3V. I go though a 10K resistor between the coin pin an Arduino too and it works fine.
thewildman1 year ago
I measured it at 3.3V. I go though a 10K resistor between the coin pin an Arduino too and it works fine.
sir do you know how to program..L70 bill acceptor to arduino atmega328 ..?
Hello guys, i've this coin acceptor and it recognize my coins (1,2 and 0,5 €) and this is good!
But when i attach it to Arduino, it simply doesn't send any signal, any pulses.

The ground of coin acceptor is connected with ground of supply and arduino ground.
The signal with voltimeter is 0.004 and when i insert a coin 0.016 V.
what's wrong with this little toy? Thanks, so sorry for my English.
Ok guys, that's my problem.

I've purchased the ch-926 Coin Selector and i've programmed it with 1, 2 and 0.50 €.
Next, i've programmed arduino with sample sketch and it didn't work.

There is a pulse when i switch on the coin selector and another when i try to switch between NC and NO.

Anyway it doesn't send pulses when i insert my coins.
So, i've tested it with "Analog IN" ports and it show me a value between 0.03 and 0.09 with this code:

double sensorValue = analogRead(A0);
double voltage = sensorValue * (500 / 1023.0);

I suspect that my Coin Selector is faulty and it doesn't send my pulses.

How can i solve? Any ideas?

Thanks for advices, Paki
This is the code for the Simon game I made with the kids. Each program work on their own but not together. I think it is down to a { or } somewhere in the program. I;m currently getting the following error at the line where I put the stars: a function-definition is not allowed here before '{' token. Any help would be much appreciated.

const int coinInt = 0;
//Attach coinInt to Interrupt Pin 0 (Digital Pin 2). Pin 3 = Interrpt Pin 1.

volatile float coinsValue = 0.00;
//Set the coinsValue to a Volatile float
//Volatile as this variable changes any time the Interrupt is triggered
int coinsChange = 0;
//A Coin has been inserted flag

void setup()
//Start Serial Communication
attachInterrupt(coinInt, coinInserted, RISING);
//If coinInt goes HIGH (a Pulse), call the coinInserted function
//An attachInterrupt will always trigger, even if your using delays

void coinInserted()
//The function that is called every time it recieves a pulse
coinsValue = coinsValue + 0.05;
//As we set the Pulse to represent 5p or 5c we add this to the coinsValue
coinsChange = 1;
//Flag that there has been a coin inserted

void loop()
if(coinsChange == 1)
//Check if a coin has been Inserted
coinsChange = 0;
//unflag that a coin has been inserted

if(coinsValue >= 0.50)
const int led_red = 1; // Output pins for the LEDs
const int led_blue = 2;
const int led_yellow = 3;
const int led_green = 4;
const int buzzer = 5; // Output pin for the buzzer
const int red_button = 9; // Input pins for the buttons
const int blue_button = 10;
const int yellow_button = 11;
const int green_button = 12; // Pin 13 is special - didn't work as planned
long sequence[20]; // Array to hold sequence
int count = 0; // Sequence counter
long input = 5; // Button indicator
int wait = 500; // Variable delay as sequence gets longer

playtone function taken from Oomlout sample
takes a tone variable that is half the period of desired frequency
and a duration in milliseconds
void playtone(int tone, int duration) { <<<<<<*************************************************
for (long i = 0; i < duration * 1000L; i += tone *2) {
digitalWrite(buzzer, HIGH);
digitalWrite(buzzer, LOW);

functions to flash LEDs and play corresponding tones
very simple - turn LED on, play tone for .5s, turn LED off
void flash_red() {
digitalWrite(led_red, HIGH);
playtone(2273,wait); // low A
digitalWrite(led_red, LOW);

void flash_blue() {
digitalWrite(led_blue, HIGH);
playtone(1700,wait); // D
digitalWrite(led_blue, LOW);

void flash_yellow() {
digitalWrite(led_yellow, HIGH);
playtone(1275,wait); // G
digitalWrite(led_yellow, LOW);

void flash_green() {
digitalWrite(led_green, HIGH);
playtone(1136,wait); // high A
digitalWrite(led_green, LOW);

// a simple test function to flash all of the LEDs in turn
void runtest() {

/* a function to flash the LED corresponding to what is held
in the sequence
void squark(long led) {
switch (led) {
case 0:
case 1:
case 2:
case 3:

// function to congratulate winning sequence
void congratulate() {
digitalWrite(led_red, HIGH); // turn all LEDs on
digitalWrite(led_green, HIGH);
digitalWrite(led_yellow, HIGH);
digitalWrite(led_blue, HIGH);
playtone(1014,250); // play a jingle
digitalWrite(led_red, LOW); // turn all LEDs off
digitalWrite(led_green, LOW);
digitalWrite(led_yellow, LOW);
digitalWrite(led_blue, LOW);
resetCount(); // reset sequence

// function to reset after winning or losing
void resetCount() {
count = 0;
wait = 500;

// function to build and play the sequence
void playSequence() {
sequence[count] = random(4); // add a new value to sequence
for (int i = 0; i < count; i++) { // loop for sequence length
squark(sequence[i]); // flash/beep
wait = 500 - (count * 15); // vary delay
count++; // increment sequence length

// function to read sequence from player
void readSequence() {
for (int i=1; i < count; i++) { // loop for sequence length
while (input==5){ // wait until button pressed
if (digitalRead(red_button) == LOW) { // Red button
input = 0;
if (digitalRead(green_button) == LOW) { // Green button
input = 1;
if (digitalRead(yellow_button) == LOW) { // Yellow button
input = 2;
if (digitalRead(blue_button) == LOW) { // Blue button
input = 3;
if (sequence[i-1] == input) { // was it the right button?
squark(input); // flash/buzz
if (i == 20) { // check for correct sequence of 20
congratulate(); // congratulate the winner
else {
playtone(4545,1000); // low tone for fail
squark(sequence[i-1]); // double flash for the right colour
resetCount(); // reset sequence
input = 5; // reset input

// standard sketch setup function
void setup() {
pinMode(led_red, OUTPUT); // configure LEDs and buzzer on outputs
pinMode(led_green, OUTPUT);
pinMode(led_yellow, OUTPUT);
pinMode(led_blue, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(red_button, INPUT); // configure buttons on inputs
digitalWrite(red_button, HIGH);// turn on pullup resistors
pinMode(green_button, INPUT);
digitalWrite(green_button, HIGH);
pinMode(yellow_button, INPUT);
digitalWrite(yellow_button, HIGH);
pinMode(blue_button, INPUT);
digitalWrite(blue_button, HIGH);
randomSeed(analogRead(5)); // random seed for sequence generation

// standard sketch loop function
void loop() {
playSequence(); // play the sequence
readSequence(); // read the sequence
delay(1000); // wait a sec
Serial.println("I'M MAKING MONEY!!!!");


Sebuk1 year ago
Inspired by this set of instructions I have embarked on a project using the CH-926. After successfully getting everything working - Today, when I turned it on, instead of the usual beeps it is displaying E2 and no combination of button pressing makes a difference. Can the units be reset?

frollard Sebuk1 year ago
Looking online the only time you should see 'e' is during training...
Drevious321 year ago
Hey bud, run a spell check ;)
this is so awesome! what projects have you incorporated this into so far?
Skipped (author)  amandaghassaei1 year ago
So far, Just a few simple projects. Like Arduino based Simon Said, Tic tac toe on the PC, etc. Tho I am building a Cocktail Bartending Bot that I am planning on using it in.
The bartending 'bot, to be legal, probably needs a vision system to check ID and to work out when someone has had too much to drink, and an integrated phone to call a cab for those over the limit. Then to make it marketable,it needs to be a good listener and respond appropriately on occasion. ;^)
Skipped (author)  mgalyean1 year ago
Inanimate object's are usually the best listeners ;-) Probably get away with it in a few european countries, I always use to love the beer vending machines in germany. The one I'm building is more for novelty and fun :-) Many conversations will be had tho!
Breathalizer, security cam, UV or rfid whater for the ID.
Sorry this may be a stupid question but, Just so I understand this right. This is used if you wanted to make your own coin opperated video game or any other project coin opperated device so others can use it without you having to be present to collect money directly from them?
Skipped (author)  foreverdisturbed1 year ago
Thats right, Just make sure it's secure if your not around.
Thank you for answering my question.
markvovo1 year ago
Does the mechanism have a refund option? What happens to the COIN pulses if you press the button on the front? I have one ordered, but won't be here for another couple of days.
Skipped (author)  markvovo1 year ago
Hey markvovo, There is no refund option. The button on the front mechanically opens the sensor section of the selector to release jams, these jammed coins drop back into the return slot. The pulses start when they have past this setcion so you'll only get Coin Pulses once actually receiving a coin.
Good luck with your project.
Excellent instructable!.

A refund option could be mechanical. Coins that pass through the counter are collected in a small bin. The customer makes their selection and the coins are dropped into a bucket. If they don't make a selection and select a refund, the coins are dropped out to a refund cup on the outside of the machine... A small servo could activate the midpoint bin, one direction for keep, another for refund.
Skipped (author)  Bonecaya1 year ago
Very True, I'll have to try this. There is enough (All bar 1) spare pins on the Arduino to try use up ;-) Thats for your input.
Edgar1 year ago
Gone to my Blog Post, and voted, too.
Skipped (author)  Edgar1 year ago
Thanks very much Edgar, Glad you like it!
ak088201 year ago
What does this do? Are you building a component of a vending machine?
Skipped (author)  ak088201 year ago
Hey ak08820, you got it. It's the money making part of most vending machine's. So you can attach it to anything you feel like. Could just be used as a fun way to save spare change ;-)
chrwei1 year ago
this is great!

Keep in mind that if you want to use this in a public place, most places (at least in the US) you need a license from the city/county/state for a coin operated machine, and fines for not having one are seriously hefty.
ac-dc chrwei1 year ago
You need more than a license, you need specific permission from the local government that holds the deed to put one on their property, as you would anywhere else that isn't your own personal property, and then if it were on your own property you may at some point need business zoning, then there's the issue of establishing a business for taxation purposes. It is not so simple to make money with arduino after all!
chrwei ac-dc1 year ago
of course. though by public, I meant publicly accessible, like in a store you own/work at.
wwsean081 year ago
this is perfect, I've been eyeing the CH 926 on adafruit for a while, and seeing as I just setup a mysql database to keep track of my money this is giving me the perfect excuse to buy it to automate keeping track of it (yes I know it's overkill for php/mysql but i don't care lol).
mykiscool1 year ago
What, if anything, do you do with the counter meter gray wire?
Skipped (author)  mykiscool1 year ago
You can hook it up to an electronic coin counter. So you'll be able to tell at a clance how much money you've made. I've haven't used one, I just keep count in the program.
Oh ok thanks that makes sense. Also thank you for making this tutorial I had one of these coin slots and was having trouble with it this helps.