[David Johnson-Davies] created a minimal Secret Maze Game using a single ATTiny85 and a few common components. This simple game uses four buttons, four LEDs, and a small speaker. The player moves in the four cardinal directions using buttons, and the LEDs show walls and corridors. If an LED is lit, it means the path in that direction is blocked by a wall, and attempting to move in that direction will make a beep. When the player reaches the exit, a short victory tune chirps from the speaker.
Since the ATTiny85 has only five I/O lines, [David] had to get a bit clever to read four buttons, display output on four LEDs, and drive a little speaker. The solution was to dedicate one pin to the speaker and the other four to charlieplexing, which is a method of driving more LEDs than you have pins. It takes advantage of the fact that most microcontroller pins can easily switch state between output high, output low, or low-impedance high-impedance input.
As for the buttons, [David] charlieplexed them as well. Instead of putting an LED in a charlieplexed “cell”, the cell contains a diode and an SPST switch in series with the diode. To read the state of the switch, one I/O line is first driven low and the other I/O line is made an input with a pullup. A closed switch reads low on the input, and an open switch reads high. With charlieplexing, four pins is sufficient for up to twelve LEDs (or buttons) in any combination, which is more than enough for the Secret Maze.
Like any reasonable person, [daqq] decided it would be fun to “solve one of those nasty [electrical engineering] puzzles/exercises where you start out with a horrible mess of wires and resistors and you are supposed to calculate the resistance between two nodes.” You know, just an average Saturday night. At the time, he was also fascinated by Charlieplexing – an awesome technique that either allows one to control multiple polarized components, such as LEDs, simply by connecting them in a specific way. After toying with the idea for a while, [daqq] found that using just Charlieplexing would be“a horrible mess” but he didn’t stop there. Drawing inspiration from Charlieplexing, he came up with the idea to connect things in such a way that every node is connected by one connection to every other node – a complete graph from a topological view point (this makes so much more sense visually). From here, he was able to set pins to HIGH, LOW, or INPUT and gather all the data needed to solve his linear system of equations.
Now, there is a balance to everything, and while this system can determine the resistance of .5*N(N-1) resistors using just N wires, it also a memory and computation hungry method. Oh well, can’t have it all. But, while it’s computationally hungry, [daqq] got it working on an ATMega32, so it’s not an unmanageable feat. And, let’s not forget to mention [daqq’s] wonderful writing. Even if you don’t know linear algebra (or would rather forget), it’s a good read from a theory perspective. So good, in fact, that [daqq] is getting published in Circuit Cellar!
If you need a very thin, low power display that doesn’t use a whole bunch of pins on your microcontroller, [bobricius] has just the thing for you. His entry to the Hackaday Prize this year is a Charlieplexed LED display. With this board, you can drive 110 LEDs using only 11 GPIO pins.
Charlieplexing is a bit of a dark art around these parts. That’s not to say the theory is difficult; it’s really just sourcing or sinking current from a GPIO pin and arranging LEDs unparallel to each other. The theory is one thing, implementation is another. To build a Charlieplexed LED matrix, you need to go a bit crazy with the PCB layout, and god help you if you’re doing this point-to-point on a perf board.
Somehow, [bobricius] managed to fit 110 LEDs on a PCB, all while managing to break out those signal wires to a sensible set of pads on one side of the board. Only eleven pins are required to drive all these LEDs, making this project a great foundation for some very cool wearables or other projects that require a bright, low-res display.
Since [bobricius] can put 110 LEDs on a small board, he can obviously take LEDs away from that board. That’s what he did with his cut down version designed to be a clock. Both are great little boards, and the perfect solution for tiny displays for low-pin-count micros.
There’s a new challenger on the block for the title of the “Worlds Smallest 4x4x4 RGB LED Cube“. At 13x13x36 mm, [nqtronix]’s Cube Pendant is significantly smaller than [HariFun’s] version, which measures in at about 17x17x17 mm just for the cube, plus the external electronics. It took about a year for [nqtronix] to claim this spot, and from reading the comments section, it seems [HariFun] isn’t complaining. The Cube Pendant is small enough to be used as a key fob, and [nqtronix] has managed to really cram a lot of electronics in it.
The LED’s used are 0606 RGB’s which are 1.6mm square, although he did consider using 0404’s before scrubbing the idea. There’s many ways of driving 192 IO’s, but in this case, Charlieplexing seemed like the best solution, requiring 16 IO’s. Unlike [HariFun]’s build, this one is fully integrated, with micro-controller, battery and everything else wrapped up in a case made entirely from PCB — inspired by [Voja Antonic]’s FR4 enclosure technique, and the LED array is embedded in clear resin.
[Tim]’s Dice10 is an exercise in minimalism. Building an electronic dice using an ATtiny10 with code that fits within 1kB is not too difficult. Charlieplexing the LED’s would have used three of the four available GPIO pins. [Tim] upped the game by using just two GPIO pins to drive the seven LED’s for the dice. A third GPIO is used as a touch button input. Besides the ATtiny and the LED’s, the only other component used is a capacitor across the supply inputs.
The LED’s are grouped in three pairs of two LED’s and a single centre LED. Usually, Charlieplexed LED’s are connected across pairs of GPIO pins. But his scheme includes connections to the 5V and GND terminals, besides the two GPIO pins. Building a truth table makes it easy to figure out what’s going on.
STATE PB2 PB0 LED's
1 Z Z --
2 L Z LED 1/2
3 H Z LED 3/4
4 Z L LED 5/6
5 Z H --
6 H L LED9
7 L H --
8 H H --
9 L L --
Only the logic states used are listed in the table. It’s possible to add two more LED’s between PB0 and GND and one more anti-parallel with LED9, making a total of 10 LED’s driven by two pins. That’s quite a hack. The important thing here is to have two LED’s in series in the arms that connect to either 5V or GND.
[Tim] has posted the code and hardware source files on his Github repo, and his blog post has some additional details on how he solved the problem.
If you’re looking for more inspirations on minimal dice designs, check this “PIC powered pair of electronic dice” which uses a PIC 12F629 with five outputs driving a pair of 7 pips to make a dual dice.
If you have a cool project in mind, there is still plenty of time to enter the 1 kB Challenge! Deadline is January 5, so check it out and fire up your assemblers!
Cutting out precise shapes requires a steady hand, a laser cutter, or a CNC mill, right? Nope! All you need is PCB design software and a fabrication facility that’ll do the milling for you. That’s the secret sauce in [bobricius]’s very pleasing seven-segment display design.
His Hackaday.io entry doesn’t have much detail beyond the pictures and the board files, but we’re not sure we need that many either. The lowest board in the three-board stack has Charlieplexed LEDs broken out to six control pins. Next up is a custom-routed spacer board — custom routed by the PCB house, that is. And the top board in the stack is another PCB, this one left clear of copper where the light shines out.
We want to see this thing lit up! We’ve played around with using PCB epoxy material as a LED diffuser before ourselves, and it can look really good. The spacers should help even out the illumination within segments, while preventing bleed across them. Next step? A matrix of WS2812s with custom-routed spacers and diffusers. How awesome would that be?
If there’s one thing we like, it’s blinky stuff, and you’re not going to get anything cooler than a display made of tiny SMD LEDs. That’s the idea behind this wristwatch and Hackaday Prize entry. It’s a tiny board, loaded up with an ATmega, a few buttons, and a bunch of LEDs in a big charlieplexed array.
The big feature of this display is the array of LEDs. This is a 16×5 array of 0603 LEDs packed together as tightly as possible. That’s a tiny, high-resolution LED display, but even with the ATmega88 microcontroller powering this board, all the LEDs are individually addressable, and a proper font for displaying the time, or anything else, is already mapped out.
LED matrices are pretty common around these parts, but building a custom display out of SMD LEDs is another level entirely. The best one we’ve seen was this unofficial badge from two DEF CONs ago. That was done the cheater’s way with a bunch of serially addressable LED drivers. This charlieplexed version goes above and beyond, and we’re eagerly awaiting the board files so this display can be replicated easily.
By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more