Digital Cribbage Board with Arduino :: Member Project

What better way to learn coding and get back into electronics then to help your folks out on an interesting project….like say building a digital cribbage board with Arduino?!  That is exactly what Christopher Cooper, a member of Programming Electronics Academy, decided to do.

You’re going to love this project-write up and learn a bit about what it takes to get your projects off the ground (and something about the game of cribbage as well…)  Enjoy!

Quick Demo:

The Back Story:

 

Why the heck did you build a digital cribbage board with Arduino?

When the pandemic started, I decided that I needed to ensure that I kept myself occupied during lockdown, so I mentioned to my parents that I was thinking about restarting my childhood hobby of electronics. As soon as I mentioned this, my mother said “Would you build us a Cribbage Board?”.

When I asked why, she explained that now they (my parents) are getting older, they lose count where they are on the wooden board they use and this causes arguments when playing. The scene was set for my first project.neopixels and arduino uno with wires

How does this digital cribbage board work?

To understand the project, you need to know about the game Cribbage. Cribbage is a card game, where players score points based on hands, just like Poker. There are various points awarded for each hand and using a traditional wooden board, the points are recorded.

The wooden scoring board is usually a rectangle, with holes drilled throughout. The boards often have four runs of 60 holes. This supports various game types and I focused on three games my parents play, namely: 2 player short, 2 player long or 3 player long. It is this manual wooden board which causes a problem, as they forget which direction they started and how many times they have been across the board.

I decided to replicate the board using an Adafruit NeoPixel 8×8 RGBW Matrix. Four matrices are placed in a row and using arrays, I control the LED’s to display the three game layouts.

The game has a start up sequence which notifies the players which game type has been selected. Other features include a brightness setting and charging circuit for 8 x AA NiCd batteries so they can play outside.circuit board enclosure with wires, neo pixels, arduino for digital cribbage board scoring

What was your biggest struggle as you worked through this project?

Where to start?

To begin with, I have never coded before, which is where the membership from Programming Electronics Academy came to the rescue. Having now completed one of the Arduino courses, I can safely say that I understand coding and I am now studying C++.

It’s all about memory…

At the beginning of the project, I was using an Arduino Uno and was very happy until my code kept failing. I could get the right LEDs to appear in the early builds using two Adafruit NeoPixel Matrix Shields, but as soon as I switched to the full size Adafruit NeoPixel Matrix 8×8, things started to go haywire. I tried and tried and then I had a eureka moment after reading various forums, it occurred to me that I might be out of SRAM.

Arduino nano every and perf board circuit

I quickly switched to an Arduino Mega and the problems were resolved, so this made me think about memory usage a lot more. I learnt about the PROGMEM command and started to move all of my arrays into FLASH as well as my print commands and concluded that the Arduino Uno was never going to work, so switched to an Arduino Nano Every.

It’s not just the amount of memory it would seem…

But that wasn’t the end of it, as soon as that problem was solved and I moved into my full size cribbage board, again, things became very unstable, which is where my previous electronics skills assisted. I realised the Adafruit NeoPixel Matrix’s consumed huge amounts of power. In fact, when all LEDs were illuminated, around 1.8Amps! This was ridiculous fora bunch of LEDs, but they did look good.

If it looks good, it is good…

The third main struggle was in fact, not the code or the electronics, but what to build the components into. This is where a friend of mine (Ken from Signs Express Norwich) came to the rescue, as he kindly agreed to making an enclosure for my project.

Neither of us knew just how complicated this would be, but he persevered as I am a very particular individual and the end result was far better than I had hoped, which I hope you all agree. Both the top and bottom of the enclosure was milled out of a solid 20mm block of Perspex, including all screw standoffs, battery holder and battery cover. The box itself is a work of art and finishes the project nicely.

Thanks Ken.

Arduino Nano Every on circuit board with terminal connectors

Did the project end up as you expected?

I can safely say the project ended as I had envisioned it, but just much better.

From the Programming Electronics Academy training, I had learnt to draw out what I was looking to achieve and knew how I thought it should work. So although the journey was difficult, with a variety of issues, such as the earlier stated memory challenges, power challenges, enclosure design considerations, mathematics when coding and having to learn the game Cribbage to understand how to make the board operate, the finished project is what my parents asked for.

digital cribbage board with white case and buttons

