Build it step by step
0 of 7 doneTest one sensor
The module's LED lights when something is in front of it. Drop a coin past it.
Mount the four sensors
Fix one at each pocket pointing into the net, away from the board edge.
Wire the signals
Pocket outputs to D2 to D5, buttons to D6 and D7.
Wire the LCD
On A4 and A5.
Upload and play
Choose a side with the side button. Each coin pocketed adds a point to that side.
Queen
Press the queen button to add 3 points to the current side.
Tune the sensors
Adjust trimmers so a coin always counts once.
How do you build a carrom pocket score counter?
Sensors under each carrom pocket count coins as they fall and keep score for both sides. You need Arduino Nano, IR obstacle avoidance sensor module × 4, 16x2 LCD with I2C backpack (PCF8574), Tactile push button 6 mm × 2, Breadboard 830 Tie Points, Jumper wires male to male (40 pcs, 20 cm) and USB A to micro-USB cable (data). It takes 7 steps and about 90 minutes.
- Level
- Beginner
- Time
- About 90 min
- Parts
- 7
Wiring
| From | To | Why |
|---|---|---|
| Pocket sensor 1 to 4 OUT | Nano D2 to D5 | Low when a coin passes |
| All sensors VCC and GND | Nano 5V and GND | Supply |
| LCD SDA and SCL | Nano A4 and A5 | Display |
| Side button | Nano D6 and GND | Switch between white and black |
| Queen button | Nano D7 and GND | Add the queen bonus to the current side |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "LiquidCrystal I2C". Mount a sensor looking across the inside of each pocket net so a falling coin passes in front of it. The module's trimmer sets the range, so adjust it until a coin triggers it and the net itself does not. A coin pocketed by the wrong side can be removed by editing the score in code later, or by adding an undo button.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const byte POCKET[4] = {2, 3, 4, 5};
const byte SIDE = 6, QUEEN = 7;
unsigned long lastSeen[4] = {0, 0, 0, 0};
int score[2] = {0, 0}; // 0 white, 1 black
byte side = 0;
void show() {
lcd.setCursor(0, 0); lcd.print("White "); lcd.print(score[0]); lcd.print(" Black "); lcd.print(score[1]); lcd.print(" ");
lcd.setCursor(0, 1); lcd.print("Playing: "); lcd.print(side == 0 ? "White" : "Black"); lcd.print(" ");
}
void setup() {
for (byte i = 0; i < 4; i++) pinMode(POCKET[i], INPUT);
pinMode(SIDE, INPUT_PULLUP); pinMode(QUEEN, INPUT_PULLUP);
lcd.init(); lcd.backlight();
show();
}
void loop() {
for (byte i = 0; i < 4; i++) {
if (digitalRead(POCKET[i]) == LOW && millis() - lastSeen[i] > 600) { // one coin per pocket per 0.6 s
lastSeen[i] = millis();
score[side]++;
show();
}
}
if (digitalRead(SIDE) == LOW) { side = !side; show(); delay(300); }
if (digitalRead(QUEEN) == LOW) { score[side] += 3; show(); delay(300); }
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Coin falls in a pocket | Score rises by one for the chosen side |
| Press the side button | The next coins count for the other side |
| Queen button | Adds three |
| Two coins in quick succession | Both counted if more than 0.6 s apart |
If it does not work
Counts twice
Increase the lockout time or reduce sensor range.
Misses coins
Increase range or aim it across the pocket opening.
Counts when nothing falls
Ambient light or the net triggers it. Lower the sensitivity.
Wrong score
Add an undo button that subtracts a point.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the carrom pocket score counter?
Arduino Nano, IR obstacle avoidance sensor module × 4, 16x2 LCD with I2C backpack (PCF8574), Tactile push button 6 mm × 2, Breadboard 830 Tie Points, Jumper wires male to male (40 pcs, 20 cm) and USB A to micro-USB cable (data).
How long does the carrom pocket score counter take to build?
About 90 minutes for a beginner maker, in 7 steps.
How do I know the carrom pocket score counter works?
Coin falls in a pocket: Score rises by one for the chosen side. Press the side button: The next coins count for the other side. Queen button: Adds three.
Counts twice: what should I check?
Increase the lockout time or reduce sensor range.
Misses coins: what should I check?
Increase range or aim it across the pocket opening.
Counts when nothing falls: what should I check?
Ambient light or the net triggers it. Lower the sensitivity.
Wrong score: what should I check?
Add an undo button that subtracts a point.
