Charlieplexing 90 LEDs (10 Pins)

by CWLim1000 in Circuits > Arduino

259 Views, 0 Favorites, 0 Comments

Charlieplexing 90 LEDs (10 Pins)

Heart.jpg

Welcome to 10 x 9 = 90 LEDs charlieplexing.

I would like to thank JLCPCB for its generous sponsor for my PCBs that make this project a success!

Let us start off with how to get your PCBs printed with the JLCPCB, and then we will move on with the working principle of the Charlieplexing, the things that we will need, and the Arduino microcontroller code.

How to Get Your PCBs Printed With the JLCPCB?

Login page.png
Sign In.png
Create account page.png
Order page.png
Save to cart.png
Add new item.png
Checkout securely.png

1. Go the https://jlcpcb.com/

2. Click on Sign in on the top right-hand corner of the screen.

3. Create your account.

4. Click on Order now on the top right-hand corner of the screen.

5. Click on Add your gerber file.

6. You may change the settings of the file, such as the quantity, PCB color. After finishing, press SAVE TO CART.

7. You may wish to add new items for the same shipment. Press Add new item on the right of the screen.

8. Press Checkout Securely on the right of the screen.

9. Fill in your Shipping Address, Shipping Method, Submit Order, and Payment.

You will receive an email once your files are in production.

Gerber files for charlieplexing:

https://drive.google.com/drive/folders/1uCPCvnMa71...

How Does Charlieplexing Work?

2 pins.png
3 pins.png
10 pins.png
U and D LEDs.png

Charlieplexing makes use of the 2 states of output, that is, on and off. It is an effective way of controlling multiple outputs like LEDs. For this project, we will use 90 LEDs to simulate the Charlieplexing.

The formula for calculating the number of LEDs = n^2 - n, where n is the number of pins.

For example, for 2 pins, the number of LEDs will be 2^2 - 2 = 2.

For 3 pins, the number of LEDs will be 3^2 - 3 = 6.

For 4 pins, the number of LEDs will be 4^2 - 4 = 12.

And for our project, which is 10 pins, the number of LEDs will be 10^2 - 10 = 90.

Truth Table of 90 LEDs

U and D LEDs.png
LEDs arrangement.png
LEDs row 1 and 2.png
LEDs row 3 and 4.png
LEDs row 5 and 6.png
LEDs row 7 and 8.png
LEDs row 9 and 10.png
New LEDs names.png

To begin, you may wonder what is a truth table?

A truth table is a digital logic table for each variable. The digital logic gives us either 1 (High) or 0 (Low).

We will be using the formula x*y.

After finishing the truth table, we will get the arrangement of the LEDs based on the schematic diagram.

U1 U10 U18 U25 U31 U36 U40 U43 U45

U2 U11 U19 U26 U32 U37 U41 U44 D1

U3 U12 U20 U27 U33 U38 U42 D10 D2

U4 U13 U21 U28 U34 U39 D18 D11 D3

U5 U14 U22 U29 U35 D25 D19 D12 D4

U6 U15 U23 U30 D31 D26 D20 D13 D5

U7 U16 U24 D36 D32 D27 D21 D14 D6

U8 U17 D40 D37 D33 D28 D22 D15 D7

U9 D43 D41 D38 D34 D29 D23 D16 D8

D45 D44 D42 D39 D35 D30 D24 D17 D9

We rename each LED as the following for simpler coding on the Arduino Microcontroller.

LED00 LED01 LED02 LED03 LED04 LED05 LED06 LED07 LED08

LED10 LED11 LED12 LED13 LED14 LED15 LED16 LED17 LED18

LED20 LED21 LED22 LED23 LED24 LED25 LED26 LED27 LED28

LED30 LED31 LED32 LED33 LED34 LED35 LED36 LED37 LED38

LED40 LED41 LED42 LED43 LED44 LED45 LED46 LED47 LED48

LED50 LED51 LED52 LED53 LED54 LED55 LED56 LED57 LED58

LED60 LED61 LED62 LED63 LED64 LED65 LED66 LED67 LED68

LED70 LED71 LED72 LED73 LED74 LED75 LED76 LED77 LED78

LED80 LED81 LED82 LED83 LED84 LED85 LED86 LED87 LED88

LED90 LED91 LED92 LED93 LED94 LED95 LED96 LED97 LED98

Things That We Need

PCB LED board.png
Jumper wires.jpg
Male header.jpg
Arduino Mega.jpg
5mm red LED.jpg

1. 1 x PCB LED board

2. Jumper wires (Male to Female)

3. Male headers

4. 1 x Arduino Mega

5. 90 x 5mm LEDs

Setting Up the Connection

1. Connect the digital pins of the Arduino D2 to D11 to the LED PCB board from left to right.

Arduino Microcontroller Code

Full Prototype

Heart and Arduino.jpg