Looking back on this project, what can you say you have learned about programming and/or electronics through the creation process?

Wow, this is a great question.

I am thrilled with the training and I am thrilled that through Michael’s (the name of the video narrator for most lessons) calm voice and consistent delivery, has taught me how to code.

I have found a variety of things fascinating, such as code is unforgiving! Syntax, syntax, syntax is vital and press that “Verify” button often.

Code formatting although for some is not important, for me, is as important as the code itself, as it really assists when debugging if the structure is clear and orderly. Comments should be included throughout, as when I reached over a 1000 lines of code, I can safely say that you cannot retain it all, especially if you are having breaks between coding.

Using forum’s is vital and don’t be afraid to ask questions. For example, I am now working on my own weather station, using six 1.8” TFT SPI bus displays and a variety of sensors, including an SD card reader. I have spent hours trying to make the card reader and SPI displays work together and it was only through a post on a forum that I was steered in the right direction.

Finally, do not be annoyed with yourself if you have to revert to the course work or other materials, as you cannot be expected to retain everything that you have learnt. Often when starting a new line of code, I stall, as I cannot remember the basic syntax, for example an Interrupt Service Routine. In the past, I would think I was failing if I had to “Google it”, but now, I am just delighted that I can develop and make things work and moreover, actually understand why, instead of just copying and pasting the answer.

Was the training at Programming Electronics Academy able to help you build your skill?

Programming Electronics Academy took me from little knowledge of programming all the way to knowing how to code – and I still can’t believe it.

I am plugging electronics together and making things happen, but what is most rewarding is that I understand what I am writing and I can see and touch the results.

Arduino Code:

Is there anything else you would like to say?

I want to give a special thanks to Michael J. Cheich, Ken Venables – Signs Express Norwich, and Jeremy Clarke

About Christopher Cooper

Picture of man with welding capChristopher is the director of an IT company in the UK.  He has recently picked back up his childhood joy of electronics, and taken on the exciting challenge of learning software development.

installing Arduino libraries

Installing Arduino Libraries | Beginners Guide

IoT sewage project

Pumping poo! An IoT sewage project

ESP32 webOTA updates

How to update ESP32 firmware using web OTA [Guide + Code]

error message Brackets Thumbnail V1

expected declaration before ‘}’ token [SOLVED]

Compilation SOLVED | 1

Compilation error: expected ‘;’ before [SOLVED]

Learn how to structure your code

10 Comments

  1. Pete on November 14, 2020 at 6:14 pm

    Wonderful project, fantastic perseverance and nice finished appearance. Needs a 3D printed case and video of mom and dad using it! 😉

    • Christopher Cooper on November 16, 2020 at 3:22 pm

      Hi Pete,

      I would if I had one!

      Regards,

      Christopher

  2. Peter on November 14, 2020 at 7:51 pm

    I would have liked to see a video of the board simulating a game.

    • Christopher Cooper on November 16, 2020 at 3:18 pm

      Hi Pete,

      Many thanks for your kind comments.

      Video uploaded as you can see!

      Regards,

      Christopher

  3. Nigel Moody on November 15, 2020 at 5:54 am

    Hi Christopher.
    What a great idea, and it looks really neat.
    I remember my parents playing cribbage when i was younger.
    Good luck with future projects.

    • Christopher Cooper on November 16, 2020 at 3:21 pm

      Hi Nigel,

      Many thanks, currently working on my version of Fitbit for my nieces hamster, which I’m calling Petbit. Also a digi clock based on the same chassis as the cribbage board and finally a weather station using 5 tft displays. Must admit having a load of fun!

      Regards,

      Christopher

  4. Kevin Roach on November 15, 2020 at 8:02 pm

    Super Project! Excellent Job!

    • Christopher Cooper on November 21, 2020 at 4:19 am

      Many thanks Kevin.

  5. KEITH CHARLES LOHMEYER on November 19, 2020 at 9:01 am

    Thanks for the write up. Great execution of the project. Your code is clear and well commented. The case and layout of components are top-notch. Well done!

    • Christopher Cooper on November 21, 2020 at 4:22 am

      Hi,

      Thanks, I can’t take credit for the case, as for the coding, that’s all down to Programming Electronics Academy.

      So thanks to everyone.

      Regards,

      Christopher

Leave a Comment