This project is a 4-bit binary counter implemented using an Arduino. It uses LEDs to display the binary representation of numbers from 0 to 15. A push button increments the count, a reset button clears all LEDs and resets the count.
- Arduino IDE version 1.8.x or higher
- Arduino Nano Every (or Arduino Uno for simulation in TinkerCAD)
- Breadboard and jumper wires
- 4 LEDs
- 4 Resistors (220Ω each for LEDs)
- 2 Push buttons
- Displays numbers 0-15 in binary using 4 LEDs
- Increment button to step through the count
- Reset button to clear the count and turn off all LEDs
- Uses internal pull-up resistors to simplify wiring
A schematic is included done via TinkerCAD, showing:
- LEDs connected to digital pins (TinkerCAD only has Arduino UNO, so the pins will be different than Nano/Nano Every)
- Buttons connected to pins with INPUT_PULLUP mode
Code Explanation:
- updateLEDs(): Updates LEDs to represent the current binary count
- ledsOFF(): Turns off all LEDs and resets the count
- binaryCounter(): Increments count when the button is pressed
- resetCounter(): Resets count when the reset button is pressed
- Connect components as per the schematic/Reference photos.
- Upload the provided code to your Arduino.
- Press the increment button to count up in binary.
- Press the reset button to reset the count.
This project uses the MIT License and is open-source and free to use.