Medium Basics: Project 018a 4 digit 7 segment display modules 5641AH or 3461BS - Stopwatch up to 1000 secon

of Acoptex.com in UNO

Basics: Project 018a

Project name: 4 digit 7 segment display modules 5641AH or 3461BS - Stopwatch. It is possible to get 10000 seconds  or 2 hours 46 minutes 40 seconds maximum

Attachments: sketch (common cathode) and (sketch common anode)

In this project, you needed these parts :

1.Aruduino Uno R3 (you can also use the other version of Arduino)

2.Arduino IDE ( you can download it from here  )

3.Jumper cables

4. Resistor 8 pcs (220 Ohm or 330 Ohm)

5. Breadboard

6. 4-digit 7-segment display module 5641AH or 3461BS 1 pc


In this project we will learn how to connect a 4-digit 7-segment display modules  5641AH or 3461BS to Arduino board and make a stopwatch. 

Understanding the 4-digit 7-segment display module

The obvious downside to using these relatively inexpensive 4 digit, 7 segment displays is that for full functionality, each pin must be connected to a controlling I/O pin. If you are using an Arduino Uno compatible micro-controller, one of these four digit displays will use from 12 to 16 of your 20 or so available I/O pins.There is a line of 4 digit, 7 segment displays with some additional circuitry that only requires one to three I/O pins to control one or more 4 digit displays. It is a little bit expensive but you pay for the convenience of not having to use almost all of your micro-controller I/O pins to drive a single 4 digit display and from having to manage every LED segment in the display.

The display module has 12 pins, six near the bottom and six on top. The pins are numbered counter-clockwise, starting with pin 1 on the lower left. Each digit consists of 7 segments, labeled A-G in green with a decimal point connected to pin 3. Because the display module 3461BS is a common anode display, to light any combination of segments on any digit, the desired combination of segment I/O pins must be set HIGH, then the corresponding digit select pin, labeled D1-D4, is set LOW. If two or more digit select pins (shown in orange above) are LOW at the same time, they will display identically, which is usually not desired. The same segment on every digit shares an I/O pin. The idea is to only light one digit at a time by setting the appropriate segment pins HIGH then bringing that digit's select pin LOW and then quickly turning the digit off by setting its select pin HIGH again after a few milliseconds before going on to the next digit. This happens so fast that our persistence of vision tricks us into believing all the digits are lit continuously and flicker free. In fact, this four digit refresh can happen faster than the shutter speed of most cameras. Because the segments are only lit briefly, many makers do not use current limiting resistors that can help prevent the LEDs from failing prematurely. 

However, it is better to be a little more conservative and protect each LED segment, including the decimal point with a resistor in the range of 220 to 330 ohms, depending on what’s close at hand.

The basic 4-digit 7-segment display is white in color. It has a common anode. The display features one decimal point per digit, and individually controllable apostrophe and colon points. The LEDs have a forward voltage of approx 3 VDC and a max forward current of 20 mA. The hardware interface is 12 (two rows of 6) through-hole pins. The same display is available in green, blue and red color.

You can find the datasheet of 4-digit 7-segment display module 5641AH here.

You can find the datasheet of 4-digit 7-segment display module 3461BS here.

Signals and connections of 4-digit 7-segment display modules 5641AH (common cathode) and 3461BS (common anode)

5641AH and 3461BS pins:

Build the circuit

When a 7-segment display is used, if it is a common anode display, connect the anode pin to power source; if it is a common cathode one, connect the cathode pin to GND. When a 4-digit 7-segment display is used, the common anode or common cathode pin is to control the digit displayed. There is only one digit working. However, based on the principle of Persistence of Vision, we can see four 7-segment displays all displaying numbers. This is because the electronic scanning speed is too fast for us to notice interval.

The following picture shows the needed connections with the Arduino Uno 

1. 4-digit 7-segment display module 5641AH common cathode

2. 4-digit 7-segment display module 3461BS common anode

Step by Step instruction

  1. Plug your Adruino Uno board into your PC and select the correct board and com port
  2. Open up serial monitor and set your baud to 9600 baud
  3. Verify and upload the the sketch to your Adruino Uno board
  4. You can see the number increases by one per second from 0 to 20 then it's off  and restart
      the counting in 2 seconds
    You can see the number increases by one per second from 0 to 20 then it's off  and restart  the counting in 2 seconds


We have learnt how to connect 4 digit 7 segment display module 5641AH or 3461BS to Arduino board


  • No libraries required for this project


  • See attachments on the begining of this project description. 

Other projects of Acoptex.com
Medium Basics: Project 083w Sipeed Maixduino board - Using PlatformIO IDE of Acoptex.com in Sipeed Maixduino 08-08-2019
Medium Basics: Project 083e Sipeed Maixduino board - Uploading MaixPy of Acoptex.com in Sipeed Maixduino 04-08-2019
Medium Basics: Project 083f Sipeed Maixduino board - Using MycroPython of Acoptex.com in Sipeed Maixduino 04-08-2019

Published at 12-08-2017
Viewed: 2518 times