Home Hardware A 4-Digit 8-Segment Display Module for Raspberry Pi Pico

A 4-Digit 8-Segment Display Module for Raspberry Pi Pico

by rp2040guy71

If you are looking for a display for a project like a counter, timer or a simple digital clock then the 4-Digit 8-Segment Display Module for Raspberry Pi Pico is a low cost option

4-Digit 8-Segment Display Module for Raspberry Pi Pico

4-Digit 8-Segment Display Module for Raspberry Pi Pico

The SNx4HC595 devices contain an 8-bit, serial-in, parallel-out shift register that feeds an 8-bit D-type storage register. The storage register has parallel 3- state outputs. Separate clocks are provided for both the shift and storage register.

The shift register has a direct overriding clear (SRCLR) input, serial (SER) input, and serial outputs for cascading. When the output-enable (OE) input is high, the outputs are in the high-impedance state.

74HC595 is a high-speed CMOS 8-bit 3-state shift register/output latch chip, using CMOS silicon gate technology. The device contains an 8-bit serial input and parallel output shift register and provides an 8-bit D-type storage register with an 8-bit 3-state output.

Provide independent clock signals to the shift register and storage register. The shift register has a direct clearing function, serial input and output functions, and cascade applications.

Both shift registers and storage registers use a positive Edge clock trigger, if these two clocks are connected together, the shift register is always the previous clock pulse of the storage register. All input ports are equipped with anti-static and instant overvoltage protection circuits

Specifications

  • Operating voltage: 5V
  • Digits: 4
  • Display size:0.4inch
  • LED color: red
  • Driver: 74HC595
  • Display part No.: FJ4401AH
  • Dimensions: 52 x 21mm

Pinout

LCD Pico Description
VCC VSYS Power input
GND GND GND
DIN GP11 Serial data input
CLK GP10 Data input clock pin
RCLK GP9 Output latch register clock pin

Purchase

Amazon – 0.4 inch 4-Digit 8-Segment LED Display Module for Raspberry Pi Pico, Red LED Color, SPI-Compatible, Onboard High Precision RTC Chip DS3231 and 74HC595 Driver, with Standard Raspberry Pi Pico header

Aliexpress – 4-Digit 8-Segment LED Display Module SPI Interface for Raspberry Pi Pico

Code example

This is the Micropython example from the link underneath

[codesyntax lang=”python”]

from machine import Pin,SPI,PWM
import framebuf
import time

MOSI = 11
SCK = 10    
RCLK = 9

SEG8Code = [0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71]
class LED_8SEG():
    def __init__(self):
        self.rclk = Pin(RCLK,Pin.OUT)
        self.rclk(1)
        self.spi = SPI(1)
        self.spi = SPI(1,1000_000)
        self.spi = SPI(1,10000_000,polarity=0, phase=0,sck=Pin(SCK),mosi=Pin(MOSI),miso=None)
        self.SEG8=SEG8Code
    def write_cmd(self, Reg, Seg):    
        self.rclk(1)
        self.spi.write(bytearray([Reg]))
        self.spi.write(bytearray([Seg]))
        self.rclk(0)
        time.sleep(0.002)
        self.rclk(1)

   
if __name__=='__main__':
    LED = LED_8SEG()
    #color BRG
    while(1):
        for kilobit in range(9):
            for hundreds in range(9):
                for tens in range(9):
                    for units in range(9):
                        for o in range(9):
                            LED.write_cmd(0XF7,LED.SEG8[units]|0X80)
                            LED.write_cmd(0XFB,LED.SEG8[tens]|0X80)
                            LED.write_cmd(0XFD,LED.SEG8[hundreds]|0X80)
                            LED.write_cmd(0XFE,LED.SEG8[kilobit]|0X80)

[/codesyntax]

Links

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More