This Arduino Based Coin Value Identifier Circuit is a simple coin sorting machine.
It can detect and sort 2 Rs, 5 Rs, and 10 Rs coins.
Each coin type is sensed by different IR sensors.
The Arduino reads which sensor is triggered and shows value on LCD.
This project is useful for small vending machines and coin counters.
Circuit Coding:
#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 is not counted twice.
Circuit Working:
Parts List:
Component | 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.
Arduino checks which sensor pin is HIGH.
It adds the coin value to total amount.
It then shows total amount on LCD.
Each sensor is placed at different slot size to detect specific coin size.
The LCD updates every time coin detected.
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:
- 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:
This is simple Arduino Based Coin Value Identifier Circuit for sorting coins.
It counts and shows value of each coin.
It is useful for small shops and coin operated systems.
We can also add motor and coin tray to make full automatic sorting machine.