ardutronic
Published © CC BY-NC-SA

Electronic Coin Sorter

The basic element of every vending machine is the money counter, but prices are from $100, so I have to do it myself!

IntermediateFull instructions provided6 hours1,995
Electronic Coin Sorter

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
IR receiver (generic)
×1
IR transmitter (generic)
×1
USB Li Ion Battery Charger
Adafruit USB Li Ion Battery Charger
×1

Software apps and online services

Arduino IDE
Arduino IDE
Fusion 360
Autodesk Fusion 360

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot Air Station, Industrial
Hot Air Station, Industrial

Story

Read more

Custom parts and enclosures

COINSORTER.stl

coin1.stl

coin2.stl

Schematics

Schematic

Eagle

Board

Eagle

Code

Coin_Sorter.ino

Arduino
No preview (download only).

Coin Sorter Code

C/C++
Arduino IDE
byte zeroOne;
byte zeroTwo;
byte zeroFive;
byte one;
byte two;
byte five;
byte myTime = 500;


void setup() {
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  Serial.begin(9600);
  }


  void loop() {
    zeroOne = digitalRead(5);
    zeroTwo = digitalRead(6);
    zeroFive = digitalRead(7);
    one = digitalRead(9);
    two = digitalRead(8);
    five = digitalRead(10);
    showCoin();
    delay(5);
  }

  void showCoin()
  {
    if (zeroOne == 0)
    {
      Serial.println("0.1");
      delay(myTime);
    }

    if (zeroTwo == 0)
    {
      Serial.println("0.2");
      delay(myTime);
    }

    if (zeroFive == 0)
    {
      Serial.println("0.5");
      delay(myTime);
    }

    if (one == 0)
    {
      Serial.println("1");
      delay(myTime);
    }

    if (two == 0)
    {
      Serial.println("2");
      delay(myTime);
    }

    if (five == 0)
    {
      Serial.println("5");
      delay(myTime);
    }
  }

  void reading()  {
    Serial.print("6: ");
    Serial.println(digitalRead(6));
    Serial.print("7: ");
    Serial.println(digitalRead(7));
    Serial.print("8: ");
    Serial.println(digitalRead(8));
    Serial.print("9: ");
    Serial.println(digitalRead(9));
    Serial.print("10: ");
    Serial.println(digitalRead(10));
    Serial.print("5: ");
    Serial.println(digitalRead(5));
    delay(1000);
  }

Credits

ardutronic

ardutronic

3 projects • 0 followers
My name is Wojciech and I'm 18 years old student of electronic technical college. I'm passionate about electronics as well as editing movies

Comments