Introduction: 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.


You’ll need
4-6 TCRT5000s —>
Some jumper wires (if soldering isn’t your thing)
Some other wires (about 12 should do)
3D printed coin sorter body by youngcat —>
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() {


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) {

if(IRvalueP == LOW) {
pennies = pennies+1;
if(IRvalueN == LOW) {
nickels = nickels+1;

if(IRvalueQ == LOW) {
quarters = quarters+1;

Serial.print("You have $");



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.