Arduino Clock Speed Race
About the project
It's simple... you take two UNO boards from different manufacturers, then race them! Time how long it takes for the boards to switch an LED on, and the winner is the one with the highest clock speed. The faster the clock speed, the quicker a board can carry out operations, leading to better performance!
Estimated time: 1 hour
Items used in this project
It's simple... you take two UNO boards from different manufacturers, then race them! To see a race in action, watch this short video:
Okay, okay, you probably want some more details than that. This is very much a beginner project, and should take maybe 10 minutes. Here are the steps:
- Open the Arduino IDE (or install it if you haven't done so!)
- Copy and paste my code into the IDE
- Save the code, then connect your board to your computer, configure the ports, and hit upload
- Press the reset button on the board
And you are done! Now it's time to explain what this project does...
Your UNO board should have a clock speed of 16MHz, which means it essentially has an internal ticker flipping between ON and OFF at a frequency of 16MHz. This signal is used to synchronise all of the operations executed by the board, and unsurprisingly, the faster the clock speed, the better the performance of the board (it can do more operations per second!).
My code does something very simple.
I define a large number, and then run a while() loop which increments a variable n by 1 each cycle until it equals the large number. When this happens, it turns an LED on. If you time how long it takes to switch the LED, you will have a characteristic value which can be used to compare the clock performances of UNO boards!
I know this is simple, but sometimes going back to basics does us all a bit of good. Stay dodgy!