What about sharing led pins with the switches? Either drive each switch with the normal led scan, or have a switch only scan after every led frame where you pulse one the switch pins. You can use the analog in put to read what will be a 0 or 3v signal from each switch, in sequential order. Resistors on the output of each switch will isolate the driving pin if multiple buttons are pressed.
@@gsegallisYes, you can charlieplex buttons as well, note you must add a diode to each switch to prevent button presses from shorting out rows in your LED matrix.
@@swarupsahu6611 What do you mean? Analog video by definition cannot be transmitted via WiFi. However, it is possible to digitize analog video and transmit the digitized video over WiFi, that can also be to an esp32. Note that you will probably need to choose a format and size that the esp32 can handle, but RU-vid is doing the same; on low bandwidth devices it will select a higher compression for you.
A couple of other tricks you can do : Measure the battery voltage and adjust the LED drive duty to maintain constant-ish current. for the buttons, use the LED matrix pins to scan a "1" across the pins, with a resistor from each pin through a switch to a common line, with a pulldown resistor, sensing with an ADC, or maybe logic level if that can work with the LED drive stuff. Or you could use 3 dual diodes instead of the series R's. Could maybe flip the button pin to input briefly for the measurement.
@@grindfi If you have Red green and blue subpixels, you can stagger the LEDs for more perceived resolution. You would not gain back all the resolution, but it would help. So the resolution would cut in a third, but then you could double the 'virtual resolution' with staggered LEDs, which would appear to about 1.5x the actual resolution.
@@rich1051414This reminds me of the Apple II subpixel trick. They used alternating green and magenta subpixels, allowing a white pixel at twice the horizontal accuracy.
Imagine a real monitor using LEDs instead of OLED displays and being able to get to insane refresh rates. We could actually achieve this using micro LEDs for a RGB >1080p screen. This would be the future of monitors
Adding a tiny plastic shroud around your battery will make the negative protected. If your board is designed with a Vcc plane instead of a ground plane this will allow for the metal battery connector.
it's the same way that I bit bang i2c, I set the output low to pull the line down and set it to an input to let it go high. this give me a open collector type output on uC. so data is transferred just by changing port from output to input and not changing what's on the port, always a low. Works for me.
It got named Charlieplexing after a Maxam guy who did it but I invented before him, published before him (on the PICist) and apparently others were before me too. It's one of those things that was going to occur to inventive people once tristating of microcontroller pins was available.
In a Charlieplexed LED matrix, each LED is connected between two microcontroller pins. By selectively setting these pins to high, low, or as high-impedance inputs, the LEDs can be individually controlled. The name "Charlieplexing" is derived from Charlie Allen, who developed this technique.
I didn't figure out until going back after finishing the video - only 1 column of LEDs is on at a time! I was confused at first. I think you should add a micro-sd slot! Anyways, it's a really cool project
Adding a sdcard slot would be really cool, as he could save some animations on it. Of couse more pins are needed, but at this point just get an ESP32 or something. It has SDCard+USB support "built-in" and a lot of pins.
I think he had run out of pins for the micro, but with his bigger one now who knows, He's on live tonight I think (wednesday) as "Bitluni Live" at 20-00 UTCish, I'll be their.
I've used this technique in 1995. Learned it from some mailing list or BBS or Yahoo groups while working on a 68HC11 project. It didn't have a name back then, but a multiplexing trick someone knew and passed it along. Now this Charlie dude comes along and grabs the glory in 2003 while some other smart dude who was the true inventor of this technique got shafted and forgotten.
If you were on the PIClist then I posted around 1998. Microchip posted it in a book of tricks as "Charlieplexing" after Y2K. They also posed a simpler version of a matrix keypad in that same booklet, using a resistor ladder like bitluni did here. My one was around 2001 and I was surpriced to see that also pop up as known, later by Microchip. Mine was for an elevator manufacturer, a customer of mine then and I was maxing out the capabilities of an AtMega chip I was using for lift monitoring. If you wiki it, someone went in the waybackmachine and found my piclist entry for bipolar tristated LED multiplexing and even stuff preceeding it. So it doesn't get Grahamplexing either 😅 Lots of things like this have their time to be invented. Many inventions were independently invented and some the glory was stolen for sure but usually it starts with publicity of some breakthrough and inventive minds using it to finish a mental puzzle. For me it was simply wanting to drive a large number of LEDs and knowing that PICs can tristate. Using bipolar LED pairs gave me twice the LEDS I'd get from multiplexing alone. I did another one more recently with 20 off an 8 pin CH32V RISC-v micro but bitluni's used a few more LEDs than that...
if you don't patent or at least make your work known... you tend to get forgotten. I'm sure Charlie wouldn't mind taking the back seat if the other person was able to prove their "invention", right?
Pretty sure multiplexing has existed for long enough nothing significant has been invented the past decade or so for driving a tiny LED display like this.
@seanabsher5577 Carl Fredric Gauss is not forgotten, yet they continue to discover routines, etc. in his unpublished works. Poor students come to him with a solution and he would open a bottom drawer, rustle some papers and show the student he'd found that answer 10 years before. Lol
I wonder, if you could make a 720*400 matrix it might be possible to make a ttl led monochrome monitor. It'd be a challenge to get the aspect ratio right but it might be a promising avenue.
The 3.2V max in the LED datasheet is referring to the forward voltage of the LED when 5mA is flowing through it. Typically it is 2.8V, but variation from part-to-part could make the forward voltage as high as 3.2V. This specification does not refer to the maximum allowable voltage; typically LEDs are specified by the maximum current (30mA for this particular LED). If you were to apply 3.2V to one of these LEDs from a high-current power supply, the current would likely be higher than 5mA. Typically microcontrollers have current limiters on the IO pins, and a decent output resistance, which allows you to drive LEDs with them.
If u have adc you can make the buttons connect different resistors and make a voltage divider that outputs different voltages. Can cram a lot of buttons on 1 adc pin
Well, it would be a bit of a problem because he also has a 3 volt input and a 5 volt input, which would cause some problems in adc, but i like your idea, the resistor keypad trick is used in almost every cheap thing where mcu pins are limited
A fantastic explanation: dunno why I had so much trouble wrapping my head around it--wish this had been out before I made the script and the video! Great job, thanks!
Now if the LEDs where a lot smaller (and greater in quantity), you added RGB, and you gave it control electronics (and power electronics) to match... You could make the world's fastest computer monitor.
If you ever sell these I’d be very interested in buying one, I’ve been looking for an entry point into the ch32v and I’d love to try to implement Tetris on it!
@@Slushee oh youre right im dumb, i didnt go back to look. i have no clue then. he doesn't have any links to buy them so maybe he got a deal where buying that many was the same price as just buying 5. I've gone on that site before and for some configurations they charge the same amount whether you buy 5 or 10 boards.
How about this, but with a esp32 using all available pins to get the most pixels as possible. No buttons, no nothing, only wifi and this board becomes a wifi display. How many pixels would that be?
25*24. 600 pixels monochrome pixels. But I doubt you can drive that many leds in series from the micro. So, use some proper multiplexers (which can also stack channels, but with a delay in responsiveness). Also, that board already has 1 dead led out of 240. Which is fixable (as opposed to lcd and oled panels), but you're probably going to have a pretty high failure rate. This is a good solution for low res displays or public displays, though. I would make it bigger, go for 16 or 20 leds in series and try different aspect ratios (like 8*30). Some of the public digital displays and scrolling text displays might already use this technique.
Well done bitluni. You might need a small cap on your keypad resistor ladder, could be the led direct drive is affecting the adc performance. If you can get an accurate sample while resetting tristates during persistance of visiin before the next frame then thats an easy sw solution
Reading resistor networks with ADCs has always been an issue, for me at least. It just fluctuates way too much and messes the button presses up. For instance, I've got a 12-Bit ADC to read the resistor network of my car's multimedia buttons on the steering wheel, and just by turning the car on or off, I get wildly different ADC readings, throwing it off.
For those who don't want to use a "strange" MCU with a typical "Chinese" datasheet, there is a PI4IOE5V6416 I2C 16-bit expander for any other MCU. 50mA I/O current capability, R/W pin configuration (a Z-state), 24TQFN, up to two devices on a same bus Yeah, and thank you for the great idea for my big matrix 8x5x30 indicator ) Merely lost a hope to find a good one manufactured
Excellent video, again! 👍 Great LED driving idea! Didn't thought about it as way to drive LED matrix. But I used similar method with all 3 states for other different projects.. 😂
I did some experiments with Charlieplexing a few years ago, it is a great technique but you have to select your components carefully and you need to keep the tracks as short as is possible. The biggest problem with Charlieplexing is ghosting (and to avoid this), especially when the LEDs are very sensitive. Using resistors (best way is without) can also introduce ghosting or a too slow update/pin switching speed. A too fast update speed (without resistors) can shorten the lifetime of the LEDs or can brownout the pins of the microcontroller over time. You need to find a safe balance between speed (without ghosting), visibiity and (overall) current. Remember we can only see 24 frames per second so there is enough room to skip frames (blank = no output) to reduce the current and also extend battery life. And because of a lower speed (and completely off states) there is enough time to read the state of the buttons without interference (many times). I think you need to slow down to make it better.
Why do people believe the 24fps thing?? If you're referring to the flicker fusion rate, sure, but we can certainly see above 24fps. I can see light fixtures flicker at 60hz.
Maybe am wrong, but If you connect the diodes in the matrix in antiparallel, so 2 diodes for every positiion, and still use the H-L-Z levels, you get n² matrix. Be 1 and 2 the antiparalell diodes, pin A column, ping B rows.. Then they light when: B/A Z L H Z - - - L - - 1 H - 2 - Rest of columns does not light because are Z
Huffman encoding and lowering the frame rate, He's normally live tonight (Wednesday) at 20-00 UTC as "Bitluni Live", you can watch him do these projects their.
Looks cool:) What is the current limit on the microcontroller io pins? The current of one LED is 20mA, but there are 16 of them in one column... I don’t think the pin can output more than 100mA. Or maybe the LEDs do not work simultaneously within the same column? Then how many LEDs can light at the time in one column?