A Study of GPIO Expansion Through Multiplexers and Shift Registers
This study demonstrates that utilizing 74HC4051 multiplexers and cascaded 74HC595 shift registers with microcontrollers like the Arduino Uno and ESP32 offers a cost-effective solution for significantly expanding GPIO capacity for IoT applications, while quantifying the resulting trade-offs in execution speed, power consumption, and scalability.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the world of small computers that power everything from smart thermostats to industrial sensors, there is a persistent bottleneck: a shortage of connection points. These devices, known as microcontrollers, are the brains of modern electronics, but they come with a fixed number of physical ports, or pins, that allow them to talk to the outside world. When an engineer wants to connect a dozen lights, a handful of temperature sensors, and a few buttons to a single chip, they often run out of places to plug them in. The standard solution is to simply buy a more expensive chip with more ports, but that adds cost and complexity. A more elegant approach involves using simple, inexpensive helper chips that act as traffic directors, allowing many devices to share a single connection. Two such helpers are the analog multiplexer, which acts like a switchboard operator routing different input lines to a single receiver, and the shift register, which functions like a conveyor belt, taking data one piece at a time and releasing it all at once to control many outputs. The challenge has always been understanding exactly how much these helpers save, how fast they work, and whether they drain too much power when the system grows large.
A recent study by independent researcher Chandramouli Haldar set out to measure these trade-offs with precision, moving beyond theory to see how these components perform in real-world conditions. The research focused on two specific helper chips: the 74HC4051, which manages input signals, and the 74HC595, which manages output signals. The researcher tested these components using two common types of microcontroller boards, the Arduino Uno and the ESP32, which are widely used by hobbyists and professionals alike. The goal was to determine if these simple, low-cost parts could effectively expand the capabilities of a small computer without slowing it down or consuming too much energy. The study did not invent new technology but rather provided a rigorous, side-by-side comparison of how these established tools perform when pushed to their limits, offering a clear guide for anyone trying to build complex systems with limited resources.
The experiments revealed that these helper chips are remarkably efficient at stretching the capabilities of a microcontroller. When the researcher connected eight analog sensors directly to the computer, it required eight separate pins. By using a single 74HC4051 multiplexer, the same eight sensors could be read using only four pins, effectively cutting the hardware requirement in half. The results were even more striking for digital outputs, such as controlling lights or switches. A single 74HC595 shift register could control eight devices using just three pins. When the researcher connected four of these chips in a chain, they could control thirty-two devices while still using only those same three pins. By connecting eight chips in a chain, the system could manage sixty-four outputs without needing any additional connection points on the main computer. This demonstrated that a small, fixed number of pins could control a vast number of devices, provided the system was willing to manage the data sequentially rather than all at once.
However, this expansion comes with a cost in speed, and the study quantified exactly how much slower the system becomes. The researcher found that using standard software commands to control these chips was significantly slower than using direct, low-level commands that talk straight to the computer's internal hardware. On the Arduino Uno, a standard command to toggle a single pin took about 7.28 microseconds, but a direct hardware command reduced that time to just 0.125 microseconds, making the operation nearly sixty times faster. This difference became even more critical when updating large groups of lights. Updating thirty-two outputs using standard software took over 1.7 milliseconds, whereas the direct method completed the same task in just 30 microseconds. The ESP32 board, which is faster by nature, showed similar improvements, though the gap between standard and direct control was smaller than on the slower Arduino. The study concluded that while the hardware expansion works well, the speed of the software controlling it is just as important as the chips themselves.
Power consumption was another key factor, and the results here were reassuring. The researcher measured the electricity used by the system with and without the expansion chips. Adding a single multiplexer increased the power usage by less than one percent. Even when eight shift registers were connected to control sixty-four devices, the total power increase was less than eight percent. This suggests that the helper chips themselves are very efficient and do not drain the system's battery significantly. The study noted, however, that the actual power draw would depend heavily on what the devices were doing; if all sixty-four lights were turned on at full brightness, the power required by the lights themselves would far exceed the tiny overhead of the control chips. The research confirmed that the expansion method is viable for battery-powered devices, provided the load is managed correctly.
The study also looked at how far this chain of chips could be extended before it became unreliable. The researcher tested a chain of eight chips and found it worked perfectly, but they also calculated what would happen with even longer chains. They determined that while the number of controllable devices grows linearly with each added chip, the time it takes to send a signal to the end of the chain also grows. For a chain of thirty-two chips, the signal would take longer to travel through the entire line, which could delay how quickly the lights or switches respond. The research showed that for most practical applications, such as controlling a row of lights or reading a bank of sensors, these delays are negligible. But for systems that require instant, simultaneous changes to hundreds of devices, the sequential nature of the shift registers becomes a limiting factor.
Ultimately, this work provides a clear, data-driven roadmap for engineers and makers who need to connect many devices to a small computer. It confirms that using multiplexers and shift registers is a highly effective way to overcome the physical limits of microcontroller pins, offering a massive increase in capacity for a very small cost in power and a manageable trade-off in speed. The study emphasizes that the best results come from combining these simple hardware tools with optimized software that speaks directly to the computer's hardware. By understanding these specific limits and advantages, builders can design systems that are both expansive and efficient, turning a small chip with a few pins into a powerful controller capable of managing a complex network of sensors and devices.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.