8 LED Binary Counting Display - Arduino Project

8 LED Binary Counting Display – Arduino Project

I built an 8 LED display that counts in binary with an Arduino. Here are my results.

There are many similar projects out there described in books and on the internet, my version has some tweaks and works nicely.

Project photo.

8 LED Binary Counting Display - Arduino Project
8 LED Binary Counting Display – Arduino Project

Project photo 2.

8 LED Binary Counting Display – Arduino Project - photo 2
8 LED Binary Counting Display – Arduino Project – photo 2

Project video.

8 LED Binary Counting Display – Arduino Project – video link to YouTube. https://youtu.be/yRkjSOVnQbU

Project Fritzing diagram.

8 LED Binary Counting Display - Arduino Project Project Fritzing diagram.
Project Fritzing diagram.

Project schematic.

8 LED Binary Counting Display - Arduino Project -Schematic
8 LED Binary Counting Display – Arduino Project -Schematic

Project sketch.

// 8 LED Binary Number Counting Display
// counting from 0 to 255 in binary displayed with LEDs
// reference 1: Arduino Workshop by John Boxall - Project 16 – Creating an LED Binary Number Display https://nostarch.com/arduino
// reference 2: Serial to Parallel Shifting-Out with a 74HC595 https://www.arduino.cc/en/tutorial/ShiftOut 
// reference 3: Texas Instruments 74HC595 Data Sheet http://www.ti.com/lit/ds/symlink/sn74hc595.pdf
// Added a 10uF electrolytic capacitor from pin 16 Vcc to ground, keep the cap as close to 74HC595 pin 16 as possible, 
// (no jumpers) to suppress flickering and artifact lamp lighting.
// Other 74HC595 connections
// pins 0-7, 15 Q to LED lamps and 1k resistors
// pin 8 GND to GND
// pin 10 SRCLR to 5V
// pin 13 OE to GND

#define DATA 4 // Arduino pin 4 to 74HC595 pin 14 SER
#define LATCH 5 // Arduino pin 5 to 74HC595 pin 12 RCLK
#define CLOCK 6 // Arduino pin 6 to 74HC595 pin 11 SRCLK

int tDelay = 1000; // 1 second delay for counting

void setup()
{
pinMode(LATCH, OUTPUT);
pinMode(CLOCK, OUTPUT);
pinMode(DATA, OUTPUT);
}

void loop()
{
int i;
for ( i = 0; i < 256; i++ )
{
digitalWrite(LATCH, LOW);
shiftOut(DATA, CLOCK, MSBFIRST, i);
digitalWrite(LATCH, HIGH);
delay(tDelay);
}
}

Project Parts list.

(8) LEDs. 5mm.
(8) Resistors.  1kOhm.
(1) Electrolytic capacitor.  10uF.
(1) 74HC595 IC.
Ardunio.

Project Notes.

For the LEDs,  I used 4 blue ones for the 4 least significant bits and 4 yellow ones for the most significant bits, but you can use any color you like.

For the resistors you can use values from 22o Ohms to more than 1k Ohms, I used 1k Ohms to reduce the brightness (really bright LEDs hurt my eyes).  If you use different color LEDs you can tinker with the resistor values to match the brightness of the different colors.

For the capacitor you can use values from 0.1uF to 100uF.  This capacitor really helps reduce flickering and lamps lighting when they should not.  Many versions of this project do not specify this capacitor but it was essential for me.  Note that the + side of the capacitor must be as close to pin 16 on the IC as possible, like adjacent breadboard holes.  Also note that capacitors are typically not included in basic starter kits but available at electronics stores and on the internet.

For the Arduino, I tested both  a Velleman VMA100 and an Elegoo Uno R3, probably any model or equivalent should work.

For power, USB or 9V battery works.

There are a lot of versions of this project out there.  Here is another.  Some versions suffer spaghetti wiring, odd use of analog and digital pins, poor documentation and comments, rapid blinking of the LEDs, or just don’t work.  This is a beginner project and a lot of people want to share their accomplishment.

Fritzing.  I found making the bread board diagram easy enough but the schematic was a nightmare, and ended up with two Fritzing sketches, one for the diagram and one for the schematic and forget about synching the two.

Ardunio links.

YouTube video: “You can learn Arduino in 15 minutes” by Afrotechmods. https://youtu.be/nL34zDTPkcs

Official web site: arduino.cc

Wikipedia: https://en.wikipedia.org/wiki/Arduino

A good introduction book: Arduino Workshop by John Boxall published by no starch press (good basics book although dated, some of the advanced project library and hardware information for SPI, GPS and GSM is out of date). https://nostarch.com/Arduino

A good web site for Arduino projects, videos, and tutorials.  https://randomnerdtutorials.com

A good starter kit: Elegoo EL-KIT-003 UNO Project Super Starter Kit with Tutorial for Arduino (amazon.com about $35USD, http://a.co/d/eDcN8Vi)

Elegoo EL-KIT-003 UNO Project Super Starter Kit
Elegoo EL-KIT-003 UNO Project Super Starter Kit

 

Leave a Reply

Your email address will not be published. Required fields are marked *