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!
Project info
Difficulty: Easy
Platforms: Arduino
Estimated time: 1 hour
License: GNU General Public License, version 3 or later (GPL3+)
Items used in this project
Hardware components
Story
It's simple... you take two UNO boards from different manufacturers, then race them! To see a race in action, watch this short video:
https://www.youtube.com/watch?v=sKjUpL687aU
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!
Schematics, diagrams and documents
Code
Credits
TheDodgyEngineer
Hi! I'm an engineering student at the University of Cambridge, and I have a YouTube channel where I make small projects (some of which work!) to improve my practical skills and understanding of real world engineering.
Leave your feedback...