How much game can you get out of a chip with only 1 kB of flash memory and (five or) six free GPIOs? Well, you can get it to play the classic memory game, Simon. [Vojtak] is submitting this project for the 1 kB Challenge, but it looks like it’s already been used to teach simple microcontrollering to teenagers as well, so the code is actually straightforward to read, but full of nice features.
Neat tricks include sharing button-press sensing and LED driving on the same pin, which was necessary to make everything work on such a small chip. A simple linear-congruential pseudorandom sequence provides the variation, and it’s seeded by slow-clock/fast-clock timing jitter, so you’re probably not going to see the same sequence twice. (It’s not the best random number generator ever, but it’ll do.) If that weren’t enough, high scores (and the random seed for the game) are saved to EEPROM so that you can brag to your friends or re-live your previous moments of glory.
The board is easily solderable together as well. This is a fantastic beginner project, with details in the code that everyone can learn from. It’s a great game, and a great demonstration of what you can do with a dollar’s worth of parts and 1 kB of code.
Ever have trouble justifying your hacking to anyone from another generation? [Domen] presented his mother with a custom-made device that monitors the milk temperature as it boils on the stove, preventing boil-over. And he made the device robust, simple to use, and foolproof. To his mom, it must look like he’s a wizard — able to conjure up home electronics out of solder smoke and some plywood.
Of course, we know better. Inside his gadget is a simple temperature sensor, an ATtiny841, a very nice home-made PCB, a buzzer, an LCD, and some pushbuttons. [Domen] rubbed together a few pre-existing libraries, and had a working prototype inside a nice wooden box on the quick. It’s a simple hack, but imagine how this must look to a muggle. For the detailed incantations, check out [Domen]’s GitHub for the project.
We love it when someone takes inspiration from one of our posts and comes up with their own twist on it. [Matthew] liked one builds he saw on Hackaday so much, he built his own LED desktop Xmas tree!
[Matthew] was inspired by [designer2k2]’s DIY desktop Xmas tree that was posted in October. To get started, he found a set of concentric WS2812 rings over on Ali Express. The five rings total 93 LEDs, plus a single WS2812 for the top of the tree. He also got a laser cut tree model from Thingiverse and had it cut, combining the LED rings with the tree in the final product
The whole thing running on a Digispark USB Development Board from DigiStump, the same as the original project. There aren’t many details in the video, but [Matthew] has put links to where he got the rings and the tree, the laser cutting service, a link to the DigiStump website as well as a link to [designer2k2]’s original tree project. There’s no source code yet, but [Matthew] says a link to it is coming along with some more pictures.
Electromechanical solenoids are pretty cool devices. Move some current through an electromagnet and you can push a load around or pull it. If you’re MIT student [Lining Yao], you can use them to dance. [Lining] built TapBot, a re-configurable set of tap-dancing robots that are both modular and modern. She even rolled her own solenoids.
The one with the eye stalk is the bridge, and it’s connected to a computer over FTDI. The other nodes attach to the bridge and each other with small magnets that are designed to flip around freely to make the connections. These links are just physical, though. The nodes must also be connected with ribbon cables.
Each of the nodes is controlled by an ATtiny45 and has a MOSFET to drive the solenoid at 8-12 V. [Lining] snapped a small coin magnet to the end of each solenoid slug to provide a bigger surface area that acts like a tap shoe. TapBot can be programmed with one of several pre-built tap patterns, and these can be combined to make new sequences. The curtain goes up after the break.
[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!
[Mitxela] wanted to build a different kind of mouse, one that worked like an Etch-a-Sketch toy with one X knob and one Y knob. Armed with some rotary encoders and a microcontroller, that shouldn’t be hard. But when you use a pin-limited ATtiny85, you are going to need some tricks.
The encoders put out a two-bit Gray code and close a button when you depress them. Plus you need some pins for the V-USB stack to handle the USB interface. [Mitxela] decided to convert the encoders to output analog voltages using a simple resistor DAC. That would only require two analog inputs, and another anlaog input could read both switches.
One problem: there still wasn’t quite enough I/O. Of course, with AVRs you can always repurpose the reset pin as an analog pin, but you lose the ability to program the device at low voltage. And naturally, there’s a workaround for this too, allowing you to keep the reset pin and still read its analog value. You just have to make sure that value doesn’t go below about 2.5V so the device stays out of reset. Once that was in place, the rest went easy, as you can see in the video below.
The “normal” way to build a spectrum analyzer is to collect a bunch of samples and run a Fast Fourier Transform (FFT) on them all in one shot. As the name implies, the FFT is fast, and the result is the frequency components of the sampled data. [agp.cooper]’s “wrong” way to do it takes the Goertzel algorithm, which is used for detecting the intensity of a particular frequency, and scanning across the frequency range of interest. It’s a lot slower than a single FFT but, importantly for the ATtiny85 that he implements this on, it’s less demanding of the RAM.