web analytics

Driving 4×7 LED with 4 resistors only (kinda Charlieplexing)

Aka cheap LED driver

Traditional way of connecting 4 digits x 7segment display to microprocessor suggest using 4 transistors and 12 resistors:

Would You be interested in shrinking everything down to LED display and 4 resistors ONLY ?

Then continue reading.

Assuming one LED segment (digit’s stick) drives 20mA current this setup can take up to 160mA of power (7segments+dot)*20 if we will use multiplexing (turning just one digit at a time, then next, then next,… an doing it very very fast). Even this trick takes too much power for portable devices running on batteries.

Now I’will try to illustrate traditional multiplexing vs. proposed kinda charlieplexing:

In multiplexing each digit lights-on then turns-off, then next lights-on, and so on:

In charlieplexing each segment of digit lights-on then turns-off, then next lights-on, and so on:

As You see this way we never exceed 20mA – because at every moment only one segment is active. This reduces power consumption and eliminates need of transistors – maximum current limit of digital pins Arduino boards – 40mA.

Plain 4×7 LED modules

They come in two flavours – common cathode(upper diagram) and common anode(lower diagram):

Pinout diagram:

As You see, it is enough to put a resistor on each digit common pin (12, 9, 8 or 6) and we have limited current to desired value. I used 5V logic and 220ohm resistors, I = U/R = 5/220 = 23mA.

First prototype was mini breadboard on top of Arduino UNO:


The schematic:

Next thing is code

This code was written for common anode version, if You have common cathode just swap “0” and “1” in program code. I intentionally separated first digit (meters) from centimeters, so my second digit in this program is always off (digit value = 10). Everything else is pretty straightforward, but if You have questions ask them in comments.

I needed additional functions like segment blinking, “Err ” and “- – – -” (no signal) symbols. You can add any imaginable functionality to it. After several tests I made second working prototype I’ll be using later in other projects:


This Arduino Pro Mini has additional i2c control code inside (I have whole article about it) and acting like specialized LED driver IC, but is completely customizable and even cheaper (just 2.5$ if You buy it from ebay). Total cost of this i2c LED display is about 5$.

Short proof video:


If I helped You, please help me. Thank You!

Error: Your Requested widget "Buy Me a Beer Donation " is not in the widget list.
  • [do_widget_area blog-widget-area]
    • [do_widget id="pippin_recent_posts-3"]
  • [do_widget_area first-footer-widget-area]
    • [do_widget_area fourth-footer-widget-area]
      • [do_widget_area header-widget-area]
        • [do_widget_area primary-widget-area]
          • [do_widget id="search-2"]
          • [do_widget id="recent-posts-2"]
          • [do_widget id="recent-comments-2"]
          • [do_widget id="archives-2"]
          • [do_widget id="categories-2"]
          • [do_widget id="meta-2"]
        • [do_widget_area search-widget-area]
          • [do_widget_area second-footer-widget-area]
            • [do_widget_area shop-widget-area]
              • [do_widget_area third-footer-widget-area]
                • [do_widget_area top-left-widget-area]
                  • [do_widget_area top-right-widget-area]
                    • [do_widget_area widgets_for_shortcodes]
                      • [do_widget id="buymeabeer-2"]
                    • [do_widget_area wp_inactive_widgets]
                      1. Pingback: Multiplexing vs Charlieplexing | All Things Tech

                      Leave a Comment