This Arduino Based Coin Value Identifier Circuit is a simple for coin sorting machine, it can detect and sort 2 Rs, 5 Rs, and 10 Rs coins.
Different IR sensors detect each coin type and the Arduino reads the triggered sensor and displays the value on the LCD.
Also, this project is useful for small vending machines and coin counters.
Arduino Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int sensor2 = 2;
int sensor5 = 3;
int sensor10 = 4;
int total = 0;
void setup() {
lcd.init();
lcd.backlight();
pinMode(sensor2, INPUT);
pinMode(sensor5, INPUT);
pinMode(sensor10, INPUT);
lcd.setCursor(0,0);
lcd.print("Coin Sorter");
}
void loop() {
if (digitalRead(sensor2) == HIGH) {
total += 2;
showTotal();
delay(1000);
}
if (digitalRead(sensor5) == HIGH) {
total += 5;
showTotal();
delay(1000);
}
if (digitalRead(sensor10) == HIGH) {
total += 10;
showTotal();
delay(1000);
}
}
void showTotal() {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Total: ");
lcd.print(total);
lcd.print(" Rs");
}Code Explanation:
- We included Wire and LiquidCrystal_I2C library for LCD.
- We have set LCD address 0x27 and size 16×2.
- Three sensors connected to digital pins 2,3,4.
- We keep variable total = 0.
- In loop we can check if any sensor is HIGH.
- If yes then we can add coin value to total.
- Then we call showTotal() to update LCD.
- We give delay so same coin not counted twice.
Circuit Working:

Parts List:
| Components | Quantity |
|---|---|
| Arduino UNO | 1 |
| IR Sensor | 3 |
| 16×2 Alphanumeric LCD | 1 |
| I2C Module for 16×2 (1602) LCD | 1 |
When a coin passes through a slot, it passes near a sensor, the sensor gives HIGH signal to Arduino.
Then Arduino checks which sensor pin is HIGH and it adds the coin value to total amount and then it then shows total amount on LCD.
The circuit places each sensor in a different slot size to detect specific coin sizes, and the LCD updates every time it detects a coin.
Simple ways to build structure to detect and sort three coin type:
- Acrylic sheet 3mm to 5mm smooth, hard, easy to cut and looks neat.
- Plywood 4mm to 6mm, cheap, strong, easy to glue and easy to nail.
- Cardboard is only for test which is very easy to cut but weak.
- 3D printed plastic PLA or ABS, if 3D printer is there which makes very accurate shape.
- Make slanted channel or slide, so coins roll one by one.
- Cut three holes of different size at different place.
- Smallest hole for 5 Rs coin.
- Medium hole for 2 Rs coin.
- Largest hole for 10 Rs coin.
- Each hole has one IR sensor pair Emitter one side and receiver other side which detects the coin.
- Put soft rails from foam or felt.
- This stops coin to bounce or tilt.
- Place small trays under each hole to collect coins.
- Use hot glue or screws or super glue to join pieces.
- Paint inside black or cover with tape so it stop light reflection for sensor.
- Fix sensors at center height of coin.
- So coin blocks sensor when pass.
- Keep sensor near slot edge so coin always cross sensor beam.
- Add one small guide on top so that coins feed one by one.
How to Build:
To build a Arduino Based Coin Value Identifier Circuit follow the below steps for connections:
- First, gather all the parts as in circuit diagram above.
IR Sensor Connections:
- One sensor for 2 Rs coin
- One is for 5 Rs coin
- And third one is for 10 Rs coin.
- All sensor VCC pins go to Arduino 5V.
- All sensor GND pins go to Arduino GND.
- Sensor output pins go to Arduino digital pins like:
- 2 Rs sensor output goes to D2
- 5 Rs sensor go to D3
- And 10 Rs sensor go to D4.
I2C Module LCD Connections:
- SDA pin goes to A4
- SCL pin goes to A5
- VCC go to 5V
- And GND to GND.
Conclusion:
Overall, this is simple Arduino Based Coin Value Identifier Circuit for sorting coins, it counts and shows value of each coin.
Moreover, it is useful for small shops and coin operated systems and we can also add motor and coin tray to make full automatic sorting machine.
Leave a Reply