element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project Videos
  • Challenges & Projects
  • element14 presents
  • Project Videos
  • More
  • Cancel
Project Videos
Documents Charlieplexing Buttons and LEDs at the Same Time - How Hard Can It Be? -- Episode 604
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Project Videos to participate - click to join for free!
Related
Recommended
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 10 May 2023 5:43 PM Date Created
  • Last Updated Last Updated: 26 May 2023 7:24 AM
  • Views 30054 views
  • Likes 9 likes
  • Comments 15 comments

Charlieplexing Buttons and LEDs at the Same Time - How Hard Can It Be? -- Episode 604

So many buttons so little IO. When you want to drive a large number of LEDs or read buttons the obvious choice is multiplexing them. But there is a method called charlieplexing that lets you use even more LEDs and buttons with even less IO pins. Clem wants to interface a large amount of buttons and LEDs with a microcontroller but has a limited number of pins.   He's also trying to save money on parts. Could you just replace expensive signal diodes with cheap LEDs? Could you use the same pins to read buttons and drive LEDs in the same matrix? Could you also achieve true n-key rollover without having a diode on every single button? How hard can it be?

Watch the Video:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Bonus Content:

  • Login to Download the Code!

Bill of Material:

Product Name Manufacturer Quantity Buy Kit
LED, Super Red, Through Hole, T-1 3/4 (5mm), 12 mA, 5 V, 640 nm Multicomp 9 Buy Now
Arduino Mega 2560, ATmega2560, 54 I/O, 256KB Flash, 8KB SRAM, 4KB EEPROM Arduino 1 Buy Now
Jumper Wire Kit, Multicolour, 2 mm - 125 mm, 22 AWG, 140 Piece Multicomp 1 Buy Now
Breadboard, Mounted, 1580 Pin, 10mm, x 135mm Multicomp 1 Buy Now
 

element14 presents

element14 presents  |  About Clem  |  Project Videos

  • buttons
  • keyboard
  • multiplexing
  • leds
  • Charlieplexing
  • arduino
  • friday_release
  • arduino mega
  • e14p_CMM
  • Share
  • History
  • More
  • Cancel
Actions
  • Share
  • More
  • Cancel
  • Sign in to reply
Parents
  • shabaz
    shabaz over 2 years ago

    From what little I've seen, Charlieplexing can work well. Plus, it's ultra-low cost which can be a huge advantage.

    As another approach, sometimes dot-matrix boards use a single serial-to-parallel logic IC, like (say) 74HC164 for (say) a row, and then does a round-robin scan across the column with a johnson counter type IC like 74HC4017.

    Another classic way is the MAX7219, which (contrary to the typical use for it) doesn't need to be used with 7-segment displays, it can control arbitrary LEDs in any matrix/array up to 8x8 (and they can be chained up for multiples of 64). Works brilliantly, I used a couple of them once for driving 120 LEDs for a clock dial display. The benefit is that the code doesn't need to do any scanning, but the disadvantage is the cost (MAX7219 is really expensive nowadays, but there are ultra-cheap clones of it). There are lots of modern LED driver replacements (some with bult-in keyboard scanning), but the MAX7219 probably has a ton of example code since it is so mature.

    For buttons, a cheap approach that eliminates scanning code effort, is to use an I2C or SPI I/O expander IC, because most of them have an interrupt output. The code just needs to read the I/O expander whenever the interrupt occurs. But as mentioned, all of these approaches will cost more in hardware (but simplify the software).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 2 years ago in reply to shabaz

    loading off code complecity to dedicated ICs is clearly adavantageous for sophisticated designs. the thing i inparticular like a botu a combined chalieplexed matrix of buttons and leds is the ability t ochange its purpose in software.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • mayermakes
    mayermakes over 2 years ago in reply to shabaz

    loading off code complecity to dedicated ICs is clearly adavantageous for sophisticated designs. the thing i inparticular like a botu a combined chalieplexed matrix of buttons and leds is the ability t ochange its purpose in software.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube