LED Binary Counter

by tejbho305 in Circuits > Arduino

74 Views, 0 Favorites, 0 Comments

LED Binary Counter

IMG_2531.jpg

This circuit counts from 1 to 15 in binary using LED lights.

Supplies

IMG_2532.jpg
  1. Elegoo Uno R3 Microcontroller Board
  2. Breadboard
  3. Computer
  4. 4 x 330 ohm resistors
  5. 4 x LED lights
  6. USB cable

Attach the Resistors and LEDs

IMG_2528.jpg

Connect as shown. The bottom of the resistor should connect to the long end of the LEDs.

Connect the Resistors to the Input Pins

IMG_2529.jpg

Connect the top of each resistor to 4 different input pins on the microcontroller board.

Connnect the Circuit to Ground

IMG_2531.jpg

Connect the short end of the LEDs to ground (GND).

Write the Program

download.jpg

First you will have to install Arduino IDE on your device.

Here is the code to write the binary counter:

https://github.com/tejbho/ArduinoProjects/blob/main/Binary/Binary.ino

You may have to change the values for redPin, greenPin, bluePin, and yellowPin, to match the pins you attached to on the microcontroller board.

Test the Circuit

image-15.png
LED Binary Counter

The output of the LEDs should match the chart above, where the red LED represents the first digit, and the yellow LED represents the fourth digit.