In your living room, the big display is what you want. But in an embedded project, often less is more. We think [bobricius] will agree since he submitted a tiny 4×5 LED display into our square inch challenge. The board features an ATtiny CPU and twenty SMD LEDs in a nice grid. You can see them in action, scrolling to some disco music in the video below.
There is plenty of room left in the CPU for bigger text strings — the flash memory is just over 10% full. A little side-mounted header makes it easy to program the chip if you want to change anything.
What makes a game a game? Like, how do we know that we’re looking at a variation of PONG when confronted with one? And how do we know how to play it? [Bertho] sought to answer this question as he designed what is probably the smallest-ever 1-D PONG game. His answer involves charlieplexing LEDs, using a voltage divider to save I/O pins, and a couple of AAAs that should last for a long, long time.
[Bertho]’s Minimum 1-D PONG, or m1dp for short, puts an ATTiny85 through its paces as gameplay quickly progresses from ‘I got this’ to ‘no one could possibly keep this up’. This state machine sleeps until one of the two buttons is pressed, at which time a wait animation starts. The action begins with the next button press.
Game play across only five LEDs makes for some pretty intense action, too. Fortunately, the buzzer is a big part of the experience. It sounds one tone for each LED when the ball is in play, and a different tone to confirm button presses. [Bertho] saved so many I/O pins with charlieplexing that he added a green LED that lights up when it’s OK to return the ball. If we were playing, we’d keep our eye on this LED instead of trying to watch the ball. We’re serving the demo after the break point, so don’t let it get past you.
For a study in minimalism, there sure is a lot going on here with all the different tones and animations. If you’d prefer maximalist 1-D PONG, there’s always LED strips. If dungeon crawlers with satisfying hardware are more your thing, you really need to check out Twang.
[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!