Coin Counter/Sorter

This is a (very) primitive coin counter and sorter. It uses infrared sensors to detect coins falling down and calculates the total value of the coins.

Supplies:

You’ll need
4-6 TCRT5000s —> https://www.amazon.com/OSOYOO-TCRT5000-Infrared-Reflective-Photoelectric/dp/B07C69N65P/ref=sr_1_3?crid=EZ01QI4VU3Q6&keywords=tcrt5000&qid=1559565555&s=gateway&sprefix=Tcrt%2Caps%2C130&sr=8-3
Some jumper wires (if soldering isn’t your thing)
Some other wires (about 12 should do)
3D printed coin sorter body by youngcat —> https://www.thingiverse.com/thing:499177
Arduino UNO
Computer with Arduino IDE

Step 1: Print the Sorter Body

Grab your handy dandy 3D printer and download the files from the link in the supplies. Print it out. Should look like this. I taped it, hot glue wasn’t readily available (i.e. too lazy to get some).

Step 2: Wiring

Hook up the the TCRT5000s to some jumper wires and connect each VCC to the positive side of the breadboard, and each GND to the negative. Connect the positive side to 5V and the negative side to GND. Connect the digital output (D0) on the sensors to the arduino. The sensor for dimes should go to pin 12, the sensor for pennies should go to pin 11, the sensor for nickels should go to pin 10, and the sensor for quarters should go to pin 9. Picture attached is very messy because it was hastily wired.

Step 3: Code

It’s my code, and I am not a software designer so no guarantees on the quality of the code.
const int dime = 12;
const int penny = 11;
const int nickel = 10;
const int quarter = 9;
int IRvalueD = 0;
int IRvalueP = 0;
int IRvalueN = 0;
int IRvalueQ = 0;

void setup() {

Serial.begin(9600);
pinMode(dime,INPUT);
pinMode(penny,INPUT);
pinMode(nickel,INPUT);
pinMode(quarter,INPUT);


}
int dimes = 0;
int pennies = 0;
int nickels = 0;
int quarters = 0;
void loop() {
IRvalueD = digitalRead(dime);
IRvalueP = digitalRead(penny);
IRvalueN = digitalRead(nickel);
IRvalueQ = digitalRead(quarter);

double money = 0;

if(IRvalueD == LOW) {
dimes=dimes+1;
money=money+.1*dimes;

}
if(IRvalueP == LOW) {
pennies = pennies+1;
money=money+.01*pennies;
}
if(IRvalueN == LOW) {
nickels = nickels+1;
money=money+.05*nickels;

}
if(IRvalueQ == LOW) {
quarters = quarters+1;
money=money+.25*quarters;
}




Serial.print("You have $");
Serial.println(money);

delay(50);


}

Step 4: Some Assembly Required

I used a piece of wood to keep the IR sensors in place. Not the best. If I had more time there would be a better system to hold them in place.

Step 5: Count Your Coins

Put some coins in and count your money.

Share

    Recommendations

    • Beauty Tips Contest

      Beauty Tips Contest
    • Fandom Contest

      Fandom Contest
    • Frozen Treats Challenge

      Frozen Treats Challenge

    Discussions