Go Down

Topic: Cascade of shift registers 74HC595 controlled via Arduino (Read 583 times) previous topic - next topic


Today I would like to present a project that I have implemented in two versions. The project uses 12 shift registers 74HC595 and 96 LED diodes, Arduino Uno board with Ethernet shield Wiznet W5100. 8 LEDs are connected to each shift register. The numbers 0-9 are represented by LEDs. Each shift register is equipped with 8 output terminals.

Each of the 4 shift registers 74HC595 forms a logical unit - a display for listing a 4-digit number. In total, there are 3 logical displays in the project consisting of 12 shift registers.

The implementations are compatible for Arduino boards Nano, Mega, Uno and for Ethernet shields and modules from the Wiznet family, specifically models W5100 and W5500 (using the Ethernet2 library).

Implemented implementations in the project with Arduino:
    Webserver - HTTP server running directly on Arduino, allows to interpret HTML code[/list]
      WebClient - Client capable of making an HTTP request to a remote server, sending / retrieving data[/list]

        Provides an HTML web page with a form that allows you to enter 3 four-digit numbers.

        After sending the form, the data are processed and stored in the EEPROM memory, the user is informed about the data processing by a separate subpage.

        After saving the data, the user is redirected back to the form. EEPROM memory is energy independent, data is accessible even after power recovery, but also board restart.

        All numbers are then represented on three displays consisting of 12 shift registers 74HC595.

        Communication with the web server takes place every 5 seconds after the HTTP protocol

        The web server runs a PHP web application that allows you to enter 3 four-digit numbers via the form.

        The data from the form is stored in a MySQL database.

        Arduino requests to retrieve data from this database via a query to the server.

        The processed data is parsed by Arduino, then plotted using shift registers 74HC595.

        The data are also stored in the EEPROM memory of the Arduino, they are used in case the connection to the web server fails / when the Arduino boards are restarted, they are used for the initial rendering of the data on the shift registers.

        The data is overwritten in the EEPROM only when the data changes, the EEPROM cells are saved from unnecessary overwriting.

      Cascade connection for shift registers 74HC595 (can be extended by x more) - Export from TinkerCAD:

      Screenshot of the design of Arduino as a Webserver - sending data, processing, redirection:

      It is clear from the diagram that only 3 data wires are used to control the shift registers:
        Data output - (SER at 74HC595)

        Clock signal - (SRCLK at 74HC595)

        Latch output - (RCLK at 74HC595)

      Shift registers can be combined in a cascade, while other peripherals can also be controlled by shift registers - for example, relays for switching power elements. It is also possible to control 500 separate relays (with a sufficient number of shift registers and power supply) with one data output.

      When controlling the outputs of the registers, it is also possible to modify the byte order to the most significant bit - MSB FIRST, or to LSB - the least significant bit. As a result, it inverts the outputs. In one case, for example, 7 diodes are lit, in the other case 1 diode depending on the input and byte order.

      Both implementations use EEPROM memory, which can store data even after a power failure or after a board restart. The second use of this memory is also the ability to represent the last known data in case it is not possible to communicate with the web server (connectivity error, server).

      Memory is limited to 10,000 to 100,000 transcripts. Implementations are designed for the least possible memory load. The data will not be overwritten when they are changed. If the same data is read from the web server / client, they are not overwritten in the EEPROM memory.

      Arduino in WebClient mode communicates with a web interface in which it is possible to modify 3 four-digit numbers: https://arduino.php5.sk/led/

      Software implementation for WebClient is free to use, available at (working with web interface - link above): [/ b]https://arduino.php5.sk/register-74hc595.php?lang=en
      Arduino and website programmer

      Go Up