What it shows
A MAX7219 chip drives a whole 8 x 8 LED matrix from three wires. The Arduino keeps the score, wickets and balls in variables and shows them as scrolling or fixed text, like a small scoreboard.
The science
The MAX7219 stores one row of each LED digit and multiplexes the LEDs itself, so the Arduino sends data with the SPI-like pins DIN, CLK and CS. The MD_Parola library draws text in a chosen font on the four modules. The sketch keeps runs, wickets and balls in integers, converting six legal balls into one over. A history array allows the undo button to step back one ball.
Materials
Cost: under Rs 1,500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- An Arduino Uno or Nano
- A 4-in-1 MAX7219 8 x 8 LED matrix module (32 x 8 LEDs)
- Five push buttons for 1 run, 4, 6, wicket and undo
- A 5 V power bank or USB supply
- A breadboard and jumper wires
- A cardboard or wooden frame
Safety
For this project: USB power only. The matrix is bright, so do not stare at it from a short distance, and it may get warm; switch it off when not in use.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
All the safety rulesStep by step
8 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Connect the matrix module: VCC to 5 V, GND to GND, DIN to pin 11, CS to pin 10 and CLK to pin 13.
Install the MD_Parola and MD_MAX72XX libraries and run the Hello World example.
Connect five buttons between pins 2 to 6 and GND, with INPUT_PULLUP and a 50 ms debounce.
Make variables for runs, wickets and balls, and a function that updates them from a button number.
Display the score as runs slash wickets, such as 87/3, and show overs as 14.2 after a delay of three seconds.
Make the 4 and 6 buttons scroll the word FOUR or SIX before returning to the score.
Add the undo button, which restores the last stored state from a small history array.
Mount the module in a frame and test a short imaginary innings of 2 overs, checking runs, balls and wickets.
What you should see
The scoreboard shows runs, wickets and overs that change correctly with each button press, with a working undo.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
1How does MAX7219 save Arduino pins?
It holds the display data and scans the LEDs itself, so only three signal wires are needed.
2How are overs calculated?
Divide balls by 6 for the over and use the remainder for the balls.
3What is debouncing?
Ignoring repeated false button signals from the contacts bouncing.
4What is the undo array for?
It stores the past states so a mistake can be reversed.
Take it further
Add a second Arduino and an nRF24L01 so the scorer can sit away from the board.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
Free ebooks for this project
Robotics
Arduino and Coding for Robots Study Book
The complete study notes, practice questions and glossary for Arduino and Coding for Robots
