Thank you, I think I finally get Charlie plexing. I’ve seen it used with keyboard inputs but could never wrap my brain around it. Great video Paul, I’m going to be spending some time at the breadboard tomorrow that’s for sure. Now I need to dig through my chips and see if I can do this without the Arduino. One more thing I think the upload has some sound issues, someone commented that your mic sounded odd but the music at the end has the same tinny sound to it so I am not sure your mic is the issue. More likely TH-cam has messed up your sound.
It's a compression artifact. Why it's happening I don't know, but it's the same effect you get when you recompress music that was previously compressed.
My lazy ass would grab something like ws2812, but this could save the day one day. I will definitely try it out one day. Electronics keep surprising me. Thanks for sharing this witchery.
This happens maybe in some powerbanks where the LED bargraph is multiplexed by small number of pins of control chip but it is a tool to keep handy. The LED matrix looks like a truth table
Nice little project! I remember when I was first introduced to sinking and sourcing using a lm741 across a positive and negative rails....mind blowing!
I'll check out the whole video and read the comments, but right off the bat, can the brightness of each led be controlled also? Say have led1 come on at 100%, led 2 at 75%, led 3 at 50% and led 4 at 25%? Put another way, PWM. Can this work with PWM?
You won't be able to use pwm directly, but if your io pins and controller is fast enough you should be able to control the brightness of each led individually by just changing the amount of time you turn each led on manually in your code.
Hi, thanks for the clear explanation. You mention using a 7 segment led display but with common anode ( or cathode) designs I'm not clear how to wire the pins or adjust the code since the legs of the LEDs on the common rail are all connected. Any recommendations where I can find and explanation of how to do this?
Is there any risk of damaging the inputs or outputs by switching from input to output so quickly and often, and is there a noticeable performance impact of switching between input and output modes? Like enough to make a difference in brightness of segments of rapidly switched LED digits?
Just reading another comment there and it reminded me of something i wanted to ask!! Do you need to use resistors with leds when using arduino in general?? Or can it damage it? I know it can source a max of 20mA but would it strain it's self with no resistors when using leds is more what I'm trying to say???? P.s. That Charlie plexing is very cool. And I will definitely put it in my pocket for again.
You must use resistor for your 5MM LEDs. If you give them 5V directly, Arduino will supply more than 20mA for them, good scenario is LED died because of overcurrent, bad scenario is your Arduino's digital pin or PORT died (because absolute maximum for Arduino Uno pin is 40mA).
LED will draw approximately 20mA when you apply correct voltage for it. You use resistor to drop down the voltage over resistor (current limiting). Let's say your LED's forward voltage drop is "Vf", your source voltage is "Vcc". You want to draw "I" Amps of current from your source. You will calculate the resistor value like this: (Vcc-Vf)/I For example, Arduino pin is 5V, LED's drop is 2.2V and you want 20mA current to flow. (5-2.2)/0.02 = 2.8/0.02 = 140 Ohm
So your using the Arduino as Ground on the 2nd and 3rd tier LED's ? How are they finding ground ? I can't think of why this wouldnt work for driving FET's doing switching, eaaa ?
This works with L.E.D.s because they're essentially diodes. This is really a type of crude binary decoder circuit that uses the diode nature of LEDs to complete the decoding logic. You might need some extra diodes to get this to work with FETs. You could use something like the 40107b dual 2 input nand chips that have open drain, n channel FETs for outputs. You'd still need to spend some time working out the logic though.
I get what happens when we make one pin low and the other one high. But why do you change the pinmode to input to turn off both leds? That would make the pin float somewhere in between 0 and 5 volts, right? I mean if you make both pins low that would also make both leds turn off.
I love this illogical "logic". Most mortals would just never see that it could or can work. Then someone somewhere decides it does work and uses it and suddenly everyone says, "of course" and it becomes sort of knowledge that everyone uses. (Mabe that excluded creationists - but nothing's perfect). It's actually a jawdroppingly elegant principle. There are lots of examples of it (it has a name and I'm damned if I can remember what it is - simultaneous invention??) but if you look at discoveries like Newton and Leibniz with calculus, Darwin and Wallace with evolution. In this case what was impossible yesterday suddenly making perfect sense (or maybe that's the teacher?). It's sort of almost like boolean algebra fits into electronics like a glove but existed long before transistors.
I tried to read about Charlieplexing but just didn't really get it. This really makes it clear, at least to me. Thanks for the video and the code!
Thank you, I think I finally get Charlie plexing. I’ve seen it used with keyboard inputs but could never wrap my brain around it. Great video Paul, I’m going to be spending some time at the breadboard tomorrow that’s for sure. Now I need to dig through my chips and see if I can do this without the Arduino.
One more thing I think the upload has some sound issues, someone commented that your mic sounded odd but the music at the end has the same tinny sound to it so I am not sure your mic is the issue. More likely TH-cam has messed up your sound.
Is there something wrong with you microphone? This video sounds wierd!
It's a compression artifact. Why it's happening I don't know, but it's the same effect you get when you recompress music that was previously compressed.
Nice!! Those things you say why we didn't think about it by ourselves! :)
Thanks Paul!
Shouted you out in my last video, really learned a lot from you over the years
Thank you!
learnelectronics of course
That very cool. What is high Z is it just like a standby mode?? Iv heard it mentioned before with logic gates or something!!!?
High Z = High impedance
My lazy ass would grab something like ws2812, but this could save the day one day. I will definitely try it out one day. Electronics keep surprising me. Thanks for sharing this witchery.
I love you and your videos and I’m super sorry about your condition❤️❤️❤️
This happens maybe in some powerbanks where the LED bargraph is multiplexed by small number of pins of control chip but it is a tool to keep handy. The LED matrix looks like a truth table
Great video! thanks for posting this, it was incredibly informative.
Nice little project! I remember when I was first introduced to sinking and sourcing using a lm741 across a positive and negative rails....mind blowing!
I'll check out the whole video and read the comments, but right off the bat, can the brightness of each led be controlled also? Say have led1 come on at 100%, led 2 at 75%, led 3 at 50% and led 4 at 25%? Put another way, PWM. Can this work with PWM?
I don't think so.
You won't be able to use pwm directly, but if your io pins and controller is fast enough you should be able to control the brightness of each led individually by just changing the amount of time you turn each led on manually in your code.
Hi, thanks for the clear explanation.
You mention using a 7 segment led display but with common anode ( or cathode) designs I'm not clear how to wire the pins or adjust the code since the legs of the LEDs on the common rail are all connected. Any recommendations where I can find and explanation of how to do this?
Is there any risk of damaging the inputs or outputs by switching from input to output so quickly and often, and is there a noticeable performance impact of switching between input and output modes? Like enough to make a difference in brightness of segments of rapidly switched LED digits?
Just reading another comment there and it reminded me of something i wanted to ask!! Do you need to use resistors with leds when using arduino in general?? Or can it damage it? I know it can source a max of 20mA but would it strain it's self with no resistors when using leds is more what I'm trying to say???? P.s. That Charlie plexing is very cool. And I will definitely put it in my pocket for again.
Yes, resistors are necessary when working with LEDs. They will draw as much current as they can until they pop or burn out the source.
You must use resistor for your 5MM LEDs. If you give them 5V directly, Arduino will supply more than 20mA for them, good scenario is LED died because of overcurrent, bad scenario is your Arduino's digital pin or PORT died (because absolute maximum for Arduino Uno pin is 40mA).
LED will draw approximately 20mA when you apply correct voltage for it. You use resistor to drop down the voltage over resistor (current limiting). Let's say your LED's forward voltage drop is "Vf", your source voltage is "Vcc". You want to draw "I" Amps of current from your source. You will calculate the resistor value like this:
(Vcc-Vf)/I
For example, Arduino pin is 5V, LED's drop is 2.2V and you want 20mA current to flow.
(5-2.2)/0.02 = 2.8/0.02 = 140 Ohm
@@ntd0 thanks Nuru
@@keithking1985 You are welcome :-)
Sound was a little weird but I followed along and learned something new!
So your using the Arduino as Ground on the 2nd and 3rd tier LED's ? How are they finding ground ? I can't think of why this wouldnt work for driving FET's doing switching, eaaa ?
No grounds per se. When one leg is high and sources current, the other is low and sinks it.
This works with L.E.D.s because they're essentially diodes. This is really a type of crude binary decoder circuit that uses the diode nature of LEDs to complete the decoding logic.
You might need some extra diodes to get this to work with FETs.
You could use something like the 40107b dual 2 input nand chips that have open drain, n channel FETs for outputs.
You'd still need to spend some time working out the logic though.
Thank you, Summer is almost over and Then iT,S timé to visit you Channel everyday , so Nice this Charlyplexer." !
Witchcraft!!
Really nice, man! Thanks a lot! 😊
I get what happens when we make one pin low and the other one high. But why do you change the pinmode to input to turn off both leds? That would make the pin float somewhere in between 0 and 5 volts, right? I mean if you make both pins low that would also make both leds turn off.
No it doesn't make them float. It makes them inputs.
how does the pin_config and pin_state turn on/off the leds, is there a video on the topic?
Do an msgqe7 tutorial
Thanks for this
Wow...very cool
Awesome..
Very interesting
I love this illogical "logic". Most mortals would just never see that it could or can work. Then someone somewhere decides it does work and uses it and suddenly everyone says, "of course" and it becomes sort of knowledge that everyone uses. (Mabe that excluded creationists - but nothing's perfect). It's actually a jawdroppingly elegant principle.
There are lots of examples of it (it has a name and I'm damned if I can remember what it is - simultaneous invention??) but if you look at discoveries like Newton and Leibniz with calculus, Darwin and Wallace with evolution. In this case what was impossible yesterday suddenly making perfect sense (or maybe that's the teacher?). It's sort of almost like boolean algebra fits into electronics like a glove but existed long before transistors.
Kewl.