- Max7219 Chip -1
- 4-digit 7-segment LED display - 1
- 40KΩ resistor - 4
- 10μF capacitor - 4
- 100nF capacitor -4
- Breadboard 840 points – 1
- Jumper wires(male to male) – 40 pcs
- Single stand wire 2mt – 1
- Arduino uno with USB Cable – 1
- 9v Battery with battery snapper- 1
In this circuit, we will show how to display numerals on a 4-digit 7-segment display using a Max7219 chip. The Max7219 is an 8-digit LED display driver, meaning it can connect to and control as many as 8 digits. In this circuit, we're simply going to control a 4-digit 7-segment display, however.
HARDWARE REQUIRED
- Max7219 Chip -1
- 4-digit 7-segment LED display - 1
- 40KΩ resistor - 4
- 10μF capacitor - 4
- 100nF capacitor -4
- Breadboard 840 points – 1
- Jumper wires(male to male) – 40 pcs
- Single stand wire 2mt – 1
- Arduino uno with USB Cable – 1
- 9v Battery with battery snapper- 1
SOFTWARE REQUIRED
Arduino IDE 1.8.5 (programmable platform for Arduino)
Click To Download :https://www.arduino.cc/en/Main/Software
PIN DESCRIPTION
4 DIGIT 7 SEGMENT DISPLAY
The pinout of a 4-digit 7-segment LED display above.
A 4-digit 7-segment LED display has 12 pins. 8 of the pins are for the 8 LEDs on a 7 segment display, which includes A-G and DP (decimal point). The other 4 pins represent each of the 4 digits from D1-D4.
MAX7219 CHIP
The Max7219 is an 8-digit LED display driver, meaning it can drive up to 8 digits
The Max7219 needs about 5V to operate. So we connect V+, pin 19, to 5V and the ground pins, pin 4 and 9, to ground. We don't just connect the 5V to ground. We connect 2 capacitors in parallel to ground. This includes a 100nF capacitor and a 10μF capacitor. This helps filter out noise from the power supply and to make sure the power supply is steady.
All of the seg pins connect to the corresponding segment on the 7-segment LED display. So Seg A connects to the A pin on the 7 segment LED display. Seg B connects to B. Seg C connects to C and so on until you connect all the way to Seg G and DP. This covers 8 connections.
Now we connect the digits. Just like with the segment connections, the digits on the Max7219 connect to the corresponding digits on the 7 segment LED display. Digit 0 on the Max7219 connects to pin 12 on the 4-digit LED display, which is D1. Digit 1 on the Max7219 connects to D2. Digit 2 connects to D3. Digit 3 connects to D4.
The Max7219 works on in synchrony with the microcontroller it is connected to on a clock signal. On the rising edge of the clock signal are commands and instructions executed. So the clock pin of the Max7219, pin 13, connects to digital pin 13 of the arduino. This way, the microcontroller and the Max7219 can operate in synchrony.
The ISET pin is the pin that allows us to set the current that is output to the digit and segment pins. These are the pins that supply current to the output device, which in this case is a 4-digit 7-segment display. We set ISET through the use of an external resistor connected to V+. Being that we want about 10mA of current to be supplied to the 7-segment LED display, we use a 40KΩ connected to V+.
The DIN pin, pin 1, of the Max7219 connects to pin 11 of the arduino. Pin 11 of the arduino is the MOSI pin, which stands for Master Out Slave In.
This is the pin which allows the arduino to communicate and send data to the Max7219 chip. In this circuit, there is only one-way communication between the microcontroller and the Max7219 chip.
The arduino simply needs to send instructions to the Max7219 chip on how to control the output device without the Max7219 chip needing to send data to the microcontroller.
The load/CS, pin 12, is the load/chip select pin. In order for data to be loaded into the Max7219, this pin must be LOW.
The DOUT is left unconnected. This is used if we are daisy chaining multiple Max7219 chips together.
CIRCUIT DESCRIPTION
The 4-Digit 7-Segment LED display driver circuit we will build using a Max7219 chip is shown below.
So we have 5V connected to V+ and connected to ground through a 100nF ceramic capacitor and a 10μF electrolytic capacitor.
To set the current output from the output pins, which will feed our output device, we connect a 40KΩ resistor to V+. This allows for about 10mA of current outflow.
We connect all the digits and segments, as they correspond on the Max7219 and the microcontroller.
We connect DIN, pin 1, to D11 on the arduino.
We connect the clock pin, pin 13, to digital pin 13 on the arduino.
We connect the slave Select or Chip Select (CS) pin, pin 12, to digital pin 10 on the arduino.
This establishes all the hardware connections.
Next, we just now need the code in order for this circuit to operate.
CODE
This code displays a number from 0 to 9999 on a four-digit display.
Click to see the code or copy the link:
WORKING
After uploading the code you willable to see the output on 4 digit 7 segment display which is given on serial monitor